Skip to content
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

Generic external point-evaluation data input in Firedrake #3084

Open
2 tasks
ReubenHill opened this issue Aug 30, 2023 · 0 comments
Open
2 tasks

Generic external point-evaluation data input in Firedrake #3084

ReubenHill opened this issue Aug 30, 2023 · 0 comments
Assignees

Comments

@ReubenHill
Copy link
Contributor

Following the merge of #2936 and, imminently I hope #3067, it would be handy to implement a generic tool for inputting external point data. I've outlined the general idea in this gist. Here's the idea:

  1. You have point data at various locations on various MPI ranks.
  2. You create a Firedrake mesh m which has vertices at the data coordinates. This does NOT need to respect the parallel decomposition of your data.
  3. You create a vertex-only mesh vm with point locations from your input data. By setting VertexOnlyMesh(..., redundant=False) we allow ourselves to input the locations directly from the MPI ranks where they are stored.
  4. We use vm.input_ordering to input our data values (see the corresponding manual section)
  5. We end up with a vertex-only mesh vm which has the same number of points as vertices of the mesh m. We create a CG1 space on m (P1CG(m)) such that we have point evaluation nodes at each of our point locations. The challenge then is to get the permutation from a f_point_data \in P0DG(vm) function which contains our point data to a f \in P1CG(m) function.
  6. The parallel-safe permutation matrix from P1CG(m) to P0DG(vm) is the interpolation matrix. We want the permutation in the other direction.
  7. Since permutations are orthogonal matrices, the transpose (given by the transpose interpolation) is the matrix we need. Since we are not currently barred from using transpose interpolators on primal Functions, we apply it to f_point_data \in P0DG(vm) giving f \in P1CG(m).

Again, I refer a reader to the gist where I demonstrate this.

Necessary changes

  • Add a utility function which creates a mesh given a set of point locations. This would be similar to mesh.plex_from_cell_list
  • Wrap the whole thing up in a function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants