15 #include "../config/config.hpp"
23 #include "../general/communication.hpp"
24 #include "../general/sort_pairs.hpp"
134 const int*
GetGroup(
int type,
int index,
int &size)
const
144 return table->
GetRow(index);
152 const int* group =
GetGroup(type, index, size);
153 for (
int i = 0; i < size; i++)
155 if (group[i] == rank) {
return true; }
166 case 1:
return index >=
NEdges;
167 default:
return index >=
NFaces;
229 {
return elem->rank !=
MyRank; }
250 void MakeShared(
const Table &groups,
const NCList &list, NCList &shared);
260 ElementSet(
const std::set<Element*> &elements,
262 void Dump(std::ostream &os)
const;
266 void Load(std::istream &is);
276 void SetInt(
int pos,
int value);
277 int GetInt(
int pos)
const;
285 bool decode_indices)
const;
317 { refinements.push_back(ElemRefType(elem, ref_type)); }
322 typedef std::map<int, NeighborRefinementMessage>
Map;
360 typedef std::map<int, NeighborDofMessage>
Map;
363 typedef std::map<NCMesh::MeshId, std::vector<int> >
IdToDofs;
388 typedef std::map<int, NeighborRowRequest>
Map;
409 typedef std::map<int, NeighborRowReply>
Map;
428 #endif // MFEM_USE_MPI
430 #endif // MFEM_PNCMESH
NCList face_list
lazy-initialized list of faces, see GetFaceList
NCList edge_list
lazy-initialized list of edges, see GetEdgeList
Array< Element * > ghost_layer
list of elements whose 'element_type' == 2.
Array< char > element_type
void EncodeMeshIds(std::ostream &os, Array< MeshId > ids[], int dim) const
Write to 'os' a processor-independent encoding of vertex/edge/face IDs.
void CalcFaceOrientations()
bool EncodeTree(Element *elem, const std::set< Element * > &elements)
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
void AddRefinement(Element *elem, int ref_type)
virtual int GetNumGhosts() const
virtual void BuildFaceList()
void Dump(std::ostream &os) const
const NCList & GetSharedVertices()
void BuildSharedVertices()
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 DecodeTree(Element *elem, int &pos, Array< Element * > &elements) const
int GetInt(int pos) const
virtual void OnMeshUpdated(Mesh *mesh)
bool operator<(const NCMesh::MeshId &a, const NCMesh::MeshId &b)
std::map< int, NeighborRowRequest > Map
int GetOwner(int type, int index) const
Return vertex/edge/face ('type' == 0/1/2, resp.) owner.
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
virtual bool IsGhost(const Element *elem) const
A parallel extension of the NCMesh class.
ParNCMesh(MPI_Comm comm, const NCMesh &ncmesh)
Array< int > vertex_owner
const FiniteElementCollection * fec
void DecodeMeshIds(std::istream &is, Array< MeshId > ids[], int dim, bool decode_indices) const
Read from 'is' a processor-independent encoding of vertex/edge/face IDs.
bool PruneTree(Element *elem)
Internal. Recursive part of Prune().
int InitialPartition(int index) const
Assigns elements to processors at the initial stage (ParMesh creation).
bool HaveRow(int row) const
Identifies a vertex/edge/face in both Mesh and NCMesh.
std::map< int, NeighborRefinementMessage > Map
void SetInt(int pos, int value)
A class for non-conforming AMR on higher-order hexahedral, quadrilateral or triangular meshes...
ElementSet(std::istream &is)
virtual void GetBoundaryClosure(const Array< int > &bdr_attr_is_ess, Array< int > &bdr_vertices, Array< int > &bdr_edges)
void RemoveRequest(int row)
virtual void BuildEdgeList()
void GetDebugMesh(Mesh &debug_mesh) const
void GetDofs(int type, const NCMesh::MeshId &id, Array< int > &dofs, int &ndofs)
std::map< int, Row > rows
Array< Element * > leaf_elements
std::map< NCMesh::MeshId, std::vector< int > > IdToDofs
void Decode(Array< Element * > &elements, const Array< Element * > &ncmesh_roots) const
void ElementNeighborProcessors(Element *elem, Array< int > &ranks)
virtual void ElementSharesFace(Element *elem, Face *face)
virtual void ElementSharesEdge(Element *elem, Edge *edge)
void Init(ParNCMesh *pncmesh, const FiniteElementCollection *fec, int ndofs)
virtual void Refine(const Array< Refinement > &refinements)
void GetRow(int row, Array< int > &cols, Vector &srow)
std::vector< ElemRefType > refinements
Array< Connection > index_rank
void SetNCMesh(ParNCMesh *pncmesh)
Set pointer to ParNCMesh (needed to encode the message).
int GetFaceOrientation(int index) const
Return (shared) face orientation relative to the owner element.
std::map< int, NeighborDofMessage > Map
const NCList & GetSharedList(int type)
Helper to get shared vertices/edges/faces ('type' == 0/1/2 resp.).
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()
std::map< int, NeighborRowReply > Map
void ReorderEdgeDofs(const NCMesh::MeshId &id, std::vector< int > &dofs)
Array< Element * > tmp_neighbors
const int * GetGroup(int type, int index, int &size) const
void NeighborProcessors(Array< int > &neighbors)
virtual void UpdateVertices()
update Vertex::index and vertex_nodeId
Class for parallel meshes.
Abstract data type element.
virtual void LimitNCLevel(int max_level)
To be implemented.
Variable-length MPI message containing unspecific binary data.
Array< unsigned char > data
encoded refinement (sub-)trees