You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
You have point data at various locations on various MPI ranks.
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.
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.
We use vm.input_ordering to input our data values (see the corresponding manual section)
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.
The parallel-safe permutation matrix from P1CG(m) to P0DG(vm) is the interpolation matrix. We want the permutation in the other direction.
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
The text was updated successfully, but these errors were encountered:
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:
m
which has vertices at the data coordinates. This does NOT need to respect the parallel decomposition of your data.vm
with point locations from your input data. By settingVertexOnlyMesh(..., redundant=False)
we allow ourselves to input the locations directly from the MPI ranks where they are stored.vm.input_ordering
to input our data values (see the corresponding manual section)vm
which has the same number of points as vertices of the meshm
. We create a CG1 space onm
(P1CG(m)
) such that we have point evaluation nodes at each of our point locations. The challenge then is to get the permutation from af_point_data \in P0DG(vm)
function which contains our point data to af \in P1CG(m)
function.P1CG(m)
toP0DG(vm)
is the interpolation matrix. We want the permutation in the other direction.Function
s, we apply it tof_point_data \in P0DG(vm)
givingf \in P1CG(m)
.Again, I refer a reader to the gist where I demonstrate this.
Necessary changes
mesh.plex_from_cell_list
The text was updated successfully, but these errors were encountered: