A concrete implementation of geoMeshBase
representing a Gmsh mesh.
More...
Definition at line 41 of file gmshGeoMesh.H.
Public Member Functions | |
gmshGeoMesh () | |
Construct a gmshGeoMesh with an empty mesh. More... | |
gmshGeoMesh (const std::string &gmshMesh) | |
Construct a gmshGeoMesh from an existing gmsh model. More... | |
~gmshGeoMesh () 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... | |
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 gmshGeoMesh * | New () |
static vtkTypeMacro(gmshGeoMesh, geoMeshBase) public VTKCellType | getVTKTypeFromGmshType (const std::string &gmshType) |
Create a gmshGeoMesh from a file. More... | |
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 | gmsh2GM (const std::string &gmshMesh) |
Convert gmshMesh (name of a gmsh model) to GeoMesh. More... | |
static std::string | GM2gmsh (const GeoMesh &geoMesh) |
Add the mesh from geoMesh to the gmsh model in geoMesh . More... | |
Private Attributes | |
std::string | _gmshMesh |
Inherits NEM::MSH::geoMeshBase.
NEM::MSH::gmshGeoMesh::gmshGeoMesh | ( | ) |
Definition at line 111 of file gmshGeoMesh.C.
Referenced by NEM::MSH::vtkStandardNewMacro().
|
explicit |
gmshMesh | name of gmsh model created from gmsh::open or gmsh::add |
Definition at line 113 of file gmshGeoMesh.C.
|
override |
|
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(), NEM::MSH::vtkGeoMesh::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(), 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(), write(), NEM::MSH::vtkGeoMesh::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.
|
static |
fileName | file name that gmsh can read |
gmshType | gmsh cell type |
Definition at line 131 of file gmshGeoMesh.C.
References nemAux::findFromStr(), and nemAux::findToStr().
|
staticprivate |
Definition at line 271 of file gmshGeoMesh.C.
References NEM::MSH::geoMeshBase::GeoMesh::geo, NEM::MSH::geoMeshBase::SideSet::getGeoEntArr(), NEM::MSH::geoMeshBase::GeoMesh::link, NEM::MSH::geoMeshBase::GeoMesh::mesh, NEM::MSH::geoMeshBase::SideSet::sides, and NEM::MSH::geoMeshBase::GeoMesh::sideSet.
Referenced by write().
|
staticprivate |
Definition at line 187 of file gmshGeoMesh.C.
References NEM::MSH::geoMeshBase::GEO_ENT_DEFAULT_NAME, NEM::MSH::New(), and points.
|
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 129 of file gmshGeoMesh.C.
References NEM::MSH::geoMeshBase::report().
|
overrideprivatevirtual |
Implements NEM::MSH::geoMeshBase.
Definition at line 338 of file gmshGeoMesh.C.
References _gmshMesh, NEM::MSH::geoMeshBase::GEO_ENT_DEFAULT_NAME, NEM::MSH::geoMeshBase::getGeoMesh(), nemAux::getRandomString(), mesh, NEM::MSH::geoMeshBase::GeoMesh::mesh, NEM::MSH::New(), and NEM::MSH::geoMeshBase::setGeoMesh().
|
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(), resetNative(), NEM::MSH::exoGeoMesh::resetNative(), NEM::MSH::exoGeoMesh::scaleNodes(), NEM::MSH::foamGeoMesh::setFoamMesh(), NEM::MSH::oshGeoMesh::setOshMesh(), NEM::MSH::smeshGeoMesh::setSMeshMesh(), NEM::MSH::vtkGeoMesh::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.
|
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.
|
overridevirtual |
fileName | file name |
Implements NEM::MSH::geoMeshBase.
Definition at line 123 of file gmshGeoMesh.C.
References _gmshMesh, NEM::MSH::geoMeshBase::getGeoMesh(), and GM2gmsh().
|
private |
Definition at line 92 of file gmshGeoMesh.H.
Referenced by resetNative(), and write().
|
staticprotectedinherited |
Definition at line 446 of file geoMeshBase.H.
Referenced by gmsh2GM(), NEM::MSH::inpGeoMesh::inp2GM(), NEM::MSH::oshGeoMesh::osh2GM(), NEM::MSH::exoGeoMesh::reconstructGeo(), NEM::MSH::geoMeshBase::reconstructGeo(), and resetNative().