Correct bugs, connected with 0D Elements implementation (IMP 20089, BUG 21300)

This commit is contained in:
jfa 2009-08-04 12:22:34 +00:00
parent 05a54f24ee
commit f4ba12e460
3 changed files with 32 additions and 21 deletions

View File

@ -22,7 +22,7 @@
// SMESH SMDS : implementaion of Salome mesh data structure // SMESH SMDS : implementaion of Salome mesh data structure
// File : SMDSAbs_ElementType.hxx // File : SMDSAbs_ElementType.hxx
// Module : SMESH // Module : SMESH
//
#ifndef _SMDSAbs_ElementType_HeaderFile #ifndef _SMDSAbs_ElementType_HeaderFile
#define _SMDSAbs_ElementType_HeaderFile #define _SMDSAbs_ElementType_HeaderFile
@ -33,10 +33,10 @@ enum SMDSAbs_ElementType
{ {
SMDSAbs_All, SMDSAbs_All,
SMDSAbs_Node, SMDSAbs_Node,
SMDSAbs_0DElement,
SMDSAbs_Edge, SMDSAbs_Edge,
SMDSAbs_Face, SMDSAbs_Face,
SMDSAbs_Volume, SMDSAbs_Volume,
SMDSAbs_0DElement,
SMDSAbs_NbElementTypes SMDSAbs_NbElementTypes
}; };

View File

@ -100,38 +100,43 @@ inline SMDS_MeshInfo::SMDS_MeshInfo():
myNbPolyhedrons(0) myNbPolyhedrons(0)
{ {
// Number of nodes in standard element types // Number of nodes in standard element types
// n v f e 0 // n v f e 0 n
// o o a d d // o o a d d o
// d l c g // d l c g d
// e e e // e e e e
// -------------- // s
// 1 * // -----------------
// 0 *
// 1 . *
// 2 * // 2 *
// 3 * // 3 . *
// 4 * * * // 4 * . .
// 5 * // 5 *
// 6 * * // 6 * .
// 7 // 7
// 8 * * // 8 * .
// 9 // 9
// 10 * // 10 *
// 11 // 11 *
// 12 // 12 *
// 13 * // 13 *
// 14 // 14 *
// 15 * // 15 *
// 16 // 16 *
// 17 // 17
// 18 // 18
// 19 // 19
// 20 * // 20 *
// //
// So to have a unique index for each type basing on nb of nodes, we use a shift: // So to have a unique index for each type basing on nb of nodes, we use a shift:
myShift.resize(SMDSAbs_Volume + 1, 0); 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_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.resize( index( SMDSAbs_Volume,20 ) + 1, NULL);
myNb[ index( SMDSAbs_Node,1 )] = & myNbNodes; myNb[ index( SMDSAbs_Node,1 )] = & myNbNodes;
myNb[ index( SMDSAbs_0DElement,1 )] = & myNb0DElements; myNb[ index( SMDSAbs_0DElement,1 )] = & myNb0DElements;
@ -153,11 +158,13 @@ inline SMDS_MeshInfo::SMDS_MeshInfo():
myNb[ index( SMDSAbs_Volume, 15)] = & myNbQuadPrisms; myNb[ index( SMDSAbs_Volume, 15)] = & myNbQuadPrisms;
myNb[ index( SMDSAbs_Volume, 20)] = & myNbQuadHexas; myNb[ index( SMDSAbs_Volume, 20)] = & myNbQuadHexas;
} }
inline void // Clear inline void // Clear
SMDS_MeshInfo::Clear() SMDS_MeshInfo::Clear()
{ for ( int i=0; i<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=0; { for ( int i=0; i<myNb.size(); ++i ) if ( myNb[i] ) (*myNb[i])=0;
myNbPolygons=myNbPolyhedrons=0; myNbPolygons=myNbPolyhedrons=0;
} }
inline int // index inline int // index
SMDS_MeshInfo::index(SMDSAbs_ElementType type, int nbNodes) const SMDS_MeshInfo::index(SMDSAbs_ElementType type, int nbNodes) const
{ return nbNodes + myShift[ type ]; } { return nbNodes + myShift[ type ]; }
@ -237,8 +244,12 @@ SMDS_MeshInfo::NbElements(SMDSAbs_ElementType type) const
case SMDSAbs_Edge: case SMDSAbs_Edge:
nb = myNbEdges + myNbQuadEdges; nb = myNbEdges + myNbQuadEdges;
break; break;
case SMDSAbs_0DElement:
nb = myNb0DElements;
break;
case SMDSAbs_Node: case SMDSAbs_Node:
nb = myNbNodes; nb = myNbNodes;
break;
default:; default:;
} }
return nb; return nb;

View File

@ -674,8 +674,8 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::PublishGroup (SALOMEDS::Study_ptr theStudy
} }
int aType = (int)theGroup->GetType(); int aType = (int)theGroup->GetType();
const char* aRootNames[] = { const char* aRootNames[] = {
"Compound Groups", "Groups of Nodes", "Group of 0D Elements", "Compound Groups", "Groups of Nodes", "Groups of Edges",
"Groups of Edges", "Groups of Faces", "Groups of Volumes" }; "Groups of Faces", "Groups of Volumes", "Groups of 0D Elements" };
// Currently, groups with heterogenous content are not supported // Currently, groups with heterogenous content are not supported
if ( aType != SMESH::ALL ) { if ( aType != SMESH::ALL ) {