35 MFEM_ABORT(
"Can't find a relation between the two GridFunctions");
44 int parent_dim = parent_mesh->
Dimension();
48 bool root_fes_reset =
false;
49 if (src_sm_dim == parent_dim - 1 && dst_sm_dim == parent_dim - 1)
62 if (src_l2_fec != NULL && dst_l2_fec != NULL)
88 root_fes_reset =
true;
109 sub1_to_parent_map_);
115 sub2_to_parent_map_);
117 z_.
SetSize(root_fes_->GetVSize());
129 sub1_to_parent_map_);
141 sub1_to_parent_map_);
145 MFEM_ABORT(
"Trying to do a transfer between GridFunctions but none of them is defined on a SubMesh");
157 for (
int i = 0; i < sub1_to_parent_map_.
Size(); i++)
164 CorrectFaceOrientations(*dst.
FESpace(), src, dst);
175 for (
int i = 0; i < sub1_to_parent_map_.
Size(); i++)
182 CorrectFaceOrientations(*src.
FESpace(), src, dst,
183 &sub1_to_parent_map_);
196 for (
int i = 0; i < sub2_to_parent_map_.
Size(); i++)
203 CorrectFaceOrientations(*dst.
FESpace(), dst, z_,
204 &sub2_to_parent_map_);
206 for (
int i = 0; i < sub1_to_parent_map_.
Size(); i++)
213 CorrectFaceOrientations(*src.
FESpace(), src, z_,
214 &sub1_to_parent_map_);
216 for (
int i = 0; i < sub2_to_parent_map_.
Size(); i++)
223 CorrectFaceOrientations(*dst.
FESpace(), z_, dst);
227 MFEM_ABORT(
"unknown TransferCategory: " << category_);
242 if (parent_face_ori.
Size() == 0) {
return; }
247 bool face = (
dim == 3);
253 for (
int i = 0; i < (face ? mesh->
GetNumFaces() : mesh->GetNE()); i++)
255 if (parent_face_ori[i] == 0) {
continue; }
263 Fo[0] = parent_face_ori[i];
264 doftrans.SetFaceOrientations(Fo);
275 if (sub_to_parent_map)
278 doftrans.TransformPrimal(face_vector);
283 doftrans.InvTransformPrimal(face_vector);
286 for (
int j = 0; j < vdofs.
Size(); j++)
291 if (sub_to_parent_map)
300 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 vector dimension.
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.
FiniteElementSpace * FESpace()
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.
void Transfer(const GridFunction &src, GridFunction &dst) const
Transfer the source GridFunction to the destination GridFunction.
TransferMap(const GridFunction &src, const GridFunction &dst)
Construct a new TransferMap object which transfers degrees of freedom from the source GridFunction to...
virtual const real_t * HostRead() const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), false).
void SetSize(int s)
Resize the vector to size s.
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.
RT GetRootParent(const T &m)
Identify the root parent of a given SubMesh.