-
Notifications
You must be signed in to change notification settings - Fork 3
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
Compute curvature on mesh boundary and use in model specifications #152
Conversation
…xpressions for initial conditions or reactions
To do before merging:
|
First two points above have been completed (curvature needed to be divided by 2 for consistency in 3D). Spatially-dependent parameters may be implemented in a future PR. |
kappa_mf = d.MeshFunction("double", dmesh_half, 0) | ||
|
||
for i in range(len(cell_marker_vec)): | ||
mesh = d.MeshView.create(mf_cell, cell_marker_vec[i]) |
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 later: we could use the new create_meshview
function in dolfin to avoid some, But not all parallel issued
…ulation testing in tests folder
Added the few curvature calculation tests to the "tests" folder. The calculations in 3D are quite inaccurate here (likely very sensitive to the discretization); we could look into improving this calculation in the future. |
This PR includes the following additions to SMART:
In
mesh_tools
:compute_curvature
, which computes the mean curvature over specified boundaries and writes out curvatures as a vertex mesh function over the parent mesh. Currently only tested in 2D.return_curvature
as an argument tocreate_2dcell
. If only a half cell geometry is desired, curvatures are computed over the whole cell contour to avoid errors at the x = 0 axis, then linearly interpolated onto the half-cell mesh.In
mesh
:curvature
as an attribute ofparent_mesh
objects (is empty by default).In
model
:parent_mesh.curvature
is not empty, each compartment has an associated dolfin functioncurv_func
containing curvatures from the vertex mesh function mapped onto the compartment's FunctionSpace using the new functionmodel.mf0_to_fun
.curv
as a free symbol, then the associatedcurv_func
is substituted into this expression when evaluating the initial condition inmodel.dolfin_set_function_values
In
model_assembly
:curv
to equation variables for reaction that includecurv
as a free symbol.A new version of example 2,
example2_withcurv
has been added to demonstrate use of the new features.