Version: 8.3.0
SMDS_UnstructuredGrid Class Reference

#include <SMDS_UnstructuredGrid.hxx>

Inheritance diagram for SMDS_UnstructuredGrid:

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_MeshCellextrudeVolumeFromFace (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_CellLinksGetLinks ()
 
bool HasLinks () const
 
SMDS_DownwardgetDownArray (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_UnstructuredGridNew ()
 

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
 

Constructor & Destructor Documentation

SMDS_UnstructuredGrid::SMDS_UnstructuredGrid ( )
protected

References _cellIdToDownId, _downArray, _downTypes, and _mesh.

Referenced by New().

SMDS_UnstructuredGrid::~SMDS_UnstructuredGrid ( )
protected

Member Function Documentation

void SMDS_UnstructuredGrid::AllocateDiameters ( vtkIdType  MaxVtkID)

Allocates data array for ball diameters.

Parameters
MaxVtkID- max ID of a ball element

References SetBallDiameter().

void SMDS_UnstructuredGrid::BuildLinks ( )
int SMDS_UnstructuredGrid::CellIdToDownId ( int  vtkCellId)
void SMDS_UnstructuredGrid::CleanDownwardConnectivity ( )
void SMDS_UnstructuredGrid::compactGrid ( std::vector< int > &  idNodesOldToNew,
int  newNodeSize,
std::vector< int > &  idCellsOldToNew,
int  newCellSize 
)
void SMDS_UnstructuredGrid::copyBloc ( vtkUnsignedCharArray *  newTypes,
std::vector< int > &  idCellsOldToNew,
std::vector< int > &  idNodesOldToNew,
vtkCellArray *  newConnectivity,
vtkIdTypeArray *  newLocations,
vtkIdType *  pointsCell,
int alreadyCopied,
int  start,
int  end 
)
protected

References NBMAXNODESINCELL.

Referenced by compactGrid().

void SMDS_UnstructuredGrid::copyNodes ( vtkPoints *  newPoints,
std::vector< int > &  idNodesOldToNew,
int alreadyCopied,
int  start,
int  end 
)
protected

Referenced by compactGrid().

void SMDS_UnstructuredGrid::DeleteLinks ( )
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.

Parameters
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))
Returns
ok if success.

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.

Parameters
vtkID- vtk id of the ball element
vtkMTimeType SMDS_UnstructuredGrid::GetMTime ( )
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...).

Parameters
neighborsVtkIdsvector of neighbors vtk id's to fill (reserve enough space).
downIdsdownward id's of cells of dimension n-1, to fill (reserve enough space).
downTypesvtk types of cells of dimension n-1, to fill (reserve enough space).
vtkIdthe vtk id of the cell
Returns
number of neighbors

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.

Parameters
nodeSetset of of vtk node id's to fill.
downIddownward connectivity id of the cell.
downTypetype 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

Parameters
vtkVolIdvtk id of a volume containing the face, to get an orientation for the face.
orderedNodeslist of nodes to reorder (in out)
Returns
size of the list

References _cellIdToDownId, _downArray, SMDS_Downward::getCellDimension(), and SMDS_Downward::getOrderedNodesOfFace().

Referenced by extrudeVolumeFromFace().

int SMDS_UnstructuredGrid::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

Parameters
volVtkIdsvector of parent volume ids to fill (reserve enough space!)
vtkIdvtk id of the face or edge

References _downArray, CellIdToDownId(), SMDS_Downward::getCellDimension(), and MESSAGE.

Referenced by SMESH_MeshEditor::DoubleNodesOnGroupBoundaries().

int SMDS_UnstructuredGrid::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

Parameters
volVtkIdsvector of parent volume ids to fill (reserve enough space!)
downIdid in the downward structure
downTypetype of cell

References _downArray, and SMDS_Downward::getCellDimension().

vtkPoints * SMDS_UnstructuredGrid::GetPoints ( )
virtual
bool SMDS_UnstructuredGrid::HasLinks ( ) const
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.

Parameters
vtkVolIdvtk id of the cell
localClonedNodeIdsmap old node id to new node id.

Referenced by SMESHDS_Mesh::ModifyCellNodes().

SMDS_UnstructuredGrid * SMDS_UnstructuredGrid::New ( )
static
void SMDS_UnstructuredGrid::SetBallDiameter ( vtkIdType  vtkID,
double  diameter 
)

Sets diameter of a ball element.

Parameters
vtkID- vtk id of the ball element
diameter- diameter of the ball element

Referenced by AllocateDiameters(), and SMDS_BallElement::init().

void SMDS_UnstructuredGrid::setCellIdToDownId ( int  vtkCellId,
int  downId 
)

References _cellIdToDownId.

Referenced by SMDS_Downward::addCell().

void SMDS_UnstructuredGrid::setSMDS_mesh ( SMDS_Mesh mesh)

References _mesh.

Referenced by SMDS_Mesh::SMDS_Mesh().

Field Documentation

std::vector<int> SMDS_UnstructuredGrid::_cellIdToDownId
protected
std::vector<unsigned char> SMDS_UnstructuredGrid::_downTypes
protected

Referenced by SMDS_UnstructuredGrid().