A concrete implementation of geoMeshBase
representing a mesh in a vtkUnstructuredGrid
.
More...
Definition at line 42 of file vtkGeoMesh.H.
Public Member Functions | |
vtkGeoMesh () | |
Create a vtkGeoMesh from a vtkUnstructuredGrid file. More... | |
vtkGeoMesh (vtkUnstructuredGrid *inUnstructuredGrid, const std::string &phyGrpArrayName=std::string()) | |
Construct a vtkGeoMesh from an existing vtkUnstructuredGrid. More... | |
~vtkGeoMesh () override | |
void | write (const std::string &fileName) override |
Write mesh to file. More... | |
void | report (std::ostream &out) const override |
Print a report about the mesh. More... | |
void | getVtkMesh (vtkUnstructuredGrid *dest) |
Copy the mesh. More... | |
void | setVtkMesh (vtkUnstructuredGrid *vtkMesh) |
Set the vtkGeoMesh's mesh to vtkMesh . More... | |
virtual void | takeGeoMesh (geoMeshBase *otherGeoMesh) |
Take the GeoMesh of another geoMeshBase . More... | |
virtual void | reconstructGeo () |
Construct the geometry from the mesh alone. More... | |
virtual void | mergeGeoMesh (geoMeshBase *otherGeoMesh) |
Merge mesh data from a new geoMesh to an existing geoMesh. More... | |
const std::string & | getGeoEntArrayName () const |
Get the name of the geometric entities array. More... | |
void | setGeoEntArrayName (const std::string &geoEntArrayName) |
Set the name of the geometric entities array. More... | |
double | getAngleThreshold () const |
Get the angle threshold used for surface classification. More... | |
void | setAngleThreshold (double angleThreshold) |
Set the angle threshold used for surface classification. More... | |
nemId_t | getNumberOfPoints () const |
Get the number of points in mesh. More... | |
nemId_t | getNumberOfCells () const |
Get the number of cells in mesh. More... | |
void | getPoint (nemId_t id, std::array< double, 3 > *x) const |
Get the coordinate of a point. More... | |
std::array< double, 3 > | getPoint (nemId_t id) const |
Get the coordinate of a point. More... | |
void | getCell (nemId_t cellId, vtkGenericCell *cell) const |
Get cell. More... | |
vtkCell * | getCell (nemId_t cellId) const |
Get cell. More... | |
void | getCellBounds (nemId_t cellId, std::array< double, 6 > *bounds) const |
Get cell bounds. More... | |
std::array< double, 6 > | getCellBounds (nemId_t cellId) const |
Get cell bounds. More... | |
VTKCellType | getCellType (nemId_t cellId) const |
Get VTK cell type. More... | |
void | getCellPoints (nemId_t cellId, vtkIdList *ptIds) const |
Get list of point ids defining specified cell. More... | |
void | getPointCells (nemId_t ptId, vtkIdList *cellIds) const |
Get list of cell ids using specified point. More... | |
void | getCellNeighbors (nemId_t cellId, vtkIdList *ptIds, vtkIdList *cellIds) const |
Get list of cells sharing points ptIds excluding cellId . More... | |
int | getNumberOfPointDataArrays () const |
Get number of arrays in the point data. More... | |
void | getPointDataArrayCopy (const std::string &arrayName, vtkAbstractArray *array, int *arrayIdx=nullptr) const |
Get copy of point data array by name. More... | |
vtkSmartPointer< vtkAbstractArray > | getPointDataArrayCopy (const std::string &arrayName, int *arrayIdx=nullptr) const |
Create and return a copy of point data array by name. More... | |
void | getPointDataArrayCopy (int arrayIdx, vtkAbstractArray *array) const |
Get copy of point data array by index. More... | |
vtkSmartPointer< vtkAbstractArray > | getPointDataArrayCopy (int arrayIdx) const |
Create and return a copy of point data array by index. More... | |
int | getNumberOfCellDataArrays () const |
Get number of arrays in the cell data. More... | |
void | getCellDataArrayCopy (const std::string &arrayName, vtkAbstractArray *array, int *arrayIdx=nullptr) const |
Get copy of cell data array by name. More... | |
vtkSmartPointer< vtkAbstractArray > | getCellDataArrayCopy (const std::string &arrayName, int *arrayIdx=nullptr) const |
Create and return a copy of cell data array by name. More... | |
void | getCellDataArrayCopy (int arrayIdx, vtkAbstractArray *array) const |
Get copy of cell data array by index. More... | |
vtkSmartPointer< vtkAbstractArray > | getCellDataArrayCopy (int arrayIdx) const |
Create and return a copy of cell data array by index. More... | |
int | getNumberOfFieldDataArrays () const |
Get number of arrays in the field data. More... | |
void | getFieldDataArrayCopy (const std::string &arrayName, vtkAbstractArray *array, int *arrayIdx=nullptr) const |
Get copy of field data array by name. More... | |
vtkSmartPointer< vtkAbstractArray > | getFieldDataArrayCopy (const std::string &arrayName, int *arrayIdx=nullptr) const |
Create and return a copy of field data array by name. More... | |
void | getFieldDataArrayCopy (int arrayIdx, vtkAbstractArray *array) const |
Get copy of field data array by index. More... | |
vtkSmartPointer< vtkAbstractArray > | getFieldDataArrayCopy (int arrayIdx) const |
Create and return a copy of field data array by index. More... | |
Static Public Member Functions | |
static vtkGeoMesh * | New () |
Protected Member Functions | |
int | setPointDataArray (vtkAbstractArray *array) |
Set point data. More... | |
int | setCellDataArray (vtkAbstractArray *array) |
Set cell data. More... | |
int | setFieldDataArray (vtkAbstractArray *array) |
Set field data. More... | |
void | unsetPointDataArray (int arrayIdx) |
Remove point data array by index. More... | |
void | unsetPointDataArray (const std::string &arrayName) |
Remove point data array by name. More... | |
void | unsetCellDataArray (int arrayIdx) |
Remove cell data array by index. More... | |
void | unsetCellDataArray (const std::string &arrayName) |
Remove cell data array by name. More... | |
void | unsetFieldDataArray (int arrayIdx) |
Remove field data array by index. More... | |
void | unsetFieldDataArray (const std::string &arrayName) |
Remove field data array by name. More... | |
const GeoMesh & | getGeoMesh () const |
Get the underlying geometry object. More... | |
void | setGeoMesh (const geoMeshBase::GeoMesh &geoMesh) |
Set the underlying geometry object. More... | |
Static Protected Attributes | |
static constexpr auto | GEO_ENT_DEFAULT_NAME = "GeoEnt" |
Private Member Functions | |
void | resetNative () override |
Static Private Member Functions | |
static GeoMesh | vtk2GM (vtkUnstructuredGrid *vtkMesh, const std::string &phyGrpArrayName=std::string()) |
Create a GeoMesh from a vtkUnstructuredGrid . More... | |
Inherits NEM::MSH::geoMeshBase.
NEM::MSH::vtkGeoMesh::vtkGeoMesh | ( | ) |
fileName | name of file |
phyGrpArrayName | name of a vtkDataArray in the CellData defining the physical group of each cell |
Definition at line 99 of file vtkGeoMesh.C.
Referenced by NEM::MSH::vtkStandardNewMacro().
|
explicit |
inUnstructuredGrid | existing vtkUnstructuredGrid; it is used, not copied |
phyGrpArrayName | name of a vtkDataArray in inUnstructuredGrid 's CellData defining the physical group of each cell |
Definition at line 102 of file vtkGeoMesh.C.
|
override |
Definition at line 112 of file vtkGeoMesh.C.
|
inlineinherited |
Definition at line 171 of file geoMeshBase.H.
|
inlineinherited |
cellId | cell id |
cell | cell |
Definition at line 214 of file geoMeshBase.H.
Referenced by NEM::MSH::diffMesh().
|
inlineinherited |
cellId | cell id |
Definition at line 222 of file geoMeshBase.H.
|
inlineinherited |
cellId | cell id |
bounds | array of bounds as (x_min,x_max, y_min,y_max, z_min,z_max) |
Definition at line 230 of file geoMeshBase.H.
|
inlineinherited |
cellId | cell id |
Definition at line 238 of file geoMeshBase.H.
|
inherited |
Optionally, get array index.
arrayName | array name |
array | cell data array |
arrayIdx | array index |
Definition at line 180 of file geoMeshBase.C.
References NEM::MSH::geoMeshBase::_geoMesh, and NEM::MSH::geoMeshBase::GeoMesh::mesh.
Referenced by NEM::MSH::diffMesh().
|
inherited |
Optionally, get array index.
arrayName | array name |
arrayIdx | array index |
Definition at line 186 of file geoMeshBase.C.
References NEM::MSH::geoMeshBase::_geoMesh, and NEM::MSH::geoMeshBase::GeoMesh::mesh.
|
inherited |
arrayIdx | array index |
array | cell data array |
Definition at line 191 of file geoMeshBase.C.
References NEM::MSH::geoMeshBase::_geoMesh, and NEM::MSH::geoMeshBase::GeoMesh::mesh.
|
inherited |
arrayIdx | array index |
Definition at line 196 of file geoMeshBase.C.
References NEM::MSH::geoMeshBase::_geoMesh, and NEM::MSH::geoMeshBase::GeoMesh::mesh.
|
inlineinherited |
cellId | id of cell to exclude |
ptIds | point id |
cellIds | list of cell ids |
Definition at line 273 of file geoMeshBase.H.
|
inlineinherited |
cellId | cell id |
ptIds | list of point ids |
Definition at line 256 of file geoMeshBase.H.
|
inlineinherited |
cellId | cell id |
Definition at line 248 of file geoMeshBase.H.
|
inherited |
Optionally, get array index.
arrayName | array name |
array | field data array |
arrayIdx | array index |
Definition at line 201 of file geoMeshBase.C.
References NEM::MSH::geoMeshBase::_geoMesh, and NEM::MSH::geoMeshBase::GeoMesh::mesh.
|
inherited |
Optionally, get array index.
arrayName | array name |
arrayIdx | array index |
Definition at line 207 of file geoMeshBase.C.
References NEM::MSH::geoMeshBase::_geoMesh, and NEM::MSH::geoMeshBase::GeoMesh::mesh.
|
inherited |
arrayIdx | array index |
array | field data array |
Definition at line 212 of file geoMeshBase.C.
References NEM::MSH::geoMeshBase::_geoMesh, and NEM::MSH::geoMeshBase::GeoMesh::mesh.
|
inherited |
arrayIdx | array index |
Definition at line 217 of file geoMeshBase.C.
References NEM::MSH::geoMeshBase::_geoMesh, and NEM::MSH::geoMeshBase::GeoMesh::mesh.
|
inlineinherited |
Definition at line 157 of file geoMeshBase.H.
Referenced by NEM::MSH::diffMesh().
|
inlineprotectedinherited |
Definition at line 533 of file geoMeshBase.H.
Referenced by NEM::MSH::exoGeoMesh::addCellsToBlock(), NEM::MSH::exoGeoMesh::addElemBlock(), NEM::MSH::exoGeoMesh::addElemBlockProperty(), NEM::MSH::exoGeoMesh::addNodeSet(), NEM::MSH::exoGeoMesh::addSideSet(), NEM::MSH::exoGeoMesh::exoGeoMesh(), NEM::MSH::exoGeoMesh::getElemBlock(), NEM::MSH::exoGeoMesh::getElemBlockId(), NEM::MSH::exoGeoMesh::getSideSet(), getVtkMesh(), NEM::MSH::inpGeoMesh::inpGeoMesh(), NEM::MSH::exoGeoMesh::reassignCells(), NEM::MSH::oshGeoMesh::reconstructGeo(), NEM::MSH::exoGeoMesh::reconstructGeo(), NEM::MSH::geoMeshBase::report(), NEM::MSH::exoGeoMesh::resetElemBlocks(), NEM::MSH::smeshGeoMesh::resetNative(), NEM::MSH::gmshGeoMesh::resetNative(), NEM::MSH::inpGeoMesh::resetNative(), NEM::MSH::foamGeoMesh::resetNative(), NEM::MSH::oshGeoMesh::resetNative(), NEM::MSH::exoGeoMesh::resetNative(), NEM::MSH::exoGeoMesh::scaleNodes(), NEM::MSH::oshGeoMesh::setOshMesh(), NEM::MSH::exoGeoMesh::setPhysGrpPropertyName(), NEM::MSH::exoGeoMesh::setSideSetObjId(), NEM::MSH::exoGeoMesh::stitch(), NEM::MSH::gmshGeoMesh::write(), write(), and NEM::MSH::exoGeoMesh::write().
|
inlineinherited |
Definition at line 318 of file geoMeshBase.H.
Referenced by NEM::MSH::diffMesh().
|
inlineinherited |
Definition at line 190 of file geoMeshBase.H.
Referenced by NEM::MSH::diffMesh().
|
inlineinherited |
Definition at line 355 of file geoMeshBase.H.
|
inlineinherited |
Definition at line 281 of file geoMeshBase.H.
Referenced by NEM::MSH::diffMesh().
|
inlineinherited |
Definition at line 183 of file geoMeshBase.H.
Referenced by NEM::MSH::diffMesh().
|
inlineinherited |
id | point id |
x | array of coordinates as (x,y,z) |
Definition at line 196 of file geoMeshBase.H.
Referenced by NEM::MSH::diffMesh().
|
inlineinherited |
id | point id |
Definition at line 204 of file geoMeshBase.H.
|
inlineinherited |
ptId | point id |
cellIds | list of cell ids |
Definition at line 264 of file geoMeshBase.H.
|
inherited |
Optionally, get array index.
arrayName | array name |
array | point data array |
arrayIdx | array index |
Definition at line 159 of file geoMeshBase.C.
References NEM::MSH::geoMeshBase::_geoMesh, and NEM::MSH::geoMeshBase::GeoMesh::mesh.
Referenced by NEM::MSH::diffMesh().
|
inherited |
Optionally, get array index.
arrayName | array name |
arrayIdx | array index |
Definition at line 165 of file geoMeshBase.C.
References NEM::MSH::geoMeshBase::_geoMesh, and NEM::MSH::geoMeshBase::GeoMesh::mesh.
|
inherited |
arrayIdx | array index |
array | point data array |
Definition at line 170 of file geoMeshBase.C.
References NEM::MSH::geoMeshBase::_geoMesh, and NEM::MSH::geoMeshBase::GeoMesh::mesh.
|
inherited |
arrayIdx | array index |
Definition at line 175 of file geoMeshBase.C.
References NEM::MSH::geoMeshBase::_geoMesh, and NEM::MSH::geoMeshBase::GeoMesh::mesh.
void NEM::MSH::vtkGeoMesh::getVtkMesh | ( | vtkUnstructuredGrid * | dest | ) |
dest | copy the vtkUnstructuredGrid into dest |
Definition at line 135 of file vtkGeoMesh.C.
References NEM::MSH::geoMeshBase::getGeoMesh(), and mesh.
|
virtualinherited |
Deletes the data from the new geoMesh pointer
otherGeoMesh | A new geoMesh data to merge |
Definition at line 113 of file geoMeshBase.C.
References NEM::MSH::geoMeshBase::_geoMesh, NEM::MSH::geoMeshBase::GeoMesh::mesh, NEM::MSH::New(), and NEM::MSH::geoMeshBase::resetNative().
|
static |
Referenced by NEM::MSH::New(), and NEM::SRV::srvBase::RequestDataObject().
|
virtualinherited |
Sets geometry, link, and side set. Does not alter the mesh.
Reimplemented in NEM::MSH::exoGeoMesh, NEM::MSH::oshGeoMesh, and NEM::MSH::inpGeoMesh.
Definition at line 466 of file geoMeshBaseReconstructGeo.C.
References NEM::MSH::geoMeshBase::_angleThreshold, NEM::MSH::geoMeshBase::_geoMesh, NEM::MSH::geoMeshBase::GeoMesh::geo, NEM::MSH::geoMeshBase::GEO_ENT_DEFAULT_NAME, nemAux::getRandomString(), NEM::MSH::geoMeshBase::GeoMesh::link, NEM::MSH::geoMeshBase::GeoMesh::mesh, NEM::MSH::geoMeshBase::SideSet::sides, and NEM::MSH::geoMeshBase::GeoMesh::sideSet.
Referenced by NEM::MSH::inpGeoMesh::reconstructGeo(), NEM::MSH::oshGeoMesh::reconstructGeo(), and NEM::MSH::exoGeoMesh::reconstructGeo().
|
overridevirtual |
out | stream |
Implements NEM::MSH::geoMeshBase.
Definition at line 133 of file vtkGeoMesh.C.
References NEM::MSH::geoMeshBase::report().
|
overrideprivatevirtual |
|
inlineinherited |
angleThreshold | (in radians) |
Definition at line 176 of file geoMeshBase.H.
|
inlineprotectedinherited |
array | array pointer |
Definition at line 473 of file geoMeshBase.H.
|
inlineprotectedinherited |
array | array pointer |
Definition at line 481 of file geoMeshBase.H.
|
inlineinherited |
geoEntArrayName | name of geometric entities array |
Definition at line 162 of file geoMeshBase.H.
|
inlineprotectedinherited |
geoMesh | a mesh and geometry |
Definition at line 538 of file geoMeshBase.H.
References NEM::MSH::geoMeshBase::GeoMesh::mesh, NEM::MSH::geoMeshBase::SideSet::sides, and NEM::MSH::geoMeshBase::GeoMesh::sideSet.
Referenced by NEM::MSH::exoGeoMesh::addCellsToBlock(), NEM::MSH::exoGeoMesh::addElemBlock(), NEM::MSH::exoGeoMesh::addSideSet(), NEM::MSH::exoGeoMesh::reassignCells(), NEM::MSH::exoGeoMesh::reconstructGeo(), NEM::MSH::gmshGeoMesh::resetNative(), NEM::MSH::exoGeoMesh::resetNative(), NEM::MSH::exoGeoMesh::scaleNodes(), NEM::MSH::foamGeoMesh::setFoamMesh(), NEM::MSH::oshGeoMesh::setOshMesh(), NEM::MSH::smeshGeoMesh::setSMeshMesh(), setVtkMesh(), NEM::MSH::exoGeoMesh::stitch(), NEM::MSH::oshGeoMesh::takeGeoMesh(), and NEM::MSH::exoGeoMesh::takeGeoMesh().
|
inlineprotectedinherited |
array | array pointer |
Definition at line 465 of file geoMeshBase.H.
void NEM::MSH::vtkGeoMesh::setVtkMesh | ( | vtkUnstructuredGrid * | vtkMesh | ) |
vtkMesh | existing vtkUnstructured grid; note the pointer is used, the vtkUnstructuredGrid is not copied |
Definition at line 139 of file vtkGeoMesh.C.
References NEM::MSH::geoMeshBase::setGeoMesh(), and vtk2GM().
|
virtualinherited |
Note that otherGeoMesh
will be left with an empty mesh.
otherGeoMesh | other geoMeshBase object; mesh will be left empty |
Reimplemented in NEM::MSH::exoGeoMesh, and NEM::MSH::oshGeoMesh.
Definition at line 104 of file geoMeshBase.C.
References NEM::MSH::geoMeshBase::_geoMesh, NEM::MSH::New(), and NEM::MSH::geoMeshBase::resetNative().
Referenced by NEM::MSH::oshGeoMesh::takeGeoMesh(), and NEM::MSH::exoGeoMesh::takeGeoMesh().
|
inlineprotectedinherited |
arrayIdx | array index |
Definition at line 503 of file geoMeshBase.H.
|
inlineprotectedinherited |
arrayName | array name |
Definition at line 510 of file geoMeshBase.H.
|
inlineprotectedinherited |
arrayIdx | array index |
Definition at line 517 of file geoMeshBase.H.
|
inlineprotectedinherited |
arrayName | array name |
Definition at line 524 of file geoMeshBase.H.
|
inlineprotectedinherited |
arrayIdx | array index |
Definition at line 489 of file geoMeshBase.H.
|
inlineprotectedinherited |
arrayName | array name |
Definition at line 496 of file geoMeshBase.H.
|
staticprivate |
Assumes gmsh has already been initialized.
vtkMesh | mesh |
phyGrpArrayName | name of cell data array describing physical group of each cell |
GeoMesh
Definition at line 143 of file vtkGeoMesh.C.
References nemAux::getRandomString(), NEM::MSH::GmshInterface::Initialize(), and NEM::MSH::New().
Referenced by setVtkMesh().
|
overridevirtual |
fileName | file name |
Implements NEM::MSH::geoMeshBase.
Definition at line 114 of file vtkGeoMesh.C.
References nemAux::find_ext(), NEM::MSH::geoMeshBase::getGeoMesh(), mesh, NEM::MSH::geoMeshBase::GeoMesh::mesh, and NEM::MSH::New().
|
staticprotectedinherited |
Definition at line 446 of file geoMeshBase.H.
Referenced by NEM::MSH::gmshGeoMesh::gmsh2GM(), NEM::MSH::inpGeoMesh::inp2GM(), NEM::MSH::oshGeoMesh::osh2GM(), NEM::MSH::exoGeoMesh::reconstructGeo(), NEM::MSH::geoMeshBase::reconstructGeo(), and NEM::MSH::gmshGeoMesh::resetNative().