29 #ifndef NEMOSYS_EXOGEOMESH_H_ 30 #define NEMOSYS_EXOGEOMESH_H_ 32 #include "nemosys_export.h" 41 #include <vtkExodusIIReader.h> 58 vtkSmartPointer<vtkPolyData>
getSS() {
return getGeoMesh().sideSet.sides; }
71 static exoGeoMesh *
Read(
const std::string &fileName,
int timeStep = 1);
81 explicit exoGeoMesh(
const std::string &fileName,
int timeStep = 1);
94 explicit exoGeoMesh(
const vtkSmartPointer<vtkExodusIIReader> &reader);
105 void write(
const std::string &fileName)
override;
110 void report(std::ostream &out)
const override;
117 void reconstructGeo()
override;
118 void takeGeoMesh(
geoMeshBase *otherGeoMesh)
override;
124 const std::string &getTitle()
const;
129 void setTitle(
const std::string &title);
134 int getNumElemBlocks()
const;
139 std::map<int, std::string> getElemBlockNames()
const;
145 const std::string &getElemBlockName(
int id)
const;
151 void setElemBlockName(
int id,
const std::string &name);
156 std::vector<int> getElemBlockIds()
const;
162 int getElemBlockId(vtkIdType cellIdx)
const;
168 std::vector<vtkIdType> getElemBlock(
int blockId)
const;
178 int addElemBlock(vtkUnstructuredGrid *elements,
const std::string &name =
"",
188 void addCellsToBlock(vtkUnstructuredGrid *elements,
int blockId,
202 int reassignCells(
const std::vector<vtkIdType> &cells,
int blockId = -1,
203 const std::string &elemBlockName = {});
210 bool addElemBlockProperty(
const std::string &propName);
215 std::vector<std::string> getElemBlockPropertyNames()
const;
222 int getElemBlockProperty(
const std::string &propName,
int blockId)
const;
229 void setElemBlockProperty(
const std::string &propName,
int blockId,
235 int getNumSideSets()
const;
240 const std::map<int, std::string> &getSideSetNames()
const;
246 const std::string &getSideSetName(
int id)
const;
252 void setSideSetName(
int id,
const std::string &name);
257 std::vector<int> getSideSetIds()
const;
265 std::pair<std::vector<vtkIdType>, std::vector<int>> getSideSet(
266 int sideSetId)
const;
275 int addSideSet(
const std::vector<vtkIdType> &elements,
276 const std::vector<int> &
sides,
const std::string &name =
"");
281 int getNumNodeSets()
const;
286 std::map<int, std::string> getNodeSetNames()
const;
292 const std::string &getNodeSetName(
int id)
const;
298 void setNodeSetName(
int id,
const std::string &name);
303 std::vector<int> getNodeSetIds()
const;
309 const std::vector<vtkIdType> &getNodeSet(
int nodeSetId)
const;
317 int addNodeSet(
const std::vector<vtkIdType> &
nodes,
318 const std::string &name =
"");
326 const std::string &getPhysGrpPropertyName()
const;
335 void setPhysGrpPropertyName(
const std::string &physGrpName);
344 void stitch(
const exoGeoMesh &otherGM,
float tol = 1e-15f);
349 void scaleNodes(
double scale);
352 static vtkSmartPointer<vtkExodusIIReader> getExoReader(
353 const std::string &fileName,
int timeStep = 1);
354 static GeoMesh exoReader2GM(vtkSmartPointer<vtkExodusIIReader> reader);
355 static const char *getExoIdArrName();
360 void resetElemBlocks();
366 void resetNodeSetPoints(vtkIdTypeArray *nodeMap =
nullptr);
371 void setSideSetObjId();
373 void resetNative()
override;
398 #endif // NEMOSYS_EXOGEOMESH_H_
std::set< std::string > _elemBlockPropNames
std::vector< std::pair< vtkIdType, std::vector< double > > > nodes
Each entry stores (node ID in .inp file, coordinates)
geoMeshBase * Read(const std::string &fileName)
Read a mesh from file.
std::map< int, std::string > _sideSetNames
geoMeshBase * New(MeshType meshType)
Create a new mesh object.
std::map< int, elemBlock > _elemBlocks
std::map< int, nodeSet > _nodeSets
vtkSmartPointer< vtkPolyData > getSS()
std::array< int, 2 > sides
A concrete implementation of geoMeshBase representing an Exodus II mesh.
std::vector< vtkIdType > nodes
std::map< std::string, int > properties
abstract class to specify geometry and mesh data