Skip to content

Conversation

@biancagi
Copy link
Contributor

This PR addresses two major issues in the previous design:

  1. Class mito::fields::Field was a wrapper around mito::functions::Function, even though “field-ness” was already fully expressible as a type-level property of functions defined on coordinates.
  2. There was a lack of symmetry between full-field analytic solutions to FEM boundary value problems and the discrete solution computed by the FEM solver (see for example Poisson benchmark). This asymmetry reflected in the fact that error norms could not be computed as L2 and H1 norms of the difference of the analytic and discrete fields.

To address the points above, this PR:

  1. Removes the Field<F> wrapper and introduces the field_c concept to express “functions defined on a coordinate system” directly at the type level. Differential operators (grad, div, …) now operate on field_c functions, eliminating redundant wrappers and clarifying the separation between symbolic functions and geometric operations.
  2. Removes asymmetries between exact and FE solutions in element-wise operations (e.g. error norms) and establishes a common, extensible localization interface.

Fields are now simply a concept of functions defined on a set of coordinates. This leads to major simplifications in the api.
It was redundant with respect to {derivative} from the {functions} namespace.
It was redundant with respect to {determinant} from the {functions} namespace.
Can be replaced by {functions::identity}, no need to bother fields.
In most cases, a 'literal constant' can be directly used. In other cases, it can be replaced by {functions::constant}.
No need to bother fields.
Can be replaced by {functions::constant}, no need to bother fields.
… field

The test is equivalent but now easier to read. Also, quadrature fields will be removed eventually.
Better to use the more explanatory {component} equivalent.
…instead of {operator[]}

{emplace} is more appropriate here because: 1) it does not need the value type to implement a default constructor; 2) it does not overwrite existing entries.
This coordinate resolves to 1-xi0-xi1-..., consistently with what expected for barycentric coordinates.
…arycentric coordinates of the reference simplex
Instances of this class can be localized on finite elements via the {localize} method.
Fem fields should be handed out by the function space.
Nodal fields are now handed out by the function space.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants