#include <SMDS_MeshInfo.hxx>
Definition at line 33 of file SMDS_MeshInfo.hxx.
| SMDS_MeshInfo::SMDS_MeshInfo | ( | ) |
Definition at line 88 of file SMDS_MeshInfo.hxx.
References index(), myNb, myNb0DElements, myNbEdges, myNbHexas, myNbNodes, myNbPrisms, myNbPyramids, myNbQuadEdges, myNbQuadHexas, myNbQuadPrisms, myNbQuadPyramids, myNbQuadQuadrangles, myNbQuadrangles, myNbQuadTetras, myNbQuadTriangles, myNbTetras, myNbTriangles, myShift, SMDSAbs_0DElement, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_NbElementTypes, SMDSAbs_Node, and SMDSAbs_Volume.
: myNbNodes(0), myNb0DElements(0), myNbEdges (0), myNbQuadEdges (0), myNbTriangles (0), myNbQuadTriangles (0), myNbQuadrangles(0), myNbQuadQuadrangles(0), myNbPolygons(0), myNbTetras (0), myNbQuadTetras (0), myNbHexas (0), myNbQuadHexas (0), myNbPyramids(0), myNbQuadPyramids(0), myNbPrisms (0), myNbQuadPrisms (0), myNbPolyhedrons(0) { // Number of nodes in standard element types // n v f e 0 n // o o a d d o // d l c g d // e e e e // s // ----------------- // 0 * // 1 . * // 2 * // 3 . * // 4 * . . // 5 * // 6 * . // 7 // 8 * . // 9 // 10 * // 11 * // 12 * // 13 * // 14 * // 15 * // 16 * // 17 // 18 // 19 // 20 * // // So to have a unique index for each type basing on nb of nodes, we use a shift: myShift.resize(SMDSAbs_NbElementTypes, 0); myShift[ SMDSAbs_Face ] = +8; // 3->11, 4->12, 6->14, 8->16 myShift[ SMDSAbs_Edge ] = -2; // 2->0, 4->2 myShift[ SMDSAbs_0DElement ] = +2; // 1->3 myNb.resize( index( SMDSAbs_Volume,20 ) + 1, NULL); myNb[ index( SMDSAbs_Node,1 )] = & myNbNodes; myNb[ index( SMDSAbs_0DElement,1 )] = & myNb0DElements; myNb[ index( SMDSAbs_Edge,2 )] = & myNbEdges; myNb[ index( SMDSAbs_Edge,4 )] = & myNbQuadEdges; myNb[ index( SMDSAbs_Face,3 )] = & myNbTriangles; myNb[ index( SMDSAbs_Face,4 )] = & myNbQuadrangles; myNb[ index( SMDSAbs_Face,6 )] = & myNbQuadTriangles; myNb[ index( SMDSAbs_Face,8 )] = & myNbQuadQuadrangles; myNb[ index( SMDSAbs_Volume, 4)] = & myNbTetras; myNb[ index( SMDSAbs_Volume, 5)] = & myNbPyramids; myNb[ index( SMDSAbs_Volume, 6)] = & myNbPrisms; myNb[ index( SMDSAbs_Volume, 8)] = & myNbHexas; myNb[ index( SMDSAbs_Volume, 10)] = & myNbQuadTetras; myNb[ index( SMDSAbs_Volume, 13)] = & myNbQuadPyramids; myNb[ index( SMDSAbs_Volume, 15)] = & myNbQuadPrisms; myNb[ index( SMDSAbs_Volume, 20)] = & myNbQuadHexas; }
| void SMDS_MeshInfo::add | ( | const SMDS_MeshElement * | el | ) | [private] |
Definition at line 176 of file SMDS_MeshInfo.hxx.
References SMDS_MeshElement.GetType(), index(), myNb, and SMDS_MeshElement.NbNodes().
| void SMDS_MeshInfo::Clear | ( | ) |
Definition at line 162 of file SMDS_MeshInfo.hxx.
References myNb, myNbPolygons, and myNbPolyhedrons.
Referenced by SMDS_Mesh.Clear().
{ for ( int i=0; i<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=0;
myNbPolygons=myNbPolyhedrons=0;
}
| int SMDS_MeshInfo::index | ( | SMDSAbs_ElementType | type, |
| int | nbNodes | ||
| ) | const [private] |
Definition at line 168 of file SMDS_MeshInfo.hxx.
References myShift.
Referenced by add(), NbElements(), remove(), and SMDS_MeshInfo().
{ return nbNodes + myShift[ type ]; }
| int SMDS_MeshInfo.Nb0DElements | ( | ) | const |
Definition at line 44 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.Nb0DElements(), and DriverMED_W_SMESHDS_Mesh.Perform().
{ return myNb0DElements; }
| int SMDS_MeshInfo::NbEdges | ( | SMDSAbs_ElementOrder | order = ORDER_ANY | ) | const |
Definition at line 192 of file SMDS_MeshInfo.hxx.
References myNbEdges, myNbQuadEdges, ORDER_ANY, and ORDER_LINEAR.
Referenced by SMDS_Mesh.NbEdges(), and DriverMED_W_SMESHDS_Mesh.Perform().
{ return order == ORDER_ANY ? myNbEdges+myNbQuadEdges : order == ORDER_LINEAR ? myNbEdges : myNbQuadEdges; }
| int SMDS_MeshInfo::NbElements | ( | SMDSAbs_ElementType | type = SMDSAbs_All | ) | const |
Definition at line 228 of file SMDS_MeshInfo.hxx.
References index(), myNb, myNb0DElements, myNbEdges, myNbHexas, myNbNodes, myNbPolygons, myNbPolyhedrons, myNbPrisms, myNbPyramids, myNbQuadEdges, myNbQuadHexas, myNbQuadPrisms, myNbQuadPyramids, myNbQuadQuadrangles, myNbQuadrangles, myNbQuadTetras, myNbQuadTriangles, myNbTetras, myNbTriangles, SMDSAbs_0DElement, SMDSAbs_All, SMDSAbs_Edge, SMDSAbs_Face, SMDSAbs_Node, and SMDSAbs_Volume.
Referenced by SMESH_Gen_i.CopyMesh(), and SMESH_ElementSearcherImpl.getTolerance().
{
int nb = 0;
switch (type) {
case SMDSAbs_All:
for ( int i=1+index( SMDSAbs_Node,1 ); i<myNb.size(); ++i ) if ( myNb[i] ) nb += *myNb[i];
nb += myNbPolygons + myNbPolyhedrons;
break;
case SMDSAbs_Volume:
nb = myNbTetras+ myNbPyramids+ myNbPrisms+ myNbHexas+
myNbQuadTetras+ myNbQuadPyramids+ myNbQuadPrisms+ myNbQuadHexas+myNbPolyhedrons;
break;
case SMDSAbs_Face:
nb = myNbTriangles+ myNbQuadrangles+ myNbQuadTriangles+ myNbQuadQuadrangles + myNbPolygons;
break;
case SMDSAbs_Edge:
nb = myNbEdges + myNbQuadEdges;
break;
case SMDSAbs_0DElement:
nb = myNb0DElements;
break;
case SMDSAbs_Node:
nb = myNbNodes;
break;
default:;
}
return nb;
}
| int SMDS_MeshInfo::NbEntities | ( | SMDSAbs_EntityType | type | ) | const |
Definition at line 258 of file SMDS_MeshInfo.hxx.
References myNb0DElements, myNbEdges, myNbHexas, myNbNodes, myNbPolygons, myNbPolyhedrons, myNbPrisms, myNbPyramids, myNbQuadEdges, myNbQuadHexas, myNbQuadPrisms, myNbQuadPyramids, myNbQuadQuadrangles, myNbQuadrangles, myNbQuadTetras, myNbQuadTriangles, myNbTetras, myNbTriangles, SMDSEntity_0D, SMDSEntity_Edge, SMDSEntity_Hexa, SMDSEntity_Node, SMDSEntity_Penta, SMDSEntity_Polygon, SMDSEntity_Polyhedra, SMDSEntity_Pyramid, SMDSEntity_Quad_Edge, SMDSEntity_Quad_Hexa, SMDSEntity_Quad_Penta, SMDSEntity_Quad_Polygon, SMDSEntity_Quad_Polyhedra, SMDSEntity_Quad_Pyramid, SMDSEntity_Quad_Quadrangle, SMDSEntity_Quad_Tetra, SMDSEntity_Quad_Triangle, SMDSEntity_Quadrangle, SMDSEntity_Tetra, and SMDSEntity_Triangle.
Referenced by SMESH_Mesh_i.GetMeshInfo(), and SMESH_ProxyMesh.NbFaces().
{
switch (type) {
case SMDSEntity_Node:
return myNbNodes;
break;
case SMDSEntity_0D:
return myNb0DElements;
break;
case SMDSEntity_Edge:
return myNbEdges;
break;
case SMDSEntity_Quad_Edge:
return myNbQuadEdges;
break;
case SMDSEntity_Triangle:
return myNbTriangles;
break;
case SMDSEntity_Quad_Triangle:
return myNbQuadTriangles;
break;
case SMDSEntity_Quadrangle:
return myNbQuadrangles;
break;
case SMDSEntity_Quad_Quadrangle:
return myNbQuadQuadrangles;
break;
case SMDSEntity_Polygon:
return myNbPolygons;
break;
case SMDSEntity_Tetra:
return myNbTetras;
break;
case SMDSEntity_Quad_Tetra:
return myNbQuadTetras;
break;
case SMDSEntity_Pyramid:
return myNbPyramids;
break;
case SMDSEntity_Quad_Pyramid:
return myNbQuadPyramids;
break;
case SMDSEntity_Hexa:
return myNbHexas;
break;
case SMDSEntity_Quad_Hexa:
return myNbQuadHexas;
break;
case SMDSEntity_Penta:
return myNbPrisms;
break;
case SMDSEntity_Quad_Penta:
return myNbQuadPrisms;
break;
case SMDSEntity_Polyhedra:
return myNbPolyhedrons;
break;
case SMDSEntity_Quad_Polygon:
case SMDSEntity_Quad_Polyhedra:
default:
break;
}
return 0;
}
| int SMDS_MeshInfo::NbFaces | ( | SMDSAbs_ElementOrder | order = ORDER_ANY | ) | const |
Definition at line 196 of file SMDS_MeshInfo.hxx.
References myNbPolygons, NbQuadrangles(), NbTriangles(), and ORDER_QUADRATIC.
Referenced by SMDS_Mesh.NbFaces().
{ return NbTriangles(order)+NbQuadrangles(order)+(order == ORDER_QUADRATIC ? 0 : myNbPolygons); }
| int SMDS_MeshInfo::NbHexas | ( | SMDSAbs_ElementOrder | order = ORDER_ANY | ) | const |
Definition at line 216 of file SMDS_MeshInfo.hxx.
References myNbHexas, myNbQuadHexas, ORDER_ANY, and ORDER_LINEAR.
Referenced by SMDS_UnstructuredGrid.BuildDownwardConnectivity(), NbVolumes(), and DriverMED_W_SMESHDS_Mesh.Perform().
{ return order == ORDER_ANY ? myNbHexas+myNbQuadHexas : order == ORDER_LINEAR ? myNbHexas : myNbQuadHexas; }
| int SMDS_MeshInfo.NbNodes | ( | ) | const |
Definition at line 40 of file SMDS_MeshInfo.hxx.
Referenced by SMESH_ElementSearcherImpl.getTolerance(), and SMDS_Mesh.NbNodes().
{ return myNbNodes; }
| int SMDS_MeshInfo.NbPolygons | ( | ) | const |
Definition at line 49 of file SMDS_MeshInfo.hxx.
Referenced by DriverMED_W_SMESHDS_Mesh.Perform(), and DriverSTL_W_SMDS_Mesh.writeBinary().
{ return myNbPolygons; }
| int SMDS_MeshInfo.NbPolyhedrons | ( | ) | const |
Definition at line 56 of file SMDS_MeshInfo.hxx.
Referenced by DriverMED_W_SMESHDS_Mesh.Perform().
{ return myNbPolyhedrons; }
| int SMDS_MeshInfo::NbPrisms | ( | SMDSAbs_ElementOrder | order = ORDER_ANY | ) | const |
Definition at line 224 of file SMDS_MeshInfo.hxx.
References myNbPrisms, myNbQuadPrisms, ORDER_ANY, and ORDER_LINEAR.
Referenced by SMDS_UnstructuredGrid.BuildDownwardConnectivity(), NbVolumes(), and DriverMED_W_SMESHDS_Mesh.Perform().
{ return order == ORDER_ANY ? myNbPrisms+myNbQuadPrisms : order == ORDER_LINEAR ? myNbPrisms : myNbQuadPrisms; }
| int SMDS_MeshInfo::NbPyramids | ( | SMDSAbs_ElementOrder | order = ORDER_ANY | ) | const |
Definition at line 220 of file SMDS_MeshInfo.hxx.
References myNbPyramids, myNbQuadPyramids, ORDER_ANY, and ORDER_LINEAR.
Referenced by SMDS_UnstructuredGrid.BuildDownwardConnectivity(), NbVolumes(), and DriverMED_W_SMESHDS_Mesh.Perform().
{ return order == ORDER_ANY ? myNbPyramids+myNbQuadPyramids : order == ORDER_LINEAR ? myNbPyramids : myNbQuadPyramids; }
| int SMDS_MeshInfo::NbQuadrangles | ( | SMDSAbs_ElementOrder | order = ORDER_ANY | ) | const |
Definition at line 204 of file SMDS_MeshInfo.hxx.
References myNbQuadQuadrangles, myNbQuadrangles, ORDER_ANY, and ORDER_LINEAR.
Referenced by NbFaces(), DriverMED_W_SMESHDS_Mesh.Perform(), and DriverSTL_W_SMDS_Mesh.writeBinary().
{ return order == ORDER_ANY ? myNbQuadrangles+myNbQuadQuadrangles : order == ORDER_LINEAR ? myNbQuadrangles : myNbQuadQuadrangles; }
| int SMDS_MeshInfo::NbTetras | ( | SMDSAbs_ElementOrder | order = ORDER_ANY | ) | const |
Definition at line 212 of file SMDS_MeshInfo.hxx.
References myNbQuadTetras, myNbTetras, ORDER_ANY, and ORDER_LINEAR.
Referenced by SMDS_UnstructuredGrid.BuildDownwardConnectivity(), NbVolumes(), and DriverMED_W_SMESHDS_Mesh.Perform().
{ return order == ORDER_ANY ? myNbTetras+myNbQuadTetras : order == ORDER_LINEAR ? myNbTetras : myNbQuadTetras; }
| int SMDS_MeshInfo::NbTriangles | ( | SMDSAbs_ElementOrder | order = ORDER_ANY | ) | const |
Definition at line 200 of file SMDS_MeshInfo.hxx.
References myNbQuadTriangles, myNbTriangles, ORDER_ANY, and ORDER_LINEAR.
Referenced by NbFaces(), DriverMED_W_SMESHDS_Mesh.Perform(), and DriverSTL_W_SMDS_Mesh.writeBinary().
{ return order == ORDER_ANY ? myNbTriangles+myNbQuadTriangles : order == ORDER_LINEAR ? myNbTriangles : myNbQuadTriangles; }
| int SMDS_MeshInfo::NbVolumes | ( | SMDSAbs_ElementOrder | order = ORDER_ANY | ) | const |
Definition at line 208 of file SMDS_MeshInfo.hxx.
References myNbPolyhedrons, NbHexas(), NbPrisms(), NbPyramids(), NbTetras(), and ORDER_QUADRATIC.
Referenced by SMDS_Mesh.NbVolumes().
{ return NbTetras(order) + NbHexas(order) + NbPyramids(order) + NbPrisms(order) + (order == ORDER_QUADRATIC ? 0 : myNbPolyhedrons); }
| void SMDS_MeshInfo::remove | ( | const SMDS_MeshElement * | el | ) | [private] |
Definition at line 172 of file SMDS_MeshInfo.hxx.
References SMDS_MeshElement.GetType(), index(), myNb, and SMDS_MeshElement.NbNodes().
Referenced by SMDS_Mesh.RemoveElement(), and SMDS_Mesh.RemoveFreeElement().
| void SMDS_MeshInfo::RemoveEdge | ( | const SMDS_MeshElement * | el | ) | [private] |
Definition at line 180 of file SMDS_MeshInfo.hxx.
References SMDS_MeshElement.IsQuadratic(), myNbEdges, and myNbQuadEdges.
Referenced by SMDS_Mesh.RemoveElement(), and SMDS_Mesh.RemoveFreeElement().
{ if ( el->IsQuadratic() ) --myNbQuadEdges; else --myNbEdges; }
| void SMDS_MeshInfo::RemoveFace | ( | const SMDS_MeshElement * | el | ) | [private] |
Definition at line 184 of file SMDS_MeshInfo.hxx.
References SMDS_MeshElement.IsPoly(), and myNbPolygons.
Referenced by SMDS_Mesh.RemoveElement(), and SMDS_Mesh.RemoveFreeElement().
{ if ( el->IsPoly() ) --myNbPolygons; else remove( el ); }
| void SMDS_MeshInfo::RemoveVolume | ( | const SMDS_MeshElement * | el | ) | [private] |
Definition at line 188 of file SMDS_MeshInfo.hxx.
References SMDS_MeshElement.IsPoly(), and myNbPolyhedrons.
Referenced by SMDS_Mesh.RemoveElement(), and SMDS_Mesh.RemoveFreeElement().
{ if ( el->IsPoly() ) --myNbPolyhedrons; else remove( el ); }
friend class SMDS_Mesh [friend] |
Definition at line 59 of file SMDS_MeshInfo.hxx.
std::vector<int*> SMDS_MeshInfo.myNb [private] |
Definition at line 84 of file SMDS_MeshInfo.hxx.
Referenced by add(), Clear(), NbElements(), remove(), and SMDS_MeshInfo().
int SMDS_MeshInfo.myNb0DElements [private] |
Definition at line 72 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.Add0DElementWithID(), NbElements(), NbEntities(), and SMDS_MeshInfo().
int SMDS_MeshInfo.myNbEdges [private] |
Definition at line 73 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.AddEdgeWithID(), SMDS_Mesh.FindEdgeOrCreate(), NbEdges(), NbElements(), NbEntities(), RemoveEdge(), and SMDS_MeshInfo().
int SMDS_MeshInfo.myNbHexas [private] |
Definition at line 79 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.AddVolumeFromVtkIdsWithID(), SMDS_Mesh.AddVolumeWithID(), NbElements(), NbEntities(), NbHexas(), and SMDS_MeshInfo().
int SMDS_MeshInfo.myNbNodes [private] |
Definition at line 70 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.AddNodeWithID(), NbElements(), NbEntities(), SMDS_Mesh.RemoveElement(), SMDS_Mesh.RemoveFreeElement(), and SMDS_MeshInfo().
int SMDS_MeshInfo.myNbPolygons [private] |
Definition at line 76 of file SMDS_MeshInfo.hxx.
Referenced by Clear(), NbElements(), NbEntities(), NbFaces(), and RemoveFace().
int SMDS_MeshInfo.myNbPolyhedrons [private] |
Definition at line 82 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.AddVolumeFromVtkIdsWithID(), Clear(), NbElements(), NbEntities(), NbVolumes(), and RemoveVolume().
int SMDS_MeshInfo.myNbPrisms [private] |
Definition at line 81 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.AddVolumeFromVtkIdsWithID(), SMDS_Mesh.AddVolumeWithID(), NbElements(), NbEntities(), NbPrisms(), and SMDS_MeshInfo().
int SMDS_MeshInfo.myNbPyramids [private] |
Definition at line 80 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.AddVolumeFromVtkIdsWithID(), SMDS_Mesh.AddVolumeWithID(), NbElements(), NbEntities(), NbPyramids(), and SMDS_MeshInfo().
int SMDS_MeshInfo.myNbQuadEdges [private] |
Definition at line 73 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.AddEdgeWithID(), NbEdges(), NbElements(), NbEntities(), RemoveEdge(), and SMDS_MeshInfo().
int SMDS_MeshInfo.myNbQuadHexas [private] |
Definition at line 79 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.AddVolumeFromVtkIdsWithID(), SMDS_Mesh.AddVolumeWithID(), NbElements(), NbEntities(), NbHexas(), and SMDS_MeshInfo().
int SMDS_MeshInfo.myNbQuadPrisms [private] |
Definition at line 81 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.AddVolumeFromVtkIdsWithID(), SMDS_Mesh.AddVolumeWithID(), NbElements(), NbEntities(), NbPrisms(), and SMDS_MeshInfo().
int SMDS_MeshInfo.myNbQuadPyramids [private] |
Definition at line 80 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.AddVolumeFromVtkIdsWithID(), SMDS_Mesh.AddVolumeWithID(), NbElements(), NbEntities(), NbPyramids(), and SMDS_MeshInfo().
int SMDS_MeshInfo.myNbQuadQuadrangles [private] |
Definition at line 75 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.AddFaceWithID(), NbElements(), NbEntities(), NbQuadrangles(), and SMDS_MeshInfo().
int SMDS_MeshInfo.myNbQuadrangles [private] |
Definition at line 75 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.AddFaceWithID(), SMDS_Mesh.createQuadrangle(), NbElements(), NbEntities(), NbQuadrangles(), and SMDS_MeshInfo().
int SMDS_MeshInfo.myNbQuadTetras [private] |
Definition at line 78 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.AddVolumeFromVtkIdsWithID(), SMDS_Mesh.AddVolumeWithID(), NbElements(), NbEntities(), NbTetras(), and SMDS_MeshInfo().
int SMDS_MeshInfo.myNbQuadTriangles [private] |
Definition at line 74 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.AddFaceWithID(), NbElements(), NbEntities(), NbTriangles(), and SMDS_MeshInfo().
int SMDS_MeshInfo.myNbTetras [private] |
Definition at line 78 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.AddVolumeFromVtkIdsWithID(), SMDS_Mesh.AddVolumeWithID(), NbElements(), NbEntities(), NbTetras(), and SMDS_MeshInfo().
int SMDS_MeshInfo.myNbTriangles [private] |
Definition at line 74 of file SMDS_MeshInfo.hxx.
Referenced by SMDS_Mesh.AddFaceWithID(), SMDS_Mesh.createTriangle(), NbElements(), NbEntities(), NbTriangles(), and SMDS_MeshInfo().
std::vector<int> SMDS_MeshInfo.myShift [private] |
Definition at line 85 of file SMDS_MeshInfo.hxx.
Referenced by index(), and SMDS_MeshInfo().