Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/refactor and remeshing #142

Merged
merged 43 commits into from
Nov 29, 2022
Merged

Feature/refactor and remeshing #142

merged 43 commits into from
Nov 29, 2022

Conversation

sblauth
Copy link
Owner

@sblauth sblauth commented Nov 29, 2022

This update includes a major refactoring of the code. In particular, the remeshing workflow is completely re-worked, which introduces backwards-incompatible changes.

did this for cashocs.space_mapping and cashocs.nonlinear_solvers
Conflicts:
	cashocs/_optimization/optimization_problem.py
temp_dict is placed in the database
state_problem and adjoint_problem are now defined commonly for both shape and optimal control
This is updated right away when the corresponding values are updated.
This commit achieves a decoupling from io from the solver and optimization problem
@sblauth sblauth added the enhancement New feature or request label Nov 29, 2022
@sblauth sblauth self-assigned this Nov 29, 2022
cashocs/geometry/mesh_handler.py Fixed Show fixed Hide fixed

"""
super().__init__(optimization_problem)
super().__init__(optimization_problem, db)
self.form_handler = cast(_forms.ShapeFormHandler, self.form_handler)

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class

Assignment overwrites attribute form_handler, which was previously defined in superclass [OptimizationVariableAbstractions](1).
super().__init__(optimization_problem, db)

self.box_constraints = box_constraints
self.form_handler = cast(_forms.ControlFormHandler, self.form_handler)

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class

Assignment overwrites attribute form_handler, which was previously defined in superclass [OptimizationVariableAbstractions](1).
self.current_barycenter_y.val = barycenter_list[1]
self.current_barycenter_z.val = barycenter_list[2]
if self.mu > 0.0:
self.is_active = True

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class

Assignment overwrites attribute is_active, which was previously defined in superclass [ShapeRegularizationTerm](1).
self.target_surface = self._compute_surface()

if self.mu > 0.0:
self.is_active = True

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class

Assignment overwrites attribute is_active, which was previously defined in superclass [ShapeRegularizationTerm](1).
cashocs/_forms/shape_regularization.py Fixed Show fixed Hide fixed
self.target_barycenter_list = self._compute_barycenter_list()

if self.mu > 0.0:
self.is_active = True

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class

Assignment overwrites attribute is_active, which was previously defined in superclass [ShapeRegularizationTerm](1).
)

if self.mu > 0:
self.is_active = True

Check warning

Code scanning / CodeQL

Overwriting attribute in super-class or sub-class

Assignment overwrites attribute is_active, which was previously defined in superclass [ShapeRegularizationTerm](1).
@codecov-commenter
Copy link

codecov-commenter commented Nov 29, 2022

Codecov Report

Merging #142 (6ab8e30) into main (8ea4a2c) will decrease coverage by 0.03%.
The diff coverage is 94.40%.

@@            Coverage Diff             @@
##             main     #142      +/-   ##
==========================================
- Coverage   93.74%   93.71%   -0.03%     
==========================================
  Files          65       75      +10     
  Lines        5637     5735      +98     
==========================================
+ Hits         5284     5374      +90     
- Misses        353      361       +8     
Impacted Files Coverage Δ
cashocs/_typing.py 0.00% <0.00%> (ø)
cashocs/_utils/__init__.py 100.00% <ø> (ø)
cashocs/geometry/mesh.py 100.00% <ø> (ø)
cashocs/io/config.py 100.00% <ø> (ø)
...optimization/line_search/polynomial_line_search.py 82.22% <50.00%> (+0.70%) ⬆️
cashocs/_constraints/constrained_problems.py 92.63% <64.29%> (-0.23%) ⬇️
cashocs/io/mesh.py 75.17% <80.00%> (-2.55%) ⬇️
cashocs/space_mapping/shape_optimization.py 85.39% <81.58%> (+0.05%) ⬆️
cashocs/space_mapping/optimal_control.py 88.60% <81.63%> (-0.36%) ⬇️
cashocs/geometry/deformations.py 93.06% <82.35%> (+0.06%) ⬆️
... and 48 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

This is required for functools.singledispatchmethod.
@sblauth sblauth merged commit 6ab8e30 into main Nov 29, 2022
@sblauth sblauth deleted the feature/refactor_and_remeshing branch November 29, 2022 08:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants