27struct ParDerefineMatrixOp;
48 mutable int ltdof_size;
51 int ngvdofs, ngedofs, ngfdofs, ngdofs;
53 struct VarOrderDofInfo
56 unsigned short int edof;
71 Array<TdofLdofInfo> tdof2ldof;
74 Array<int> ldof_group;
77 mutable Array<int> ldof_ltdof;
80 mutable Array<HYPRE_BigInt> dof_offsets;
83 mutable Array<HYPRE_BigInt> tdof_offsets;
86 mutable Array<HYPRE_BigInt> tdof_nb_offsets;
89 Array<HYPRE_BigInt> old_dof_offsets;
95 mutable HypreParMatrix *P;
97 mutable Operator *Pconf;
105 mutable SparseMatrix *R;
107 mutable Operator *Rconf;
114 std::unique_ptr<ParFiniteElementSpace> pfes_prev;
117 Array<ParNCMesh::VarOrderElemInfo> ghost_orders;
120 void CheckNDSTriaDofs();
122 ParNURBSExtension *pNURBSext()
const
123 {
return dynamic_cast<ParNURBSExtension *
>(
NURBSext); }
125 static ParNURBSExtension *MakeLocalNURBSext(
126 const NURBSExtension *globNURBSext,
const NURBSExtension *parNURBSext);
128 GroupTopology &GetGroupTopo()
const
132 void ParInit(ParMesh *pm);
135 void CommunicateGhostOrder();
138 void SetTDOF2LDOFinfo(
int ntdofs,
int vdim_factor,
int dof_stride,
143 void SetRestrictionMatrixEdgesFaces(
int vdim_factor,
int dof_stride,
145 const Array<int> &dof_tdof,
146 const Array<HYPRE_BigInt> &dof_offs);
149 void SetVarDofMap(
const Table & dofs, Array<VarOrderDofInfo> & dmap);
155 void GetGroupComm(GroupCommunicator &gcomm,
int ldof_type,
156 Array<int> *ldof_sign = NULL);
159 void GenerateGlobalOffsets()
const;
162 void ConstructTrueDofs();
163 void ConstructTrueNURBSDofs();
165 void ApplyLDofSigns(Array<int> &dofs)
const;
166 void ApplyLDofSigns(Table &el_dof)
const;
168 typedef NCMesh::MeshId MeshId;
171 void GetGhostVertexDofs(
const MeshId &
id, Array<int> &dofs)
const;
172 void GetGhostEdgeDofs(
const MeshId &edge_id, Array<int> &dofs,
174 void GetGhostFaceDofs(
const MeshId &face_id, Array<int> &dofs)
const;
175 void GetGhostDofs(
int entity,
const MeshId &
id, Array<int> &dofs,
179 void GetBareDofs(
int entity,
int index, Array<int> &dofs)
const;
180 void GetBareDofsVar(
int entity,
int index, Array<int> &dofs)
const;
185 int PackDof(
int entity,
int index,
int edof,
int var = 0)
const;
187 void UnpackDof(
int dof,
int &entity,
int &
index,
int &edof,
int &order)
const;
190 int PackDofVar(
int entity,
int index,
int edof,
int var = 0)
const;
192 void UnpackDofVar(
int dof,
int &entity,
int &
index,
int &edof,
195#ifdef MFEM_PMATRIX_STATS
196 mutable int n_msgs_sent, n_msgs_recv;
197 mutable int n_rows_sent, n_rows_recv, n_rows_fwd;
200 void ScheduleSendOrder(
int ent,
int idx,
int order,
202 std::map<int, class NeighborOrderMessage> &send_msg)
const;
204 void ScheduleSendRow(
const struct PMatrixRow &row,
int dof, GroupId group_id,
205 std::map<int, class NeighborRowMessage> &send_msg)
const;
207 void ForwardRow(
const struct PMatrixRow &row,
int dof,
208 GroupId group_sent_id, GroupId group_id,
209 std::map<int, class NeighborRowMessage> &send_msg)
const;
211#ifdef MFEM_DEBUG_PMATRIX
212 void DebugDumpDOFs(std::ostream &os,
213 const SparseMatrix &deps,
214 const Array<GroupId> &dof_group,
215 const Array<GroupId> &dof_owner,
216 const Array<bool> &finalized)
const;
221 MakeVDimHypreMatrix(
const std::vector<struct PMatrixRow> &rows,
222 int local_rows,
int local_cols,
223 Array<HYPRE_BigInt> &row_starts,
224 Array<HYPRE_BigInt> &col_starts)
const;
227 void Build_Dof_TrueDof_Matrix()
const;
233 int BuildParallelConformingInterpolation(HypreParMatrix **P, SparseMatrix **R,
234 Array<HYPRE_BigInt> &dof_offs,
235 Array<HYPRE_BigInt> &tdof_offs,
236 Array<int> *dof_tdof,
237 bool partial =
false);
242 HypreParMatrix* RebalanceMatrix(
int old_ndofs,
243 const Table* old_elem_dof,
244 const Table* old_elem_fos);
250 HypreParMatrix* ParallelDerefinementMatrix(
int old_ndofs,
251 const Table *old_elem_dof,
252 const Table *old_elem_fos);
257 void UpdateMeshPointer(Mesh *new_mesh)
override;
265 const Array<int> *perm)
override;
321 const int *partitioning,
392 {
if (!P) { Build_Dof_TrueDof_Matrix(); }
return P; }
426 int component = -1)
const override;
432 int component = -1)
const override;
440 int component)
const;
444 int component = -1)
const override;
449 int component = -1)
const override;
506 void Update(
bool want_transform =
true)
override;
511 bool want_transfer =
true)
override;
517 old_dof_offsets.DeleteAll();
551 const std::set<int> &faces,
Base class for operators that extracts Face degrees of freedom.
Collection of finite elements from the same family in multiple dimensions. This class is used to matc...
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
DofTransformation * GetElementDofs(int elem, Array< int > &dofs) const
Returns indices of degrees of freedom of element 'elem'. The returned indices are offsets into an ldo...
NURBSExtension * NURBSext
FiniteElementSpace()
Default constructor: the object is invalid until initialized using the method Load().
const FiniteElementCollection * fec
Associated FE collection (not owned).
int VDofToDof(int vdof) const
Compute the inverse of the Dof to VDof mapping for a single index vdof.
virtual void UpdatesFinished()
Free the GridFunction update operator (if any), to save memory.
int ndofs
Number of degrees of freedom. Number of unknowns is ndofs * vdim.
DofTransformation * GetBdrElementDofs(int bel, Array< int > &dofs) const
Returns indices of degrees of freedom for boundary element 'bel'. The returned indices are offsets in...
Abstract class for all finite elements.
Communicator performing operations within groups defined by a GroupTopology with arbitrary-size data ...
Wrapper for hypre's ParCSR matrix class.
HYPRE_BigInt GetGlobalNumRows() const
Return the global number of rows.
HYPRE_BigInt GetGlobalNumCols() const
Return the global number of columns.
Wrapper for hypre's parallel vector class.
Class used by MFEM to store pointers to host and/or device memory.
NURBSExtension generally contains multiple NURBSPatch objects spanning an entire Mesh....
Pointer to an Operator of a specified type.
Abstract parallel finite element space.
void GetTrueTransferOperator(const FiniteElementSpace &coarse_fes, OperatorHandle &T) const override
Construct and return an Operator that can be used to transfer true-dof data from coarse_fes,...
HYPRE_BigInt GetGlobalScalarTDofNumber(int sldof)
const GroupCommunicator & GroupComm() const
Return a const reference to the internal GroupCommunicator (on VDofs)
void GetSharedTriangleDofs(int group, int fi, Array< int > &dofs) const
void GetSharedEdgeDofs(int group, int ei, Array< int > &dofs) const
int NumGhostEdges() const override
Returns the number of ghost edges.
int GetMaxElementOrder() const override
Returns the maximum polynomial order over all elements globally.
const FaceRestriction * GetFaceRestriction(ElementDofOrdering f_ordering, FaceType type, L2FaceValues mul=L2FaceValues::DoubleValued) const override
HYPRE_BigInt * GetTrueDofOffsets() const
void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1) const override
void PrintPartitionStats()
void GetExteriorTrueDofs(Array< int > &ext_tdof_list, int component=-1) const override
void GetExteriorVDofs(Array< int > &ext_dofs, int component=-1) const override
Determine the external degrees of freedom.
HYPRE_BigInt GlobalVSize() const
const Operator * GetRestrictionOperator() const override
int GetLocalTDofNumber(int ldof) const
void UpdatesFinished() override
Free ParGridFunction transformation matrix (if any), to save memory.
friend struct ParDerefineMatrixOp
void Synchronize(Array< int > &ldof_marker) const
Given an integer array on the local degrees of freedom, perform a bitwise OR between the shared dofs.
void ApplyGhostElementOrdersToEdgesAndFaces(Array< VarOrderBits > &edge_orders, Array< VarOrderBits > &face_orders) const override
void LoseTrueDofOffsets()
bool SharedNDTriangleDofs() const
ParFiniteElementSpace(const ParFiniteElementSpace &orig, ParMesh *pmesh=NULL, const FiniteElementCollection *fec=NULL)
Copy constructor: deep copy all data from orig except the ParMesh, the FiniteElementCollection,...
void DivideByGroupSize(real_t *vec)
Scale a vector of true dofs.
void ExchangeFaceNbrData()
HYPRE_BigInt GlobalTrueVSize() const
HypreParVector * NewTrueDofVector()
int GetTrueVSize() const override
Return the number of local vector true dofs.
const FiniteElement * GetFaceNbrFE(int i, int ndofs=0) const
void GhostFaceOrderToEdges(const Array< VarOrderBits > &face_orders, Array< VarOrderBits > &edge_orders) const override
HYPRE_BigInt GetMyDofOffset() const
HYPRE_BigInt * GetDofOffsets() const
Array< HYPRE_BigInt > face_nbr_glob_dof_map
GroupCommunicator & GroupComm()
Return a reference to the internal GroupCommunicator (on VDofs)
bool Nonconforming() const
void GetEssentialTrueDofsVar(const Array< int > &bdr_attr_is_ess, const Array< int > &ess_dofs, Array< int > &true_ess_dofs, int component) const
void GetFaceNbrFaceVDofs(int i, Array< int > &vdofs) const
const Operator * GetProlongationMatrix() const override
GroupCommunicator * ScalarGroupComm()
Return a new GroupCommunicator on scalar dofs, i.e. for VDim = 1.
bool OrderPropagation(const std::set< int > &edges, const std::set< int > &faces, Array< VarOrderBits > &edge_orders, Array< VarOrderBits > &face_orders) const override
void GetEssentialVDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_dofs, int component=-1) const override
Determine the boundary degrees of freedom.
HypreParMatrix * Dof_TrueDof_Matrix() const
The true dof-to-dof interpolation matrix.
void GetFaceNbrElementVDofs(int i, Array< int > &vdofs, DofTransformation &doftrans) const
const HYPRE_BigInt * GetFaceNbrGlobalDofMap()
int GetFaceDofs(int i, Array< int > &dofs, int variant=0) const override
int GetFaceNbrVSize() const
int NumGhostFaces() const override
Returns the number of ghost faces.
Table face_nbr_element_fos
HYPRE_BigInt GetMyTDofOffset() const
void GetSharedQuadrilateralDofs(int group, int fi, Array< int > &dofs) const
void GetElementDofs(int i, Array< int > &dofs, DofTransformation &doftrans) const override
The same as GetElementDofs(), but with a user-provided DofTransformation object.
void PRefineAndUpdate(const Array< pRefinement > &refs, bool want_transfer=true) override
const SparseMatrix * GetRestrictionMatrix() const override
Get the R matrix which restricts a local dof vector to true dof vector.
HYPRE_BigInt GetGlobalTDofNumber(int ldof) const
Returns the global tdof number of the given local degree of freedom.
const Array< HYPRE_BigInt > & GetFaceNbrGlobalDofMapArray()
virtual ~ParFiniteElementSpace()
ParMesh * GetParMesh() const
void Update(bool want_transform=true) override
HypreParMatrix * GetPartialConformingInterpolation()
For a non-conforming mesh, construct and return the interpolation matrix from the partially conformin...
int TrueVSize() const
Obsolete, kept for backward compatibility.
void MarkIntermediateEntityDofs(int entity, Array< bool > &intermediate) const
void Lose_Dof_TrueDof_Matrix()
const FiniteElement * GetFaceNbrFaceFE(int i) const
const FiniteElement * GetFE(int i) const override
Table face_nbr_element_dof
ElementTransformation * GetFaceNbrElementTransformation(int i) const
void GetBdrElementDofs(int i, Array< int > &dofs, DofTransformation &doftrans) const override
The same as GetBdrElementDofs(), but with a user-provided DofTransformation object.
Class for parallel meshes.
ElementTransformation * GetFaceNbrElementTransformation(int FaceNo)
Returns a pointer to the transformation defining the i-th face neighbor.
A parallel extension of the NCMesh class.
int GetNGhostEdges() const
int GetNGhostFaces() const
Table stores the connectivity of elements of TYPE I to elements of TYPE II. For example,...
int index(int i, int j, int nx, int ny)
ElementDofOrdering
Constants describing the possible orderings of the DOFs in one element.
std::function< real_t(const Vector &)> f(real_t mass_coeff)