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; }
248 bool face = (
dim == 3);
256 if (parent_face_ori[i] == 0) {
continue; }
264 if (doftrans == NULL) {
continue; }
266 vdoftrans.SetDofTransformation(*doftrans);
268 Fo[0] = parent_face_ori[i];
269 vdoftrans.SetFaceOrientations(Fo);
280 if (sub_to_parent_map)
283 vdoftrans.TransformPrimal(face_vector);
288 vdoftrans.InvTransformPrimal(face_vector);
291 for (
int j = 0; j < vdofs.
Size(); j++)
296 if (sub_to_parent_map)
305 dst[k] =
s * face_vector[j];
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.
Class for grid function - Vector with associated FE space.
int Dimension() const
Dimension of the reference space used within the elements.
int GetNumFaces() const
Return the number of faces (3D), edges (2D) or vertices (1D).
void SetSize(int s)
Resize the vector to size s.
const Array< int > & GetParentElementIDMap() const
Get the parent element id map.
void Transfer(const GridFunction &src, GridFunction &dst) const
Transfer the source GridFunction to the destination GridFunction.
virtual const double * HostRead() const
Shortcut for mfem::Read(vec.GetMemory(), vec.Size(), false).
static int DecodeDof(int dof)
Helper to return the DOF associated with a sign encoded DOF.
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...
int GetOrder() const
Return the order (polynomial degree) of the FE collection, corresponding to the order/degree returned...
Geometry::Type GetFaceGeometry(int i) const
Return the Geometry::Type associated with face i.
virtual double * HostWrite()
Shortcut for mfem::Write(vec.GetMemory(), vec.Size(), false).
void GetSubVector(const Array< int > &dofs, Vector &elemvect) const
Extract entries listed in dofs to the output Vector elemvect.
const FiniteElementCollection * FEColl() const
static bool IsSubMesh(const Mesh *m)
Check if Mesh m is a SubMesh.
const Array< int > & GetParentFaceOrientations() const
Get the relative face orientations.
FiniteElementSpace * FESpace()
Arbitrary order H(div)-conforming Raviart-Thomas finite elements.
int GetVDim() const
Returns vector dimension.
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 ...
Geometry::Type GetElementGeometry(int i) const
Mesh * GetMesh() const
Returns the mesh.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
RT GetRootParent(const T &m)
Identify the root parent of a given SubMesh.
int GetNE() const
Returns number of elements.
virtual int GetMapType(int dim) const
From GetFrom() const
Get the From indicator.
Ordering::Type GetOrdering() const
Return the ordering method.
Subdomain representation of a topological parent in another Mesh.
int Size() const
Return the logical size of the array.
virtual StatelessDofTransformation * DofTransformationForGeometry(Geometry::Type GeomType) const
Returns a DoF transformation object compatible with this basis and geometry type. ...
TransferMap(const GridFunction &src, const GridFunction &dst)
Construct a new TransferMap object which transfers degrees of freedom from the source GridFunction to...
virtual double * HostReadWrite()
Shortcut for mfem::ReadWrite(vec.GetMemory(), vec.Size(), false).
Arbitrary order "L2-conforming" discontinuous finite elements.