32 MFEM_ABORT(
"Can't find a relation between the two GridFunctions");
41 int parent_dim = parent_mesh->
Dimension();
45 bool root_fes_reset =
false;
46 if (src_sm_dim == parent_dim - 1 && dst_sm_dim == parent_dim - 1)
56 if (src_l2_fec != NULL && dst_l2_fec != NULL)
82 root_fes_reset =
true;
91 auto *root_fec = src_sm_dim == parent_dim ? src_fec : dst_fec;
99 src_to_parent.reset(
new TransferMap(src, *root_fes_));
100 dst_to_parent.reset(
new TransferMap(dst, *root_fes_));
101 parent_to_dst.reset(
new TransferMap(*root_fes_, dst));
129 MFEM_ABORT(
"Trying to do a transfer between GridFunctions but none of them is defined on a SubMesh");
145 for (
int i = 0; i < sub_to_parent_map_.
Size(); i++)
152 CorrectFaceOrientations(*sub_fes_, src, dst);
163 for (
int i = 0; i < sub_to_parent_map_.
Size(); i++)
170 CorrectFaceOrientations(*sub_fes_, src, dst,
171 &sub_to_parent_map_);
175 dst_to_parent->Transfer(dst, z_);
176 src_to_parent->Transfer(src, z_);
177 parent_to_dst->Transfer(z_, dst);
181 MFEM_ABORT(
"unknown TransferCategory: " << category_);
196 if (parent_face_ori.
Size() == 0) {
return; }
201 bool face = (
dim == 3);
207 for (
int i = 0; i < (face ? mesh->
GetNumFaces() : mesh->GetNE()); i++)
209 if (parent_face_ori[i] == 0) {
continue; }
217 Fo[0] = parent_face_ori[i];
218 doftrans.SetFaceOrientations(Fo);
229 if (sub_to_parent_map)
232 doftrans.TransformPrimal(face_vector);
237 doftrans.InvTransformPrimal(face_vector);
240 for (
int j = 0; j < vdofs.
Size(); j++)
245 if (sub_to_parent_map)
254 dst[k] = s * face_vector[j];
int Size() const
Return the logical size of the array.
@ GaussLegendre
Open type.
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
int GetOrder() const
Return the order (polynomial degree) of the FE collection, corresponding to the order/degree returned...
virtual const StatelessDofTransformation * DofTransformationForGeometry(Geometry::Type GeomType) const
Returns a DoF transformation object compatible with this basis and geometry type.
int GetMapType(int dim) const
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
DofTransformation * GetElementVDofs(int i, Array< int > &vdofs) const
Returns indices of degrees of freedom for the i'th element. The returned indices are offsets into an ...
Ordering::Type GetOrdering() const
Return the ordering method.
void GetFaceVDofs(int i, Array< int > &vdofs) const
Returns the indices of the degrees of freedom for the specified face, including the DOFs for the edge...
const FiniteElementCollection * FEColl() const
Mesh * GetMesh() const
Returns the mesh.
int GetVDim() const
Returns the vector dimension of the finite element space.
static int DecodeDof(int dof)
Helper to return the DOF associated with a sign encoded DOF.
Class for grid function - Vector with associated FE space.
virtual void SetSpace(FiniteElementSpace *f)
Associate a new FiniteElementSpace with the GridFunction.
Arbitrary order "L2-conforming" discontinuous finite elements.
int GetNumFaces() const
Return the number of faces (3D), edges (2D) or vertices (1D).
Geometry::Type GetFaceGeometry(int i) const
Return the Geometry::Type associated with face i.
Geometry::Type GetElementGeometry(int i) const
int Dimension() const
Dimension of the reference space used within the elements.
Arbitrary order H(div)-conforming Raviart-Thomas finite elements.
Subdomain representation of a topological parent in another Mesh.
const Array< int > & GetParentElementIDMap() const
Get the parent element id map.
From GetFrom() const
Get the From indicator.
const Array< int > & GetParentFaceOrientations() const
Get the relative face orientations.
static bool IsSubMesh(const Mesh *m)
Check if Mesh m is a SubMesh.
TransferMap represents a mapping of degrees of freedom from a source GridFunction to a destination Gr...
void Transfer(const GridFunction &src, GridFunction &dst) const
Transfer the source GridFunction to the destination GridFunction.
TransferMap(const FiniteElementSpace &src, const FiniteElementSpace &dst)
Construct a new TransferMap object which transfers degrees of freedom from the source FiniteElementSp...
virtual const real_t * HostRead() const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), false).
virtual real_t * HostWrite()
Shortcut for mfem::Write(vec.GetMemory(), vec.Size(), false).
virtual real_t * HostReadWrite()
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), false).
void GetSubVector(const Array< int > &dofs, Vector &elemvect) const
Extract entries listed in dofs to the output Vector elemvect.
void BuildVdofToVdofMap(const FiniteElementSpace &subfes, const FiniteElementSpace &parentfes, const SubMesh::From &from, const Array< int > &parent_element_ids, Array< int > &vdof_to_vdof_map)
Build the vdof to vdof mapping between two FiniteElementSpace objects.
auto GetRootParent(const T &m) -> decltype(std::declval< T >().GetParent())
Identify the root parent of a given SubMesh.