29class FiniteElementSpace;
74 ParNCMesh(MPI_Comm comm, std::istream &input,
75 int version,
int &curved,
int &is_nc);
92 Array<int> &level_ok,
int max_nc_level)
override;
148 MFEM_ASSERT(entity >= 0 && entity < 3,
"");
149 MFEM_ASSERT(
index >= 0,
"");
162 MFEM_ASSERT(entity >= 0 && entity < 3,
"");
163 MFEM_ASSERT(
index >= 0,
"");
174 MFEM_ASSERT(
id >= 0,
"");
186 MFEM_ASSERT(entity == 2,
"");
227 template<
typename Type>
229 const Table &deref_table);
239 void Trim()
override;
242 std::size_t
MemoryUsage(
bool with_base =
true)
const;
338 int local[2] = NULL );
361 void Dump(std::ostream &os)
const;
363 void Load(std::istream &is);
378 int GetInt(
int pos)
const;
430 template<
class ValueType,
bool RefTypes,
int Tag>
441 void Add(
int elem, ValueType val)
452 void Encode(
int)
override;
453 void Decode(
int)
override;
463 typedef std::map<int, NeighborRefinementMessage>
Map;
472 typedef std::map<int, NeighborDerefinementMessage>
Map;
482 typedef std::map<int, NeighborElementRankMessage>
Map;
493 typedef std::map<int, RebalanceMessage>
Map;
509 typedef std::map<int, RebalanceDofMessage>
Map;
514 void Encode(
int)
override;
515 void Decode(
int)
override;
543 friend class NeighborRowMessage;
551 return a.index <
b.index;
557 return a.index ==
b.index;
int Size() const
Return the logical size of the array.
Class FiniteElementSpace - responsible for providing FEM view of the mesh, mainly managing the set of...
A class for non-conforming AMR. The class is not used directly by the user, rather it is an extension...
int PrintMemoryDetail() const
BlockArray< Element > elements
Array< int > leaf_elements
finest elements, in Mesh ordering (+ ghosts)
const NCList & GetVertexList()
const NCList & GetFaceList()
Return the current list of conforming and nonconforming faces.
const NCList & GetEdgeList()
Return the current list of conforming and nonconforming edges.
int MyRank
used in parallel, or when loading a parallel file in serial
long MemoryUsage() const
Return total number of bytes allocated.
Class for parallel meshes.
void DecodeTree(int elem, int &pos, Array< int > &elements) const
Array< unsigned char > data
encoded refinement (sub-)trees
const NCMesh * GetNCMesh() const
void Encode(const Array< int > &elements)
ElementSet(NCMesh *ncmesh=NULL, bool include_ref_types=false)
int GetInt(int pos) const
void Decode(Array< int > &elements) const
void FlagElements(const Array< int > &elements, char flag)
std::string RefPath() const
void EncodeTree(int elem)
void Load(std::istream &is)
void Dump(std::ostream &os) const
void SetNCMesh(NCMesh *ncmesh_)
void Encode(int) override
std::vector< ValueType > values
void Decode(int) override
std::vector< int > elements
void Add(int elem, ValueType val)
void SetNCMesh(ParNCMesh *pncmesh_)
Set pointer to ParNCMesh (needed to encode the message).
std::map< int, NeighborDerefinementMessage > Map
void AddDerefinement(int elem, int rank)
void AddElementRank(int elem, int rank)
std::map< int, NeighborElementRankMessage > Map
void AddRefinement(int elem, char ref_type)
std::map< int, NeighborRefinementMessage > Map
void Encode(int) override
std::vector< int > elem_ids
void SetElements(const Array< int > &elems, NCMesh *ncmesh)
void Decode(int) override
std::size_t MemoryUsage() const
void SetNCMesh(NCMesh *ncmesh)
std::map< int, RebalanceDofMessage > Map
std::map< int, RebalanceMessage > Map
void AddElementRank(int elem, int rank)
A parallel extension of the NCMesh class.
Array< int > entity_elem_local[3]
void SendRebalanceDofs(int old_ndofs, const Table &old_element_dofs, long old_global_offset, FiniteElementSpace *space)
Use the communication pattern from last Rebalance() to send element DOFs.
void MakeSharedTable(int ngroups, int ent, Array< int > &shared_local, Table &group_shared, Array< char > *entity_geom=NULL, char geom=0)
Array< int > tmp_neighbors
bool IsGhost(int entity, int index) const
Return true if the specified vertex/edge/face is a ghost.
int GetFaceOrientation(int index) const
Return (shared) face orientation relative to its owner element.
Array< Connection > entity_index_rank[3]
std::map< CommGroup, GroupId > GroupMap
GroupId GetEntityGroupId(int entity, int index)
int GetNGhostEdges() const
RebalanceDofMessage::Map send_rebalance_dofs
void CalcFaceOrientations()
const Array< int > & GetDerefineOldRanks() const
void DecodeGroups(std::istream &is, Array< GroupId > &ids)
bool PruneTree(int elem)
Internal. Recursive part of Prune().
bool CheckElementType(int elem, int type)
const CommGroup & GetGroup(GroupId id) const
Return a list of ranks contained in the group of the given ID.
void Trim() override
Save memory by releasing all non-essential and cached data.
void BuildVertexList() override
Array< int > ghost_layer
list of elements whose 'element_type' == 2.
void BuildFaceList() override
void GetFaceNeighbors(class ParMesh &pmesh)
int GetNGhostFaces() const
void LimitNCLevel(int max_nc_level) override
Parallel version of NCMesh::LimitNCLevel.
RebalanceDofMessage::Map recv_rebalance_dofs
void ChangeVertexMeshIdElement(NCMesh::MeshId &id, int elem)
void EncodeGroups(std::ostream &os, const Array< GroupId > &ids)
void Refine(const Array< Refinement > &refinements) override
int ElementRank(int index) const
Array< GroupId > entity_conf_group[3]
Array< int > boundary_layer
list of type 3 elements
int Partition(long index, long total_elements) const
Return the processor number for a global element number.
void AdjustMeshIds(Array< MeshId > ids[], int rank)
std::size_t GroupsMemoryUsage() const
const NCList & GetSharedVertices()
void ChangeEdgeMeshIdElement(NCMesh::MeshId &id, int elem)
void GetConformingSharedStructures(class ParMesh &pmesh)
void Derefine(const Array< int > &derefs) override
void Rebalance(const Array< int > *custom_partition=NULL)
int GetNGhostElements() const override
void ElementNeighborProcessors(int elem, Array< int > &ranks)
void RecvRebalanceDofs(Array< int > &elements, Array< long > &dofs)
Receive element DOFs sent by SendRebalanceDofs().
static int get_face_orientation(const Face &face, const Element &e1, const Element &e2, int local[2]=NULL)
void GetFineToCoarsePartitioning(const Array< int > &derefs, Array< int > &new_ranks) const
void ElementSharesFace(int elem, int local, int face) override
void BuildEdgeList() override
Array< char > tmp_shared_flag
Array< int > old_index_or_rank
std::vector< int > CommGroup
void DecodeMeshIds(std::istream &is, Array< MeshId > ids[])
void GetBoundaryClosure(const Array< int > &bdr_attr_is_ess, Array< int > &bdr_vertices, Array< int > &bdr_edges, Array< int > &bdr_faces) override
void EncodeMeshIds(std::ostream &os, Array< MeshId > ids[])
Array< DenseMatrix * > aux_pm_store
Stores modified point matrices created by GetFaceNeighbors.
void CheckDerefinementNCLevel(const Table &deref_table, Array< int > &level_ok, int max_nc_level) override
void RedistributeElements(Array< int > &new_ranks, int target_elements, bool record_comm)
const NCList & GetSharedList(int entity)
Helper to get shared vertices/edges/faces ('entity' == 0/1/2 resp.).
GroupId GetSingletonGroup(int rank)
void ChangeRemainingMeshIds(Array< MeshId > &ids, int pos, const Array< Pair< int, int > > &find)
Array< char > face_orient
GroupId GetEntityOwnerId(int entity, int index)
Return vertex/edge/face ('entity' == 0/1/2, resp.) owner.
Array< char > element_type
void InitOwners(int num, Array< GroupId > &entity_owner)
int GetNGhostVertices() const
Array< GroupId > entity_owner[3]
void CalculatePMatrixGroups()
void ElementSharesEdge(int elem, int local, int enode) override
const NCList & GetSharedEdges()
void GetDebugMesh(Mesh &debug_mesh) const
std::vector< CommGroup > GroupList
bool GroupContains(GroupId id, int rank) const
Return true if group 'id' contains the given rank.
const NCList & GetSharedFaces()
const Array< int > & GetRebalanceOldIndex() const
Array< GroupId > entity_pmat_group[3]
void MakeSharedList(const NCList &list, NCList &shared)
void AddConnections(int entity, int index, const Array< int > &ranks)
int InitialPartition(int index) const
Helper to get the partitioning when the serial mesh gets split initially.
void NeighborProcessors(Array< int > &neighbors)
void CreateGroups(int nentities, Array< Connection > &index_rank, Array< GroupId > &entity_group)
void SynchronizeDerefinementData(Array< Type > &elem_data, const Table &deref_table)
GroupId GetGroupId(const CommGroup &group)
long PartitionFirstIndex(int rank, long total_elements) const
Return the global index of the first element owned by processor 'rank'.
void ElementSharesVertex(int elem, int local, int vnode) override
int index(int i, int j, int nx, int ny)
bool operator==(const Array< T > &LHS, const Array< T > &RHS)
bool operator<(const Pair< A, B > &p, const Pair< A, B > &q)
Comparison operator for class Pair, based on the first element only.
Identifies a vertex/edge/face in both Mesh and NCMesh.
Lists all edges/faces in the nonconforming mesh.
Variable-length MPI message containing unspecific binary data.