CEED / CEED/libCEED

AtPoints Operators - Add "foreign" field to support mapping between distinct element sets with consistent point sets

Open
#1,931 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
265
Forks
78
Avg merge
2d 8h
Merged PRs (30d)
11

Description

## Motivation
The particular use case is that I need to project a quantity from different mesh elements to the same set of points. The points here are "shared" between the two sides - they have the same quadrature weights and areas, etc., but they are grouped differently and have different reference coordinates for each set of elements.

After interpolating from each set of FEM nodes to points, I need to be able to evaluate a QFunction which takes the pair of values at each point as an input to compute some physics.

Finally, the resulting values are interp-transposed back to one of the element sets and finally added into the FEM L-vector.

## Current Approach
Currently, our at-point operators require that all element restrictions refer to the same elements, so that we can group points by their enclosing elements. As a result, this operation requires 2 "setup" operators (one for each set of mesh elements) that just interp to points, then 2 "output" operators (again, one for each set of mesh elements) to compute the physics and interp-transpose back to the mesh nodes.

This approach is particularly problematic for assembly (let's focus on diagonal), since our assembly routines only affect active outputs with the current active inputs. As such, all of the coupling between the two sets of mesh elements is lost. See https://gitlab.com/micromorph/ratel/-/merge_requests/1213 for an example of this approach.

## Proposed Solution
Introduce `CeedOperatorAtPointsSetForeignField()` which, in addition to the arguments to `CeedOperatorSetField()`, takes the reference coordinates and restriction for the layout of the other elements.

In implementations, we would have to first interpolate from the foreign fields to an intermediate point vector, then use an internally created at-points element restriction to extract the values needed for the QFunction.

Additionally, for diagonal assembly, we would have to include the foreign field's elements in the loop over input elements.

Here's a hand drawn diagram of the process as I foresee it.

[rough_foreign_field_diagram.pdf](https://github.com/user-attachments/files/25429096/rough_foreign_field_diagram.pdf)

Image

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.