while ( itOnSubMesh->more() )
{
aFace = itOnSubMesh->next();
- nbNodes = aFace->NbNodes();
+ nbNodes = aFace->NbCornerNodes();
theFile << space << nbNodes;
itOnSubFace = aFace->nodesIterator();
- while ( itOnSubFace->more() ) {
+ while ( itOnSubFace->more() && nbNodes-- ) {
// find GHS3D ID
aSmdsID = itOnSubFace->next()->GetID();
itOnMap = theSmdsToGhs3dIdMap.find( aSmdsID );
}
// (NB_NODES + 1) times: DUMMY_INT
+ nbNodes = aFace->NbCornerNodes();
for ( int j=0; j<=nbNodes; j++)
theFile << space << dummyint;
{
elem = eIt->next();
// NB_NODES PER FACE
- nbNodes = elem->NbNodes();
+ nbNodes = elem->NbCornerNodes();
theFile << space << nbNodes;
// NODE_NB_1 NODE_NB_2 ...
nodeIt = elem->nodesIterator();
- while ( nodeIt->more() )
+ while ( nodeIt->more() && nbNodes-- )
{
// find GHS3D ID
const SMDS_MeshNode* node = castToNode( nodeIt->next() );
}
// (NB_NODES + 1) times: DUMMY_INT
+ nbNodes = elem->NbCornerNodes();
for ( int i=0; i<=nbNodes; i++)
theFile << space << dummyint;
theFile << std::endl;
int nbNodes = theMesh->NbNodes();
if ( nbNodes == 0 )
return false;
+
int nbEnforcedVertices = theEnforcedVertices.size();
+ int aGhs3dID = 1;
+ SMDS_NodeIteratorPtr it = theMesh->nodesIterator();
+ const SMDS_MeshNode* node;
+
// Issue 020674: EDF 870 SMESH: Mesh generated by Netgen not usable by GHS3D
// The problem is in nodes on degenerated edges, we need to skip them
if ( theHelper.HasDegeneratedEdges() )
}
}
}
+
+ const bool isQuadMesh =
+ theHelper.GetMesh()->NbEdges( ORDER_QUADRATIC ) ||
+ theHelper.GetMesh()->NbFaces( ORDER_QUADRATIC ) ||
+ theHelper.GetMesh()->NbVolumes( ORDER_QUADRATIC );
+ if ( isQuadMesh )
+ {
+ // descrease nbNodes by nb of medium nodes
+ while ( it->more() )
+ {
+ node = it->next();
+ if ( !theHelper.IsDegenShape( node->getshapeId() ))
+ nbNodes -= int( theHelper.IsMedium( node ));
+ }
+ it = theMesh->nodesIterator();
+ }
+
const char* space = " ";
const int dummyint = 0;
- int aGhs3dID = 1;
- SMDS_NodeIteratorPtr it = theMesh->nodesIterator();
- const SMDS_MeshNode* node;
-
// NB_NODES
std::cout << std::endl;
std::cout << "The initial 2D mesh contains :" << std::endl;
while ( it->more() )
{
node = it->next();
- if ( node->GetPosition()->GetTypeOfPosition() == SMDS_TOP_EDGE &&
- theHelper.IsDegenShape( node->getshapeId() )) // Issue 020674
+ if (( isQuadMesh && theHelper.IsMedium( node )) || // Issue 0021238
+ theHelper.IsDegenShape( node->getshapeId() )) // Issue 0020674
continue;
theSmdsToGhs3dIdMap.insert( make_pair( node->GetID(), aGhs3dID ));
#ifdef WITH_SMESH_CANCEL_COMPUTE
GHS3DPlugin_GHS3D* theAlgo,
#endif
- SMESH_Mesh& theMesh,
+ SMESH_MesherHelper& theHelper,
TopoDS_Shape tabShape[],
double** tabBox,
const int nbShape,
char *tetraPtr;
char *shapePtr;
- SMESHDS_Mesh* theMeshDS = theMesh.GetMeshDS();
+ SMESHDS_Mesh* theMeshDS = theHelper.GetMeshDS();
int fileStat;
int nbElems, nbNodes, nbInputNodes;
- int nodeId/*, triangleId*/;
+ int nodeId;
int nbTriangle;
int ID, shapeID, ghs3dShapeID;
int IdShapeRef = 1;
const SMDS_MeshNode **node;
tab = new int[3];
- //tabID = new int[nbShape];
nodeID = new int[4];
coord = new double[3];
node = new const SMDS_MeshNode*[4];
const SMDS_MeshNode* n3 = theGhs3dIdToNodeMap[ nodeId3 ];
try {
OCC_CATCH_SIGNALS;
- tabID[i] = findShapeID( theMesh, n1, n2, n3, toMeshHoles );
+ tabID[i] = findShapeID( *theHelper.GetMesh(), n1, n2, n3, toMeshHoles );
// -- 0020330: Pb with ghs3d as a submesh
// check that found shape is to be meshed
if ( tabID[i] > 0 ) {
}
}
if ( toMeshHoles || shapeID != HOLE_ID ) {
- aTet = theMeshDS->AddVolume( node[1], node[0], node[2], node[3] );
+ aTet = theHelper.AddVolume( node[1], node[0], node[2], node[3],
+ /*id=*/0, /*force3d=*/false);
theMeshDS->SetMeshElementOnShape( aTet, shapeID );
}
#ifdef _DEBUG_
#ifdef WITH_SMESH_CANCEL_COMPUTE
GHS3DPlugin_GHS3D* theAlgo,
#endif
- SMESH_Mesh& theMesh,
+ SMESH_MesherHelper& theHelper,
TopoDS_Shape aSolid,
vector <const SMDS_MeshNode*>& theNodeByGhs3dId,
int nbEnforcedVertices)
{
- SMESHDS_Mesh* theMeshDS = theMesh.GetMeshDS();
+ SMESHDS_Mesh* theMeshDS = theHelper.GetMeshDS();
Kernel_Utils::Localizer loc;
struct stat status;
// volumic elements already exist
SMESH_ElementSearcher* elemSearcher = 0;
vector< const SMDS_MeshElement* > foundVolumes;
- if ( theMesh.NbVolumes() > 0 )
- elemSearcher = SMESH_MeshEditor( &theMesh ).GetElementSearcher();
+ if ( theHelper.GetMesh()->NbVolumes() > 0 )
+ elemSearcher = SMESH_MeshEditor( theHelper.GetMesh() ).GetElementSearcher();
// Reading the nodeCoord and update the nodeMap
shapeID = theMeshDS->ShapeToIndex( aSolid );
shapePtr = ptr;
+ if ( theHelper.IsQuadraticMesh() != SMESH_MesherHelper::LINEAR )
+ theHelper.IsQuadraticSubMesh( aSolid );
+
// Associating the tetrahedrons to the shapes
+
for (int iElem = 0; iElem < nbElems; iElem++) {
#ifdef WITH_SMESH_CANCEL_COMPUTE
if(theAlgo->computeCanceled())
SMDSAbs_Volume, foundVolumes ))
continue;
}
- aTet = theMeshDS->AddVolume( node[1], node[0], node[2], node[3] );
- shapeID = theMeshDS->ShapeToIndex( aSolid );
+ aTet = theHelper.AddVolume( node[1], node[0], node[2], node[3],
+ /*id=*/0, /*force3d=*/true);
theMeshDS->SetMeshElementOnShape( aTet, shapeID );
}
if ( nbElems )
else {
bool toMeshHoles =
_hyp ? _hyp->GetToMeshHoles(true) : GHS3DPlugin_Hypothesis::DefaultMeshHoles();
+
+ helper.IsQuadraticSubMesh( theShape );
+ helper.SetElementsOnShape( false );
+
Ok = readResultFile( fileOpen,
#ifdef WNT
aResultFileName.ToCString(),
#ifdef WITH_SMESH_CANCEL_COMPUTE
this,
#endif
- theMesh, tabShape, tabBox, _nbShape, aGhs3dIdToNodeMap,
+ helper, tabShape, tabBox, _nbShape, aGhs3dIdToNodeMap,
toMeshHoles, nbEnforcedVertices );
}
*/
//=============================================================================
bool GHS3DPlugin_GHS3D::Compute(SMESH_Mesh& theMesh,
- SMESH_MesherHelper* aHelper)
+ SMESH_MesherHelper* theHelper)
{
MESSAGE("GHS3DPlugin_GHS3D::Compute()");
//SMESHDS_Mesh* meshDS = theMesh.GetMeshDS();
- TopoDS_Shape theShape = aHelper->GetSubShape();
+ TopoDS_Shape theShape = theHelper->GetSubShape();
// a unique working file name
// to avoid access to the same files by eg different users
#ifdef WITH_SMESH_CANCEL_COMPUTE
this,
#endif
- theMesh, theShape ,aNodeByGhs3dId, nbEnforcedVertices );
+ *theHelper, theShape ,aNodeByGhs3dId, nbEnforcedVertices );
}
// ---------------------