-
-
Notifications
You must be signed in to change notification settings - Fork 228
Open
Description
Currently, DOLFINx uses two UFL concepts, namely ufl.Constant and ufl.Coefficient.
The ufl.Constant is tied to a domain (dolfinx.mesh.Mesh), even if it doesn't leverage any information from it.
The primal motivation for having a domain in Constant is differentiation (ref: FEniCS/ufl#313 (comment)).
However, we don't use this in DOLFINx atm.
Pros with dolfinx.fem.Constant:
- Faster packing, as there is only one value per domain
Cons with dolfinx.fem.Constant:
- Extra input to kernels, i.e. extra code and special handling in
FFCx - Extra packing routines in DOLFINx, i.e extra code
- No clear instructions on ownership of the values in the constant. One is required to manually sync this value.
Pros with dolfinx.fem.FunctionSpace(real_element)
- Clear ownership of values
- Differentiability
- Less code in FFCx and DOLFINx for packing and passing data to kernels.
Cons: - Slightly more packed data (real space is equivalent to packing a DG-0 function.
finsberg
Metadata
Metadata
Assignees
Labels
No labels