15 #include "../config/config.hpp"
23 #include "../general/communication.hpp"
29 class FiniteElementCollection;
30 class FiniteElementSpace;
150 const int*
GetGroup(
int type,
int index,
int &size)
const
160 return table->
GetRow(index);
168 const int* group =
GetGroup(type, index, size);
169 for (
int i = 0; i < size; i++)
171 if (group[i] == rank) {
return true; }
182 case 1:
return index >=
NEdges;
183 default:
return index >=
NFaces;
219 template<
typename Type>
221 const Table &deref_table);
275 {
return index *
NRanks / total_elements; }
304 int local[2] = NULL );
328 void Dump(std::ostream &os)
const;
330 void Load(std::istream &is);
345 int GetInt(
int pos)
const;
381 template<
class ValueType,
bool RefTypes,
int Tag>
392 void Add(
int elem, ValueType val)
414 typedef std::map<int, NeighborRefinementMessage>
Map;
423 typedef std::map<int, NeighborDerefinementMessage>
Map;
433 typedef std::map<int, NeighborElementRankMessage>
Map;
444 typedef std::map<int, RebalanceMessage>
Map;
459 typedef std::map<int, RebalanceDofMessage>
Map;
516 typedef std::map<int, NeighborDofMessage>
Map;
519 typedef std::map<NCMesh::MeshId, std::vector<int> >
IdToDofs;
544 typedef std::map<int, NeighborRowRequest>
Map;
565 typedef std::map<int, NeighborRowReply>
Map;
584 #endif // MFEM_USE_MPI
586 #endif // MFEM_PNCMESH
NCList face_list
lazy-initialized list of faces, see GetFaceList
NCList edge_list
lazy-initialized list of edges, see GetEdgeList
void SetNCMesh(NCMesh *ncmesh)
int Partition(long index, long total_elements) const
Return the processor number for a global element number.
ElementSet(NCMesh *ncmesh=NULL, bool include_ref_types=false)
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 DecodeMeshIds(std::istream &is, Array< MeshId > ids[])
Read from 'is' a processor-independent encoding of vertex/edge/face IDs.
Array< char > element_type
int Size() const
Logical size of the array.
std::vector< ValueType > values
long PartitionFirstIndex(int rank, long total_elements) const
Return the global index of the first element owned by processor 'rank'.
void CalcFaceOrientations()
void AddDofs(int type, const NCMesh::MeshId &id, const Array< int > &dofs)
Add vertex/edge/face DOFs to an outgoing message.
Array< char > face_orient
virtual int GetNumGhosts() const
std::vector< int > elem_ids
virtual void BuildFaceList()
void Dump(std::ostream &os) const
const NCList & GetSharedVertices()
Lists all edges/faces in the nonconforming mesh.
void SetNCMesh(ParNCMesh *pncmesh)
Set pointer to ParNCMesh (needed to encode the message).
std::map< int, NeighborElementRankMessage > Map
const NCMesh * GetNCMesh() const
void BuildSharedVertices()
std::vector< int > elements
void Load(std::istream &is)
void GetRow(int i, Array< int > &row) const
Return row i in array row (the Table must be finalized)
void Add(int elem, ValueType val)
void SynchronizeDerefinementData(Array< Type > &elem_data, const Table &deref_table)
int GetInt(int pos) const
virtual void OnMeshUpdated(Mesh *mesh)
virtual void Derefine(const Array< int > &derefs)
void SetElements(const Array< int > &elems, NCMesh *ncmesh)
bool operator<(const Pair< A, B > &p, const Pair< A, B > &q)
Comparison operator for class Pair, based on the first element only.
std::map< int, NeighborRowRequest > Map
int GetOwner(int type, int index) const
Return vertex/edge/face ('type' == 0/1/2, resp.) owner.
void EncodeTree(int elem)
virtual void AssignLeafIndices()
const NCList & GetSharedEdges()
void MakeShared(const Table &groups, const NCList &list, NCList &shared)
bool RankInGroup(int type, int index, int rank) const
A parallel extension of the NCMesh class.
ParNCMesh(MPI_Comm comm, const NCMesh &ncmesh)
Array< int > vertex_owner
RebalanceDofMessage::Map send_rebalance_dofs
void FlagElements(const Array< int > &elements, char flag)
const FiniteElementCollection * fec
void Decode(Array< int > &elements) const
void AddElementRank(int elem, int rank)
virtual bool IsGhost(const Element &el) const
Array< DenseMatrix * > aux_pm_store
Stores modified point matrices created by GetFaceNeighbors.
void RedistributeElements(Array< int > &new_ranks, int target_elements, bool record_comm)
void ElementNeighborProcessors(int elem, Array< int > &ranks)
Array< int > old_index_or_rank
RebalanceDofMessage::Map recv_rebalance_dofs
int InitialPartition(int index) const
Helper to get the partitioning when the serial mesh gets split initially.
bool HaveRow(int row) const
void AddRefinement(int elem, char ref_type)
Identifies a vertex/edge/face in both Mesh and NCMesh.
std::map< int, NeighborRefinementMessage > Map
A class for non-conforming AMR on higher-order hexahedral, quadrilateral or triangular meshes...
virtual void GetBoundaryClosure(const Array< int > &bdr_attr_is_ess, Array< int > &bdr_vertices, Array< int > &bdr_edges)
void RemoveRequest(int row)
virtual void ElementSharesEdge(int elem, int enode)
Array< int > tmp_neighbors
std::map< int, RebalanceDofMessage > Map
std::map< int, NeighborDerefinementMessage > Map
const Array< int > & GetRebalanceOldIndex() const
virtual void BuildEdgeList()
void Encode(const Array< int > &elements)
void GetDebugMesh(Mesh &debug_mesh) const
int ElementRank(int index) const
bool PruneTree(int elem)
Internal. Recursive part of Prune().
void GetDofs(int type, const NCMesh::MeshId &id, Array< int > &dofs, int &ndofs)
std::map< int, Row > rows
void SetNCMesh(NCMesh *ncmesh)
std::map< NCMesh::MeshId, std::vector< int > > IdToDofs
void Init(ParNCMesh *pncmesh, const FiniteElementCollection *fec, int ndofs)
virtual void Refine(const Array< Refinement > &refinements)
static bool compare_ranks_indices(const Element *a, const Element *b)
void RecvRebalanceDofs(Array< int > &elements, Array< long > &dofs)
Receive element DOFs sent by SendRebalanceDofs().
Array< int > leaf_elements
void GetRow(int row, Array< int > &cols, Vector &srow)
Array< int > boundary_layer
list of type 3 elements
void AddElementRank(int elem, int rank)
Array< Connection > index_rank
void DecodeTree(int elem, int &pos, Array< int > &elements) const
int GetFaceOrientation(int index) const
Return (shared) face orientation relative to the owner element.
BlockArray< Element > elements
virtual void CheckDerefinementNCLevel(const Table &deref_table, Array< int > &level_ok, int max_nc_level)
std::map< int, NeighborDofMessage > Map
Array< int > ghost_layer
list of elements whose 'element_type' == 2.
const NCList & GetSharedList(int type)
Helper to get shared vertices/edges/faces ('type' == 0/1/2 resp.).
void EncodeMeshIds(std::ostream &os, Array< MeshId > ids[])
Write to 'os' a processor-independent encoding of vertex/edge/face IDs.
void AddRow(int row, const Array< int > &cols, const Vector &srow)
void AddMasterSlaveRanks(int nitems, const NCList &list)
bool IsGhost(int type, int index) const
Returns true if the specified vertex/edge/face is a ghost.
const NCList & GetSharedFaces()
void AddDerefinement(int elem, int rank)
std::map< int, RebalanceMessage > Map
static int get_face_orientation(Face &face, Element &e1, Element &e2, int local[2]=NULL)
std::map< int, NeighborRowReply > Map
void ReorderEdgeDofs(const NCMesh::MeshId &id, std::vector< int > &dofs)
const int * GetGroup(int type, int index, int &size) const
void NeighborProcessors(Array< int > &neighbors)
bool CheckElementType(int elem, int type)
virtual void UpdateVertices()
update Vertex::index and vertex_nodeId
Class for parallel meshes.
Abstract data type element.
virtual void ElementSharesFace(int elem, int face)
Variable-length MPI message containing unspecific binary data.
int rank
processor number (ParNCMesh), -1 if undefined/unknown
virtual void LimitNCLevel(int max_nc_level)
Parallel version of NCMesh::LimitNCLevel.
Array< unsigned char > data
encoded refinement (sub-)trees
const Array< int > & GetDerefineOldRanks() const
void GetFaceNeighbors(ParMesh &pmesh)