-
Notifications
You must be signed in to change notification settings - Fork 24
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
Interface concentration discontinuities (fenicsx) #878
Interface concentration discontinuities (fenicsx) #878
Conversation
…mDiscontinuous from the correct module
convergence_rates.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably don't need to keep this
solution = self.field.solution | ||
indices = self.surface.locate_boundary_facet_indices( | ||
solution.function_space.mesh | ||
) | ||
self.value = np.max(self.field.solution.x.array[indices]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note for future: this is not safe in parallel
default_petsc_options = { | ||
"ksp_type": "preonly", | ||
"pc_type": "lu", | ||
"pc_factor_mat_solver_type": "mumps", | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should live in Settings
v_b = H.subdomain_to_test_function[subdomain_0](res[0]) | ||
v_t = H.subdomain_to_test_function[subdomain_1](res[1]) | ||
|
||
u_b = H.subdomain_to_solution[subdomain_0](res[0]) | ||
u_t = H.subdomain_to_solution[subdomain_1](res[1]) | ||
|
||
K_b = subdomain_0.material.get_solubility_coefficient( | ||
self.mesh.mesh, self.temperature_fenics(res[0]), H | ||
) | ||
K_t = subdomain_1.material.get_solubility_coefficient( | ||
self.mesh.mesh, self.temperature_fenics(res[1]), H | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix bs and ts
if self._mesh is not None: | ||
# create cell to facet connectivity | ||
self._mesh.topology.create_connectivity( | ||
self._mesh.topology.dim, self._mesh.topology.dim - 1 | ||
) | ||
|
||
# create facet to cell connectivity | ||
self._mesh.topology.create_connectivity( | ||
self._mesh.topology.dim - 1, self._mesh.topology.dim | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to go in setter
0c78549
into
festim-dev:fenicsx
Proposed changes
A massive thank you to @jorgensd who was instrumental in getting this functionality in FESTIM 🥇
This PR is a first (big) step towards interface discontinuities in the
fenicsx
branch (#719).(requires #764)
This new approach to conservation of chemical potential relies on the mixed domain approach implemented in dolfinx 0.8.0 and based off a demo available here
I created a new problem class
HTransportProblemDiscontinuous
- which is not yet complete - to avoid breaking existing functionality. We will complete this class by integrating transient, post-processing, ICs, etc. Eventually this whole class will be merged withHydrogenTransportProblem
.In the current interface, users need to provide correspondence between surfaces and volumes as well as listing interfaces and which volumes they are connected to:
I believe this can be streamlined by FESTIM under the hood but I'll keep that for a future PR.
Proposed user interface:
Types of changes
What types of changes does your code introduce to FESTIM?
Checklist