-
Notifications
You must be signed in to change notification settings - Fork 93
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
Split values into geometric mapping and function values #764
Conversation
Codecov ReportAttention:
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #764 +/- ##
==========================================
+ Coverage 93.08% 93.15% +0.06%
==========================================
Files 34 36 +2
Lines 5163 5229 +66
==========================================
+ Hits 4806 4871 +65
- Misses 357 358 +1 ☔ View full report in Codecov by Sentry. |
Seems to fix #616 (At least the example provided by @termi-official is not erroring, but tests are needed) |
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.
Sorry for the late review! I think this looks really good already. I left some questions on the design.
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.
LGTM, just some stylistic nits that you don't have to fix if you don't agree. Can also merge and then do smaller clean ups later to make it easier to review.
Please squash-merge (and use a better commit message than the default message containing all commits in the branch).
I think @AbdAlazezAhmed just had a good point on slack. Should we also update the new InterfaceValues in this PR or in a separate one? |
Thanks - did it now with 2cbd2b9 |
This PR splits
Values
into geometric values and function values, the main advantages arereinit!
forFaceValues
andCellValues
reinit!
methods.MultiCellValues
type (cf. MultiCellValues #680) this allows using only a single geometry cacheFor a more complete picture, please see #798.
For normal use, this is not breaking wrt. master (i.e. no direct field access).
However,
CellValues{<:VectorInterpolation}
cannot be dispatched on anymore. This can be added if required, but in that case perhaps (re-)introducingCellVectorValues
andCellScalarValues
as aliases is cleaner.Description of internal changes
Description of internal changes
where
QuadratureRule/FaceQuadratureRule
: No changes, contains the location andweights for the quadrature on the reference element.
GeometryValues
contain information about the geometric interpolation onthe reference element. These are used to calculate the required quantities
for (1) mapping mutable parts of
FunctionValues
from the reference element to theactual element and (2) calculating properties for the current cell, such as the
detJdV
for each quadrature point and the face
normals
.FunctionValues
contain information about the function interpolation onthe reference element, as well as caches for the value and gradient on the
current element.
Construction
The function interpolation (type parameter to
FunctionValues
) decides howit should be mapped, by defining
get_mapping_type(::Interpolation)
, possibleoptions are currently
IdentityMapping()
(same as what currently is in Ferrite),CovariantPiolaMapping()
(H(curl)), andContravariantPiolaMapping()
(H(div)).The type of mapping determines what information is required to be precalculated in
GeometryValues
, specifically if the hessian,d²M/dξ²
must be calculated or not.reinit!
(Calculation and application of mapping)First,
mapping::MappingValues
is calculated for the current quadrature point,q_point
, by using the precalculated values for the geometric interpolation ingeometry_values
and the cell's coordinates,x
:mapping = calculate_mapping(geometry_values, q_point, x)
This mapping object can be querried for information required to perform the mapping,
specifically the jacobian and the hessian. If the latter should be calculated is determined
by whether
d²M/dξ²
is calculated inGeometryValues
(which in turn was decided on construction based on the needs of the mapping type requested by the function interpolation).We use this
mapping
to first calculate thedetJdV
(+normals
inFaceValues
)and later in
apply_mapping!
to update the values inFunctionValues
appropriately fulling the requested mapping type.