SMESHDS_Mesh* theMeshDS = theHelper->GetMeshDS();
int nbInitialNodes = theNodeByGhs3dId.size();
- std::cout << "theNodeByGhs3dId.size(): " << nbInitialNodes << std::endl;
int nbMeshNodes = theMeshDS->NbNodes();
- std::cout << "theHelper->GetMesh()->NbNodes(): " << nbMeshNodes << std::endl;
const bool isQuadMesh =
theHelper->GetMesh()->NbEdges( ORDER_QUADRATIC ) ||
theHelper->GetMesh()->NbFaces( ORDER_QUADRATIC ) ||
theHelper->GetMesh()->NbVolumes( ORDER_QUADRATIC );
+
+#ifdef _DEBUG_
+ std::cout << "theNodeByGhs3dId.size(): " << nbInitialNodes << std::endl;
+ std::cout << "theHelper->GetMesh()->NbNodes(): " << nbMeshNodes << std::endl;
std::cout << "isQuadMesh: " << isQuadMesh << std::endl;
+#endif
if (theHelper->GetSubShapeID() != 0)
theHelper->IsQuadraticSubMesh( theHelper->GetSubShape() );
const SMDS_MeshNode* node = castToNode( nodeIt->next() );
gp_Pnt myPoint(node->X(),node->Y(),node->Z());
nbFoundElems = pntCls->FindElementsByPoint(myPoint, SMDSAbs_Node, foundElems);
+#ifdef _DEBUG_
std::cout << "Node at "<<node->X()<<", "<<node->Y()<<", "<<node->Z()<<std::endl;
std::cout << "Nb nodes found : "<<nbFoundElems<<std::endl;
+#endif
if (nbFoundElems ==0) {
if ((*aNodeToTopAbs_StateMap.find(node)).second == TopAbs_IN) {
newId = aNodeToGhs3dIdMap.size() + anEnforcedNodeToGhs3dIdMap.size() + 1; // ghs3d ids count from 1
}
else
isOK = false;
+#ifdef _DEBUG_
std::cout << "GHS3D node ID: "<<newId<<std::endl;
+#endif
}
if (isOK)
theKeptEnforcedEdges.insert(elem);
const SMDS_MeshNode* node = castToNode( nodeIt->next() );
gp_Pnt myPoint(node->X(),node->Y(),node->Z());
nbFoundElems = pntCls->FindElementsByPoint(myPoint, SMDSAbs_Node, foundElems);
+#ifdef _DEBUG_
std::cout << "Nb nodes found : "<<nbFoundElems<<std::endl;
+#endif
if (nbFoundElems ==0) {
if ((*aNodeToTopAbs_StateMap.find(node)).second == TopAbs_IN) {
newId = aNodeToGhs3dIdMap.size() + anEnforcedNodeToGhs3dIdMap.size() + 1; // ghs3d ids count from 1
}
else
isOK = false;
+#ifdef _DEBUG_
std::cout << "GHS3D node ID: "<<newId<<std::endl;
+#endif
}
if (isOK)
theKeptEnforcedTriangles.insert(elem);
}
// put nodes to theNodeByGhs3dId vector
+#ifdef _DEBUG_
std::cout << "aNodeToGhs3dIdMap.size(): "<<aNodeToGhs3dIdMap.size()<<std::endl;
+#endif
theNodeByGhs3dId.resize( aNodeToGhs3dIdMap.size() );
map<const SMDS_MeshNode*,int>::const_iterator n2id = aNodeToGhs3dIdMap.begin();
for ( ; n2id != aNodeToGhs3dIdMap.end(); ++ n2id)
}
// put nodes to anEnforcedNodeToGhs3dIdMap vector
+#ifdef _DEBUG_
std::cout << "anEnforcedNodeToGhs3dIdMap.size(): "<<anEnforcedNodeToGhs3dIdMap.size()<<std::endl;
+#endif
theEnforcedNodeByGhs3dId.resize( anEnforcedNodeToGhs3dIdMap.size());
n2id = anEnforcedNodeToGhs3dIdMap.begin();
for ( ; n2id != anEnforcedNodeToGhs3dIdMap.end(); ++ n2id)
coords.push_back(node->X());
coords.push_back(node->Y());
coords.push_back(node->Z());
+#ifdef _DEBUG_
std::cout << "Node at " << node->X()<<", " <<node->Y()<<", " <<node->Z();
+#endif
if (nodesCoords.find(coords) != nodesCoords.end()) {
// node already exists in original mesh
+#ifdef _DEBUG_
std::cout << " found" << std::endl;
+#endif
continue;
}
if (theEnforcedVertices.find(coords) != theEnforcedVertices.end()) {
// node already exists in enforced vertices
+#ifdef _DEBUG_
std::cout << " found" << std::endl;
+#endif
continue;
}
// theOrderedNodes.push_back(existingNode);
// }
+#ifdef _DEBUG_
std::cout << " not found" << std::endl;
+#endif
nodesCoords.insert(coords);
theOrderedNodes.push_back(node);
coords.push_back(node->X());
coords.push_back(node->Y());
coords.push_back(node->Z());
+#ifdef _DEBUG_
std::cout << "Node at " << node->X()<<", " <<node->Y()<<", " <<node->Z();
+#endif
// Test if point is inside shape to mesh
gp_Pnt myPoint(node->X(),node->Y(),node->Z());
TopAbs_State result = pntCls->GetPointState( myPoint );
if ( result == TopAbs_OUT ) {
+#ifdef _DEBUG_
std::cout << " out of volume" << std::endl;
+#endif
continue;
}
if (nodesCoords.find(coords) != nodesCoords.end()) {
+#ifdef _DEBUG_
std::cout << " found in nodesCoords" << std::endl;
+#endif
// theRequiredNodes.push_back(node);
continue;
}
if (theEnforcedVertices.find(coords) != theEnforcedVertices.end()) {
+#ifdef _DEBUG_
std::cout << " found in theEnforcedVertices" << std::endl;
+#endif
continue;
}
// if ( result != TopAbs_IN )
// continue;
+#ifdef _DEBUG_
std::cout << " not found" << std::endl;
+#endif
nodesCoords.insert(coords);
// theOrderedNodes.push_back(node);
theRequiredNodes.push_back(node);
for (int i=0;i<solSize;i++) {
std::cout << ReqVerTab[i][0] <<" "<< ReqVerTab[i][1] << " "<< ReqVerTab[i][2] << std::endl;
+#ifdef _DEBUG_
std::cout << "enfVertexSizes.at("<<i<<"): " << enfVertexSizes.at(i) << std::endl;
+#endif
double solTab[] = {enfVertexSizes.at(i)};
GmfSetLin(idxRequired, GmfVertices, ReqVerTab[i][0], ReqVerTab[i][1], ReqVerTab[i][2], dummyint);
GmfSetLin(idxSol, GmfSolAtVertices, solTab);
aNodeGroupByGhs3dId[usedEnforcedNodes] = enfVerticesWithGroup.find(ReqVerTab[i])->second;
+#ifdef _DEBUG_
std::cout << "aNodeGroupByGhs3dId["<<usedEnforcedNodes<<"] = \""<<aNodeGroupByGhs3dId[usedEnforcedNodes]<<"\""<<std::endl;
+#endif
usedEnforcedNodes++;
}
std::cout << "End writting in req and sol file" << std::endl;