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);
344 int GetInt(
int pos)
const;
380 template<
class ValueType,
bool RefTypes,
int Tag>
413 typedef std::map<int, NeighborRefinementMessage>
Map;
422 typedef std::map<int, NeighborDerefinementMessage>
Map;
432 typedef std::map<int, NeighborElementRankMessage>
Map;
443 typedef std::map<int, RebalanceMessage>
Map;
458 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< Element * > ghost_layer
list of elements whose 'element_type' == 2.
void AddElementRank(Element *elem, int rank)
Array< char > element_type
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
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
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)
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
void AddRefinement(Element *elem, char ref_type)
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
RebalanceDofMessage::Map send_rebalance_dofs
const FiniteElementCollection * fec
bool PruneTree(Element *elem)
Internal. Recursive part of Prune().
std::vector< Element * > elements
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 FlagElements(const Array< Element * > &elements, char flag)
Array< int > old_index_or_rank
RebalanceDofMessage::Map recv_rebalance_dofs
int InitialPartition(int index) const
Helper to get the partition when the serial mesh is being split initially.
bool HaveRow(int row) const
void EncodeTree(Element *elem)
Array< Element * > boundary_layer
list of type 3 elements
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...
void SetElements(const Array< Element * > &elems, NCMesh *ncmesh)
virtual void GetBoundaryClosure(const Array< int > &bdr_attr_is_ess, Array< int > &bdr_vertices, Array< int > &bdr_edges)
void RemoveRequest(int row)
std::map< int, RebalanceDofMessage > Map
std::map< int, NeighborDerefinementMessage > Map
const Array< int > & GetRebalanceOldIndex() const
void AddDerefinement(Element *elem, int rank)
virtual void BuildEdgeList()
static bool compare_ranks(const Element *a, const Element *b)
void GetDebugMesh(Mesh &debug_mesh) const
int ElementRank(int index) const
void GetDofs(int type, const NCMesh::MeshId &id, Array< int > &dofs, int &ndofs)
std::map< int, Row > rows
Array< Element * > leaf_elements
void SetNCMesh(NCMesh *ncmesh)
std::map< NCMesh::MeshId, std::vector< int > > IdToDofs
void ElementNeighborProcessors(Element *elem, Array< int > &ranks)
virtual void ElementSharesFace(Element *elem, Face *face)
virtual void ElementSharesEdge(Element *elem, Edge *edge)
void Decode(Array< Element * > &elements) const
bool CheckElementType(Element *elem, int type)
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().
void GetRow(int row, Array< int > &cols, Vector &srow)
Array< Connection > index_rank
int GetFaceOrientation(int index) const
Return (shared) face orientation relative to the owner element.
virtual void CheckDerefinementNCLevel(const Table &deref_table, Array< int > &level_ok, int max_nc_level)
std::map< int, NeighborDofMessage > Map
void AddElementRank(Element *elem, int rank)
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)
void Encode(const Array< Element * > &elements)
bool IsGhost(int type, int index) const
Returns true if the specified vertex/edge/face is a ghost.
const NCList & GetSharedFaces()
std::map< int, RebalanceMessage > Map
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)
void Add(Element *elem, ValueType val)
static int get_face_orientation(Face *face, Element *e1, Element *e2, int local[2]=NULL)
virtual void UpdateVertices()
update Vertex::index and vertex_nodeId
Class for parallel meshes.
Abstract data type element.
Variable-length MPI message containing unspecific binary data.
int rank
processor number (ParNCMesh)
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)