3D Stencil Assembly
Draft for roadmap and required features for a flexible 3D finite elements stencil assembly approach.
While currently P1 elements are targeted, hopefully this approach will be (partly) reusable for higher-order elements.
In all steps, hard coding shall be avoided as often as possible - which may cost performance opposed to HHG.
- For constant operators this should not be an issue.
- For non-constant operators, we will need to measure the performance impact and may resolve it through code generation.
Approach (description for P1 elements and generalized to point-wise stencil assembly)
- choose logical micro-vertex coordinate on any macro-primitive (for constant operators, choose any)
- for each neighboring macro-cell (if the primitive itself is not a macro-cell): translate to logical micro-vertex coordinate on macro-cell (new distance coordinate system, see cb617c11, should allow for convenient transformations)
- find neighboring micro-cells (9268e7cd, ...)
- calculate local stiffness matrix for each neighboring micro-cell and store contributions per spanning micro-vertex (possible introducing a new Element-class)
- translate coords of micro-cells back to original macro-primitive coordinate system (via distance coord system)
- store in stencil