anEnfLayout->addLayout(anEnfLayout2, ENF_VER_VERTEX, 1,ENF_VER_NB_LINES, 1);
anEnfLayout->setRowStretch(ENF_VER_VERTEX, 10);
-
// Enforced meshes parameters
myEnfMeshGroup = new QWidget();
myEnfMeshConstraint = new QComboBox(myEnfMeshGroup);
myEnfMeshConstraint->insertItems(0,myEnfMeshConstraintLabels);
myEnfMeshConstraint->setEditable(false);
- myEnfMeshConstraint->setCurrentIndex(0);
+ myEnfMeshConstraint->setCurrentIndex(2); //EZ: use mesh group of faces for a layer
QLabel* myMeshGroupNameLabel = new QLabel( tr( "HYBRID_ENF_GROUP_LABEL" ), myEnfMeshGroup );
myMeshGroupName = new QLineEdit(myEnfMeshGroup);
QGridLayout* anEnfMeshLayout2 = new QGridLayout(myEnfMeshGroup);
anEnfMeshLayout2->addWidget(myEnfMeshWdg, ENF_MESH_MESH, 0, 1, 2);
- anEnfMeshLayout2->addWidget(myMeshConstraintLabel, ENF_MESH_CONSTRAINT, 0, 1, 1);
- anEnfMeshLayout2->addWidget(myEnfMeshConstraint, ENF_MESH_CONSTRAINT, 1, 1, 1);
- anEnfMeshLayout2->addWidget(myMeshGroupNameLabel, ENF_MESH_GROUP, 0, 1, 1);
- anEnfMeshLayout2->addWidget(myMeshGroupName, ENF_MESH_GROUP, 1, 1, 1);
+ //TODO remove or er usmay be lateful to select layers...
+ //anEnfMeshLayout2->addWidget(myMeshConstraintLabel, ENF_MESH_CONSTRAINT, 0, 1, 1);
+ //anEnfMeshLayout2->addWidget(myEnfMeshConstraint, ENF_MESH_CONSTRAINT, 1, 1, 1);
+ //anEnfMeshLayout2->addWidget(myMeshGroupNameLabel, ENF_MESH_GROUP, 0, 1, 1);
+ //anEnfMeshLayout2->addWidget(myMeshGroupName, ENF_MESH_GROUP, 1, 1, 1);
anEnfMeshLayout2->addWidget(addEnfMeshButton, ENF_MESH_BTN, 0, 1, 1);
anEnfMeshLayout2->addWidget(removeEnfMeshButton, ENF_MESH_BTN, 1, 1, 1);
anEnfMeshLayout2->setRowStretch(ENF_MESH_NB_LINES, 1);
anEnfMeshLayout->addLayout(anEnfMeshLayout2, ENF_MESH_MESH, 1, ENF_MESH_NB_LINES, 1);
anEnfMeshLayout->setRowStretch(ENF_MESH_MESH, 10);
+
// add tabs
tab->insertTab( STD_TAB, myStdGroup, tr( "SMESH_ARGUMENTS" ) );
tab->insertTab( ADV_TAB, myAdvGroup, tr( "HYBRID_ADV_ARGS" ) );
- tab->insertTab( ENF_VER_TAB, myEnfGroup, tr( "HYBRID_ENFORCED_VERTICES" ) );
+ //TODO remove or er usmay be lateful to select layers...
+ //tab->insertTab( ENF_VER_TAB, myEnfGroup, tr( "HYBRID_ENFORCED_VERTICES" ) );
tab->insertTab( ENF_MESH_TAB, myEnfMeshGroup, tr( "HYBRID_ENFORCED_MESHES" ) );
tab->setCurrentIndex( STD_TAB );
tabRef[GmfTriangles] = 3; // for enforced faces
tabRef[GmfQuadrilaterals] = 4;
tabRef[GmfTetrahedra] = 4; // for new tetras
+ tabRef[GmfPrisms] = 6; // for new prisms
tabRef[GmfHexahedra] = 8;
int ver, dim;
#endif
}
}
+ else if (token == GmfPrisms && nbElem > 0) {
+ (nbElem <= 1) ? tmpStr = " Prism" : tmpStr = " Prisms";
+ for ( int iElem = 0; iElem < nbElem; iElem++ )
+ GmfGetLin(InpMsh, token, &id[iElem*tabRef[token]], &id[iElem*tabRef[token]+1], &id[iElem*tabRef[token]+2], &id[iElem*tabRef[token]+3],
+ &id[iElem*tabRef[token]+4], &id[iElem*tabRef[token]+5], &domainID[iElem]);
+ }
else if (token == GmfHexahedra && nbElem > 0) {
(nbElem <= 1) ? tmpStr = " Hexahedron" : tmpStr = " Hexahedra";
for ( int iElem = 0; iElem < nbElem; iElem++ )
case GmfTriangles:
case GmfQuadrilaterals:
case GmfTetrahedra:
+ case GmfPrisms:
case GmfHexahedra:
{
std::vector< const SMDS_MeshNode* > node( nbRef );
noID, force3d );
}
break;
+ case GmfPrisms:
+ if ( hasGeom )
+ {
+ solidID = solidIDByDomain[ domainID[iElem]];
+ if ( solidID != HOLE_ID )
+ {
+ aCreatedElem = theHelper->AddVolume( node[0], node[2], node[1],
+ node[3], node[5], node[4],
+ noID, force3d );
+ theMeshDS->SetMeshElementOnShape( aCreatedElem, solidID );
+ for ( int iN = 0; iN < 6; ++iN )
+ if ( node[iN]->getshapeId() < 1 )
+ theMeshDS->SetNodeInVolume( node[iN], solidID );
+ }
+ }
+ else
+ {
+ if ( elemSearcher ) {
+ // Issue 0020682. Avoid creating nodes and tetras at place where
+ // volumic elements already exist
+ if ( !node[1] || !node[0] || !node[2] || !node[3] || !node[4] || !node[5] )
+ continue;
+ if ( elemSearcher->FindElementsByPoint((SMESH_TNodeXYZ(node[0]) +
+ SMESH_TNodeXYZ(node[1]) +
+ SMESH_TNodeXYZ(node[2]) +
+ SMESH_TNodeXYZ(node[3]) +
+ SMESH_TNodeXYZ(node[4]) +
+ SMESH_TNodeXYZ(node[5])) / 6.,
+ SMDSAbs_Volume, foundVolumes ))
+ break;
+ }
+ aCreatedElem = theHelper->AddVolume( node[0], node[2], node[1],
+ node[3], node[5], node[4],
+ noID, force3d );
+ }
+ break;
case GmfHexahedra:
if ( hasGeom )
{
HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertexCoordsValues & theEnforcedVertices)
{
MESSAGE("writeGMFFile w/o geometry");
+ std::cout << "!!!!!!!!!!!writeGMFFile w/o geometry..." << std::endl;
std::string tmpStr;
int idx, idxRequired = 0, idxSol = 0;
+ //tabg each dummyint
const int dummyint = 0;
+ const int dummyint1 = 1;
+ const int dummyint2 = 2;
+ const int dummyint3 = 3;
+ const int dummyint4 = 4;
+ const int dummyint5 = 5;
+ const int dummyint6 = 6; //are interesting for layers
HYBRIDPlugin_Hypothesis::THYBRIDEnforcedVertexCoordsValues::const_iterator vertexIt;
std::vector<double> enfVertexSizes;
const SMDS_MeshElement* elem;
std::cout << "Nb vertices: " << theOrderedNodes.size() << std::endl;
GmfSetKwd(idx, GmfVertices, theOrderedNodes.size()); //theOrderedNodes.size()+solSize)
for (hybridNodeIt = theOrderedNodes.begin();hybridNodeIt != theOrderedNodes.end();++hybridNodeIt) {
- GmfSetLin(idx, GmfVertices, (*hybridNodeIt)->X(), (*hybridNodeIt)->Y(), (*hybridNodeIt)->Z(), dummyint);
+ GmfSetLin(idx, GmfVertices, (*hybridNodeIt)->X(), (*hybridNodeIt)->Y(), (*hybridNodeIt)->Z(), dummyint1);
}
std::cout << "End writting required nodes in GmfVertices" << std::endl;
// int usedEnforcedNodes = 0;
// std::string gn = "";
for (hybridNodeIt = theRequiredNodes.begin();hybridNodeIt != theRequiredNodes.end();++hybridNodeIt) {
- GmfSetLin(idxRequired, GmfVertices, (*hybridNodeIt)->X(), (*hybridNodeIt)->Y(), (*hybridNodeIt)->Z(), dummyint);
+ GmfSetLin(idxRequired, GmfVertices, (*hybridNodeIt)->X(), (*hybridNodeIt)->Y(), (*hybridNodeIt)->Z(), dummyint2);
GmfSetLin(idxSol, GmfSolAtVertices, ValTab);
if (theEnforcedNodes.find((*hybridNodeIt)) != theEnforcedNodes.end())
gn = theEnforcedNodes.find((*hybridNodeIt))->second;
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(idxRequired, GmfVertices, ReqVerTab[i][0], ReqVerTab[i][1], ReqVerTab[i][2], dummyint3);
GmfSetLin(idxSol, GmfSolAtVertices, solTab);
aNodeGroupByHybridId[usedEnforcedNodes] = enfVerticesWithGroup.find(ReqVerTab[i])->second;
#ifdef _DEBUG_
nedge[index] = it->second;
index++;
}
- GmfSetLin(idx, GmfEdges, nedge[0], nedge[1], dummyint);
+ GmfSetLin(idx, GmfEdges, nedge[0], nedge[1], dummyint4);
anEdgeGroupByHybridId[usedEnforcedEdges] = theEnforcedEdges.find(elem)->second;
// GmfSetLin(idxRequired, GmfEdges, nedge[0], nedge[1], dummyint);
usedEnforcedEdges++;
ntri[index] = it->second;
index++;
}
- GmfSetLin(idx, GmfTriangles, ntri[0], ntri[1], ntri[2], dummyint);
+ GmfSetLin(idx, GmfTriangles, ntri[0], ntri[1], ntri[2], dummyint5);
aFaceGroupByHybridId[k] = "";
}
if ( !theHelper.GetMesh()->HasShapeToMesh() )
ntri[index] = it->second;
index++;
}
- GmfSetLin(idx, GmfTriangles, ntri[0], ntri[1], ntri[2], dummyint);
+ GmfSetLin(idx, GmfTriangles, ntri[0], ntri[1], ntri[2], dummyint6);
aFaceGroupByHybridId[k] = theEnforcedTriangles.find(elem)->second;
usedEnforcedTriangles++;
}
TCollection_AsciiString cmd( (char*)HYBRIDPlugin_Hypothesis::CommandToRun( _hyp ).c_str() );
cmd += TCollection_AsciiString(" --in ") + aGMFFileName;
- if ( nbEnforcedVertices + nbEnforcedNodes)
- cmd += TCollection_AsciiString(" --required_vertices ") + aGenericNameRequired;
+ //if ( nbEnforcedVertices + nbEnforcedNodes)
+ // cmd += TCollection_AsciiString(" --required_vertices ") + aGenericNameRequired;
cmd += TCollection_AsciiString(" --out ") + aResultFileName;
if ( !_logInStandardOutput )
cmd += TCollection_AsciiString(" 1>" ) + aLogFileName; // dump into file
std::cout << std::endl;
- std::cout << "Hybrid execution..." << std::endl;
+ std::cout << "Hybrid execution with geometry..." << std::endl;
std::cout << cmd << std::endl;
_compute_canceled = false;
cmd += TCollection_AsciiString(" 1>" ) + aLogFileName; // dump into file
std::cout << std::endl;
- std::cout << "Hybrid execution..." << std::endl;
+ std::cout << "Hybrid execution w/o geometry..." << std::endl;
std::cout << cmd << std::endl;
_compute_canceled = false;