57 ASSERTL0(comm.get(),
"Communication not initialised.");
62 const bool isRoot = comm->TreatAsRankZero();
68 session->InitSession();
71 geomType = session->GetGeometryType();
74 std::vector<char> v(geomType.c_str(),
75 geomType.c_str() + geomType.length());
77 size_t length = v.size();
78 comm->Bcast(length, 0);
84 comm->Bcast(length, 0);
86 std::vector<char> v(length);
89 geomType = std::string(v.begin(), v.end());
99 meshIO->m_meshGraph->SetSession(session);
106 if (partitionedGraph && geomType ==
"HDF5")
108 meshIO->m_meshGraph->SetPartition(partitionedGraph);
109 meshIO->m_meshPartitioned =
true;
113 meshIO->m_meshGraph->SetDomainRange(rng);
115 meshIO->PartitionMesh(session);
118 meshIO->ReadGeometry(fillGraph);
120 return meshIO->m_meshGraph;
132 std::map<int, MeshEntity> elements;
141 e.
list.push_back(geom->GetVertex(0)->GetGlobalID());
142 e.
list.push_back(geom->GetVertex(1)->GetGlobalID());
156 e.
list.push_back(geom->GetEdge(0)->GetGlobalID());
157 e.
list.push_back(geom->GetEdge(1)->GetGlobalID());
158 e.
list.push_back(geom->GetEdge(2)->GetGlobalID());
169 e.
list.push_back(geom->GetEdge(0)->GetGlobalID());
170 e.
list.push_back(geom->GetEdge(1)->GetGlobalID());
171 e.
list.push_back(geom->GetEdge(2)->GetGlobalID());
172 e.
list.push_back(geom->GetEdge(3)->GetGlobalID());
187 e.
list.push_back(geom->GetFace(0)->GetGlobalID());
188 e.
list.push_back(geom->GetFace(1)->GetGlobalID());
189 e.
list.push_back(geom->GetFace(2)->GetGlobalID());
190 e.
list.push_back(geom->GetFace(3)->GetGlobalID());
201 e.
list.push_back(geom->GetFace(0)->GetGlobalID());
202 e.
list.push_back(geom->GetFace(1)->GetGlobalID());
203 e.
list.push_back(geom->GetFace(2)->GetGlobalID());
204 e.
list.push_back(geom->GetFace(3)->GetGlobalID());
205 e.
list.push_back(geom->GetFace(4)->GetGlobalID());
216 e.
list.push_back(geom->GetFace(0)->GetGlobalID());
217 e.
list.push_back(geom->GetFace(1)->GetGlobalID());
218 e.
list.push_back(geom->GetFace(2)->GetGlobalID());
219 e.
list.push_back(geom->GetFace(3)->GetGlobalID());
220 e.
list.push_back(geom->GetFace(4)->GetGlobalID());
231 e.
list.push_back(geom->GetFace(0)->GetGlobalID());
232 e.
list.push_back(geom->GetFace(1)->GetGlobalID());
233 e.
list.push_back(geom->GetFace(2)->GetGlobalID());
234 e.
list.push_back(geom->GetFace(3)->GetGlobalID());
235 e.
list.push_back(geom->GetFace(4)->GetGlobalID());
236 e.
list.push_back(geom->GetFace(5)->GetGlobalID());
275 if (comp->m_geomVec.size() == 0)
282 std::map<LibUtilities::ShapeType, std::pair<std::string, std::string>>
295 Geometry *firstGeom = comp->m_geomVec[0];
297 std::string tag = (shapeDim <
m_meshGraph->GetMeshDimension())
301 std::vector<unsigned int> idxList;
302 std::transform(comp->m_geomVec.begin(), comp->m_geomVec.end(),
303 std::back_inserter(idxList),
304 [](
Geometry *geom) { return geom->GetGlobalID(); });
Base class for shape geometry information.
LibUtilities::ShapeType GetShapeType(void)
Get the geometric shape type of this object.
int GetShapeDim() const
Get the object's shape dimension.
static MeshGraphSharedPtr Read(const LibUtilities::SessionReaderSharedPtr pSession, LibUtilities::DomainRangeShPtr rng=LibUtilities::NullDomainRangeShPtr, bool fillGraph=true, SpatialDomains::MeshGraphSharedPtr partitionedGraph=nullptr)
std::string GetCompositeString(CompositeSharedPtr comp)
Returns a string representation of a composite.
CompositeDescriptor CreateCompositeDescriptor()
MeshGraphSharedPtr m_meshGraph
std::map< int, MeshEntity > CreateMeshEntities()
Create mesh entities for this graph.
std::shared_ptr< MeshGraphIO > MeshGraphIOSharedPtr
std::map< int, std::pair< LibUtilities::ShapeType, std::vector< int > > > CompositeDescriptor
std::shared_ptr< Composite > CompositeSharedPtr
MeshGraphIOFactory & GetMeshGraphIOFactory()
std::shared_ptr< MeshGraph > MeshGraphSharedPtr
std::vector< unsigned int > list