#include <SMDS_UnstructuredGrid.hxx>
Public Member Functions | |
void | setSMDS_mesh (SMDS_Mesh *mesh) |
void | compactGrid (std::vector< int > &idNodesOldToNew, int newNodeSize, std::vector< int > &idCellsOldToNew, int newCellSize) |
virtual vtkMTimeType | GetMTime () |
virtual vtkPoints * | GetPoints () |
int | InsertNextLinkedCell (int type, int npts, vtkIdType *pts) |
int | CellIdToDownId (int vtkCellId) |
void | setCellIdToDownId (int vtkCellId, int downId) |
void | CleanDownwardConnectivity () |
void | BuildDownwardConnectivity (bool withEdges) |
Build downward connectivity: to do only when needed because heavy memory load. More... | |
int | GetNeighbors (int *neighborsVtkIds, int *downIds, unsigned char *downTypes, int vtkId, bool getSkin=false) |
Get the neighbors of a cell. More... | |
int | GetParentVolumes (int *volVtkIds, int vtkId) |
get the volumes containing a face or an edge of the grid The edge or face belongs to the vtkUnstructuredGrid More... | |
int | GetParentVolumes (int *volVtkIds, int downId, unsigned char downType) |
get the volumes containing a face or an edge of the downward structure The edge or face does not necessary belong to the vtkUnstructuredGrid More... | |
void | GetNodeIds (std::set< int > &nodeSet, int downId, unsigned char downType) |
get the node id's of a cell. More... | |
void | ModifyCellNodes (int vtkVolId, std::map< int, int > localClonedNodeIds) |
change some nodes in cell without modifying type or internal connectivity. More... | |
int | getOrderedNodesOfFace (int vtkVolId, int &dim, std::vector< vtkIdType > &orderedNodes) |
reorder the nodes of a face More... | |
SMDS_MeshCell * | extrudeVolumeFromFace (int vtkVolId, int domain1, int domain2, std::set< int > &originalNodes, std::map< int, std::map< int, int > > &nodeDomains, std::map< int, std::map< long, int > > &nodeQuadDomains) |
Create a volume (prism or hexahedron) by duplication of a face. More... | |
void | BuildLinks () |
void | DeleteLinks () |
SMDS_CellLinks * | GetLinks () |
bool | HasLinks () const |
SMDS_Downward * | getDownArray (unsigned char vtkType) |
void | AllocateDiameters (vtkIdType maxVtkID) |
Allocates data array for ball diameters. More... | |
void | SetBallDiameter (vtkIdType vtkID, double diameter) |
Sets diameter of a ball element. More... | |
double | GetBallDiameter (vtkIdType vtkID) const |
Returns diameter of a ball element. More... | |
Static Public Member Functions | |
static SMDS_UnstructuredGrid * | New () |
Data Fields | |
SMDS_Mesh * | _mesh |
Protected Member Functions | |
SMDS_UnstructuredGrid () | |
~SMDS_UnstructuredGrid () | |
void | copyNodes (vtkPoints *newPoints, std::vector< int > &idNodesOldToNew, int &alreadyCopied, int start, int end) |
void | copyBloc (vtkUnsignedCharArray *newTypes, std::vector< int > &idCellsOldToNew, std::vector< int > &idNodesOldToNew, vtkCellArray *newConnectivity, vtkIdTypeArray *newLocations, vtkIdType *pointsCell, int &alreadyCopied, int start, int end) |
Protected Attributes | |
std::vector< int > | _cellIdToDownId |
convert vtk Id to downward[vtkType] id, initialized with -1 More... | |
std::vector< unsigned char > | _downTypes |
std::vector< SMDS_Downward * > | _downArray |
|
protected |
References _cellIdToDownId, _downArray, _downTypes, and _mesh.
Referenced by New().
|
protected |
void SMDS_UnstructuredGrid::AllocateDiameters | ( | vtkIdType | MaxVtkID | ) |
Allocates data array for ball diameters.
MaxVtkID | - max ID of a ball element |
References SetBallDiameter().
void SMDS_UnstructuredGrid::BuildDownwardConnectivity | ( | bool | withEdges | ) |
Build downward connectivity: to do only when needed because heavy memory load.
Downward connectivity is no more valid if vtkUnstructuredGrid is modified.
References _cellIdToDownId, _downArray, _mesh, CHRONO, CHRONOSTOP, CleanDownwardConnectivity(), SMDS_Down2D::computeEdgesWithNodes(), SMDS_Down1D::computeFaces(), SMDS_Down3D::computeFacesWithNodes(), SMDS_Down2D::computeVolumeIds(), SMDS_Down2D::computeVolumeIdsFromNodesFace(), SMDS_Down1D::computeVtkCells(), ListElemByNodesType::elems, SMDS_Down2D::FindEdgeByNodes(), SMDS_Down3D::FindFaceByNodes(), SMDS_Downward::getCellDimension(), SMDS_Downward::getMaxId(), SMDS_Mesh::GetMeshInfo(), MESSAGE, ListElemByNodesType::nbElems, SMDS_MeshInfo::NbHexas(), SMDS_MeshInfo::NbHexPrisms(), ElemByNodesType::nbNodes, SMDS_MeshInfo::NbPrisms(), SMDS_MeshInfo::NbPyramids(), SMDS_MeshInfo::NbTetras(), ElemByNodesType::nodeIds, ORDER_LINEAR, ORDER_QUADRATIC, SMDS_Down1D::setNodes(), SMDS_Down2D::setTempNodes(), counters::stats(), VTK_MAXTYPE, and ElemByNodesType::vtkType.
Referenced by SMESHDS_Mesh::BuildDownWardConnectivity().
void SMDS_UnstructuredGrid::BuildLinks | ( | ) |
References SMDS_CellLinks::BuildLinks(), and SMDS_CellLinks::New().
Referenced by GetLinks().
References _cellIdToDownId.
Referenced by SMDS_Downward::addCell(), SMDS_Down1D::computeFaces(), SMESH_MeshEditor::DoubleNodesOnGroupBoundaries(), and GetParentVolumes().
void SMDS_UnstructuredGrid::CleanDownwardConnectivity | ( | ) |
References _cellIdToDownId, and _downArray.
Referenced by BuildDownwardConnectivity(), and SMESHDS_Mesh::CleanDownWardConnectivity().
void SMDS_UnstructuredGrid::compactGrid | ( | std::vector< int > & | idNodesOldToNew, |
int | newNodeSize, | ||
std::vector< int > & | idCellsOldToNew, | ||
int | newCellSize | ||
) |
References copyBloc(), copyNodes(), DeleteLinks(), and NBMAXNODESINCELL.
Referenced by SMESHDS_Mesh::compactMesh().
|
protected |
References NBMAXNODESINCELL.
Referenced by compactGrid().
|
protected |
Referenced by compactGrid().
void SMDS_UnstructuredGrid::DeleteLinks | ( | ) |
Referenced by SMDS_Mesh::Clear(), compactGrid(), and SMESH_MeshEditor::DoubleNodesOnGroupBoundaries().
SMDS_MeshCell * SMDS_UnstructuredGrid::extrudeVolumeFromFace | ( | int | vtkVolId, |
int | domain1, | ||
int | domain2, | ||
std::set< int > & | originalNodes, | ||
std::map< int, std::map< int, int > > & | nodeDomains, | ||
std::map< int, std::map< long, int > > & | nodeQuadDomains | ||
) |
Create a volume (prism or hexahedron) by duplication of a face.
Designed for use in creation of flat elements separating volume domains. A face separating two domains is shared by two volume cells. All the nodes are already created (for the two faces). Each original Node is associated to corresponding nodes in the domains. Some nodes may be duplicated for more than two domains, when domain separations intersect. In that case, even some of the nodes to use for the original face may be changed.
vtkVolId,: | vtk id of a volume containing the face, to get an orientation for the face. |
domain1,: | domain of the original face |
domain2,: | domain of the duplicated face |
originalNodes,: | the vtk node ids of the original face |
nodeDomains,: | map(original id –> map(domain –> duplicated node id)) |
References _mesh, SMDS_Mesh::AddFaceFromVtkIds(), SMDS_Mesh::AddNode(), SMDS_Mesh::AddVolumeFromVtkIds(), getOrderedNodesOfFace(), and SMDS_MeshElement::getVtkId().
Referenced by SMESH_MeshEditor::DoubleNodesOnGroupBoundaries().
double SMDS_UnstructuredGrid::GetBallDiameter | ( | vtkIdType | vtkID | ) | const |
Returns diameter of a ball element.
vtkID | - vtk id of the ball element |
SMDS_Downward* SMDS_UnstructuredGrid::getDownArray | ( | unsigned char | vtkType | ) |
SMDS_CellLinks * SMDS_UnstructuredGrid::GetLinks | ( | ) |
|
virtual |
int SMDS_UnstructuredGrid::GetNeighbors | ( | int * | neighborsVtkIds, |
int * | downIds, | ||
unsigned char * | downTypes, | ||
int | vtkId, | ||
bool | getSkin = false |
||
) |
Get the neighbors of a cell.
Only the neighbors having the dimension of the cell are taken into account (neighbors of a volume are the volumes sharing a face with this volume, neighbors of a face are the faces sharing an edge with this face...).
neighborsVtkIds | vector of neighbors vtk id's to fill (reserve enough space). |
downIds | downward id's of cells of dimension n-1, to fill (reserve enough space). |
downTypes | vtk types of cells of dimension n-1, to fill (reserve enough space). |
vtkId | the vtk id of the cell |
References _cellIdToDownId, _downArray, SMDS_Downward::getCellDimension(), and NBMAXNEIGHBORS.
Referenced by SMESH_MeshEditor::CreateHoleSkin(), and SMESH_MeshEditor::DoubleNodesOnGroupBoundaries().
void SMDS_UnstructuredGrid::GetNodeIds | ( | std::set< int > & | nodeSet, |
int | downId, | ||
unsigned char | downType | ||
) |
get the node id's of a cell.
The cell is defined by it's downward connectivity id and type.
nodeSet | set of of vtk node id's to fill. |
downId | downward connectivity id of the cell. |
downType | type of cell. |
References _downArray.
Referenced by SMESH_MeshEditor::DoubleNodesOnGroupBoundaries().
int SMDS_UnstructuredGrid::getOrderedNodesOfFace | ( | int | vtkVolId, |
int & | dim, | ||
std::vector< vtkIdType > & | orderedNodes | ||
) |
reorder the nodes of a face
vtkVolId | vtk id of a volume containing the face, to get an orientation for the face. |
orderedNodes | list of nodes to reorder (in out) |
References _cellIdToDownId, _downArray, SMDS_Downward::getCellDimension(), and SMDS_Downward::getOrderedNodesOfFace().
Referenced by extrudeVolumeFromFace().
get the volumes containing a face or an edge of the grid The edge or face belongs to the vtkUnstructuredGrid
volVtkIds | vector of parent volume ids to fill (reserve enough space!) |
vtkId | vtk id of the face or edge |
References _downArray, CellIdToDownId(), SMDS_Downward::getCellDimension(), and MESSAGE.
Referenced by SMESH_MeshEditor::DoubleNodesOnGroupBoundaries().
get the volumes containing a face or an edge of the downward structure The edge or face does not necessary belong to the vtkUnstructuredGrid
volVtkIds | vector of parent volume ids to fill (reserve enough space!) |
downId | id in the downward structure |
downType | type of cell |
References _downArray, and SMDS_Downward::getCellDimension().
|
virtual |
Referenced by SMDS_MeshNode::init(), and SMDS_MeshNode::setXYZ().
bool SMDS_UnstructuredGrid::HasLinks | ( | ) | const |
Referenced by SMDS_MeshNode::AddInverseElement(), and SMDS_MeshNode::init().
void SMDS_UnstructuredGrid::ModifyCellNodes | ( | int | vtkVolId, |
std::map< int, int > | localClonedNodeIds | ||
) |
change some nodes in cell without modifying type or internal connectivity.
Nodes inverse connectivity is maintained up to date.
vtkVolId | vtk id of the cell |
localClonedNodeIds | map old node id to new node id. |
Referenced by SMESHDS_Mesh::ModifyCellNodes().
|
static |
References SMDS_UnstructuredGrid().
Referenced by SMESH_MeshObj::NulData(), and SMDS_Mesh::SMDS_Mesh().
void SMDS_UnstructuredGrid::SetBallDiameter | ( | vtkIdType | vtkID, |
double | diameter | ||
) |
Sets diameter of a ball element.
vtkID | - vtk id of the ball element |
diameter | - diameter of the ball element |
Referenced by AllocateDiameters(), and SMDS_BallElement::init().
References _cellIdToDownId.
Referenced by SMDS_Downward::addCell().
void SMDS_UnstructuredGrid::setSMDS_mesh | ( | SMDS_Mesh * | mesh | ) |
References _mesh.
Referenced by SMDS_Mesh::SMDS_Mesh().
|
protected |
convert vtk Id to downward[vtkType] id, initialized with -1
Referenced by BuildDownwardConnectivity(), CellIdToDownId(), CleanDownwardConnectivity(), GetNeighbors(), getOrderedNodesOfFace(), setCellIdToDownId(), and SMDS_UnstructuredGrid().
|
protected |
|
protected |
Referenced by SMDS_UnstructuredGrid().
SMDS_Mesh* SMDS_UnstructuredGrid::_mesh |
Referenced by BuildDownwardConnectivity(), extrudeVolumeFromFace(), SMDS_DownTetra::getOrderedNodesOfFace(), SMDS_DownQuadTetra::getOrderedNodesOfFace(), SMDS_DownPyramid::getOrderedNodesOfFace(), SMDS_DownQuadPyramid::getOrderedNodesOfFace(), SMDS_DownPenta::getOrderedNodesOfFace(), SMDS_DownQuadPenta::getOrderedNodesOfFace(), SMDS_DownHexa::getOrderedNodesOfFace(), SMDS_DownQuadHexa::getOrderedNodesOfFace(), setSMDS_mesh(), and SMDS_UnstructuredGrid().