59 ASSERTL0(comm.get(),
"Communication not initialised.");
64 const bool isRoot = comm->TreatAsRankZero();
70 session->InitSession();
73 geomType = session->GetGeometryType();
76 std::vector<char> v(geomType.c_str(),
77 geomType.c_str() + geomType.length());
79 size_t length = v.size();
80 comm->Bcast(length, 0);
86 comm->Bcast(length, 0);
88 std::vector<char> v(length);
91 geomType = std::string(v.begin(), v.end());
101 meshIO->m_meshGraph->SetSession(session);
108 if (partitionedGraph && geomType ==
"HDF5")
110 meshIO->m_meshGraph->SetPartition(partitionedGraph);
111 meshIO->m_meshPartitioned =
true;
114 meshIO->PartitionMesh(session);
117 meshIO->ReadGeometry(rng, fillGraph);
119 return meshIO->m_meshGraph;
131 std::map<int, MeshEntity> elements;
140 e.
list.push_back(i.second->GetVertex(0)->GetGlobalID());
141 e.
list.push_back(i.second->GetVertex(1)->GetGlobalID());
153 e.
list.push_back(i.second->GetEdge(0)->GetGlobalID());
154 e.
list.push_back(i.second->GetEdge(1)->GetGlobalID());
155 e.
list.push_back(i.second->GetEdge(2)->GetGlobalID());
163 e.
list.push_back(i.second->GetEdge(0)->GetGlobalID());
164 e.
list.push_back(i.second->GetEdge(1)->GetGlobalID());
165 e.
list.push_back(i.second->GetEdge(2)->GetGlobalID());
166 e.
list.push_back(i.second->GetEdge(3)->GetGlobalID());
178 e.
list.push_back(i.second->GetFace(0)->GetGlobalID());
179 e.
list.push_back(i.second->GetFace(1)->GetGlobalID());
180 e.
list.push_back(i.second->GetFace(2)->GetGlobalID());
181 e.
list.push_back(i.second->GetFace(3)->GetGlobalID());
189 e.
list.push_back(i.second->GetFace(0)->GetGlobalID());
190 e.
list.push_back(i.second->GetFace(1)->GetGlobalID());
191 e.
list.push_back(i.second->GetFace(2)->GetGlobalID());
192 e.
list.push_back(i.second->GetFace(3)->GetGlobalID());
193 e.
list.push_back(i.second->GetFace(4)->GetGlobalID());
201 e.
list.push_back(i.second->GetFace(0)->GetGlobalID());
202 e.
list.push_back(i.second->GetFace(1)->GetGlobalID());
203 e.
list.push_back(i.second->GetFace(2)->GetGlobalID());
204 e.
list.push_back(i.second->GetFace(3)->GetGlobalID());
205 e.
list.push_back(i.second->GetFace(4)->GetGlobalID());
213 e.
list.push_back(i.second->GetFace(0)->GetGlobalID());
214 e.
list.push_back(i.second->GetFace(1)->GetGlobalID());
215 e.
list.push_back(i.second->GetFace(2)->GetGlobalID());
216 e.
list.push_back(i.second->GetFace(3)->GetGlobalID());
217 e.
list.push_back(i.second->GetFace(4)->GetGlobalID());
218 e.
list.push_back(i.second->GetFace(5)->GetGlobalID());
231 auto meshComposites = &
m_meshGraph->GetComposites();
234 for (
auto &comp : *meshComposites)
236 std::pair<LibUtilities::ShapeType, vector<int>> tmp;
237 tmp.first = comp.second->m_geomVec[0]->GetShapeType();
239 tmp.second.resize(comp.second->m_geomVec.size());
240 for (
size_t i = 0; i < tmp.second.size(); ++i)
242 tmp.second[i] = comp.second->m_geomVec[i]->GetGlobalID();
245 ret[comp.first] = tmp;
256 if (comp->m_geomVec.size() == 0)
263 map<LibUtilities::ShapeType, pair<string, string>> compMap;
276 int shapeDim = firstGeom->GetShapeDim();
277 string tag = (shapeDim <
m_meshGraph->GetMeshDimension())
278 ? compMap[firstGeom->GetShapeType()].second
279 : compMap[firstGeom->GetShapeType()].first;
281 std::vector<unsigned int> idxList;
282 std::transform(comp->m_geomVec.begin(), comp->m_geomVec.end(),
283 std::back_inserter(idxList),
#define ASSERTL0(condition, msg)
Provides a generic Factory class.
tBaseSharedPtr CreateInstance(tKey idKey, tParam... args)
Create an instance of the class referred to by idKey.
static std::shared_ptr< DataType > AllocateSharedPtr(const Args &...args)
Allocate a shared pointer from the memory pool.
static std::string GenerateSeqString(const std::vector< T > &v)
Generate a compressed comma-separated string representation of a vector of unsigned integers.
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< SessionReader > SessionReaderSharedPtr
std::shared_ptr< DomainRange > DomainRangeShPtr
std::shared_ptr< Comm > CommSharedPtr
Pointer to a Communicator object.
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::shared_ptr< Geometry > GeometrySharedPtr
std::vector< unsigned int > list