1 // Copyright (C) 2004-2013 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 //=============================================================================
21 // File : GHS3DPlugin_Hypothesis.cxx
22 // Created : Wed Apr 2 12:36:29 2008
23 // Author : Edward AGAPOV (eap)
24 //=============================================================================
26 #include "GHS3DPlugin_Hypothesis.hxx"
27 #include <SMESH_ProxyMesh.hxx>
28 #include <SMESH_Group.hxx>
29 #include <StdMeshers_QuadToTriaAdaptor.hxx>
31 #include <TCollection_AsciiString.hxx>
35 #define getpid _getpid
38 //=======================================================================
39 //function : GHS3DPlugin_Hypothesis
40 //=======================================================================
42 GHS3DPlugin_Hypothesis::GHS3DPlugin_Hypothesis(int hypId, int studyId, SMESH_Gen * gen)
43 : SMESH_Hypothesis(hypId, studyId, gen),
44 myToMeshHoles(DefaultMeshHoles()),
45 myToMakeGroupsOfDomains(DefaultToMakeGroupsOfDomains()),
48 myOptimizationLevel(DefaultOptimizationLevel()),
49 myWorkingDirectory(DefaultWorkingDirectory()),
50 myKeepFiles(DefaultKeepFiles()),
51 myVerboseLevel(DefaultVerboseLevel()),
52 myToCreateNewNodes(DefaultToCreateNewNodes()),
53 myToUseBoundaryRecoveryVersion(DefaultToUseBoundaryRecoveryVersion()),
54 myToUseFemCorrection(DefaultToUseFEMCorrection()),
55 myToRemoveCentralPoint(DefaultToRemoveCentralPoint()),
56 myGradation(DefaultGradation()),
57 myLogInStandardOutput(DefaultStandardOutputLog()),
58 _enfVertexList(DefaultGHS3DEnforcedVertexList()),
59 _enfVertexCoordsSizeList(DefaultGHS3DEnforcedVertexCoordsValues()),
60 _enfVertexEntrySizeList(DefaultGHS3DEnforcedVertexEntryValues()),
61 _coordsEnfVertexMap(DefaultCoordsGHS3DEnforcedVertexMap()),
62 _geomEntryEnfVertexMap(DefaultGeomEntryGHS3DEnforcedVertexMap()),
63 _enfMeshList(DefaultGHS3DEnforcedMeshList()),
64 _entryEnfMeshMap(DefaultEntryGHS3DEnforcedMeshListMap()),
65 _enfNodes(TIDSortedNodeGroupMap()),
66 _enfEdges(TIDSortedElemGroupMap()),
67 _enfTriangles(TIDSortedElemGroupMap()),
68 _nodeIDToSizeMap(DefaultID2SizeMap()),
69 _groupsToRemove(DefaultGroupsToRemove())
71 _name = "GHS3D_Parameters";
75 //=======================================================================
76 //function : SetToMeshHoles
77 //=======================================================================
79 void GHS3DPlugin_Hypothesis::SetToMeshHoles(bool toMesh)
81 if ( myToMeshHoles != toMesh ) {
82 myToMeshHoles = toMesh;
83 NotifySubMeshesHypothesisModification();
87 //=======================================================================
88 //function : GetToMeshHoles
89 //=======================================================================
91 bool GHS3DPlugin_Hypothesis::GetToMeshHoles(bool checkFreeOption) const
93 if (checkFreeOption && !myTextOption.empty()) {
94 if ( myTextOption.find("-c 0"))
96 if ( myTextOption.find("-c 1"))
102 //=======================================================================
103 //function : SetToMakeGroupsOfDomains
104 //=======================================================================
106 void GHS3DPlugin_Hypothesis::SetToMakeGroupsOfDomains(bool toMakeGroups)
108 if ( myToMakeGroupsOfDomains != toMakeGroups ) {
109 myToMakeGroupsOfDomains = toMakeGroups;
110 NotifySubMeshesHypothesisModification();
114 //=======================================================================
115 //function : GetToMakeGroupsOfDomains
116 //=======================================================================
118 bool GHS3DPlugin_Hypothesis::GetToMakeGroupsOfDomains() const
120 return myToMakeGroupsOfDomains;
123 //=======================================================================
124 //function : GetToMakeGroupsOfDomains
125 //=======================================================================
127 bool GHS3DPlugin_Hypothesis::GetToMakeGroupsOfDomains(const GHS3DPlugin_Hypothesis* hyp)
130 if ( hyp ) res = /*hyp->GetToMeshHoles(true) &&*/ hyp->GetToMakeGroupsOfDomains();
131 else res = /*DefaultMeshHoles() &&*/ DefaultToMakeGroupsOfDomains();
135 //=======================================================================
136 //function : SetMaximumMemory
137 //=======================================================================
139 void GHS3DPlugin_Hypothesis::SetMaximumMemory(double MB)
141 if ( myMaximumMemory != MB ) {
142 myMaximumMemory = MB;
143 NotifySubMeshesHypothesisModification();
147 //=======================================================================
148 //function : GetMaximumMemory
149 // * automatic memory adjustment mode. Default is zero
150 //=======================================================================
152 double GHS3DPlugin_Hypothesis::GetMaximumMemory() const
154 return myMaximumMemory;
157 //=======================================================================
158 //function : SetInitialMemory
159 //=======================================================================
161 void GHS3DPlugin_Hypothesis::SetInitialMemory(double MB)
163 if ( myInitialMemory != MB ) {
164 myInitialMemory = MB;
165 NotifySubMeshesHypothesisModification();
169 //=======================================================================
170 //function : GetInitialMemory
171 //=======================================================================
173 double GHS3DPlugin_Hypothesis::GetInitialMemory() const
175 return myInitialMemory;
178 //=======================================================================
179 //function : SetOptimizationLevel
180 //=======================================================================
182 void GHS3DPlugin_Hypothesis::SetOptimizationLevel(OptimizationLevel level)
184 if ( myOptimizationLevel != level ) {
185 myOptimizationLevel = level;
186 NotifySubMeshesHypothesisModification();
190 //=======================================================================
191 //function : GetOptimizationLevel
192 //=======================================================================
194 GHS3DPlugin_Hypothesis::OptimizationLevel GHS3DPlugin_Hypothesis::GetOptimizationLevel() const
196 return (OptimizationLevel) myOptimizationLevel;
199 //=======================================================================
200 //function : SetWorkingDirectory
201 //=======================================================================
203 void GHS3DPlugin_Hypothesis::SetWorkingDirectory(const std::string& path)
205 if ( myWorkingDirectory != path ) {
206 myWorkingDirectory = path;
207 NotifySubMeshesHypothesisModification();
211 //=======================================================================
212 //function : GetWorkingDirectory
213 //=======================================================================
215 std::string GHS3DPlugin_Hypothesis::GetWorkingDirectory() const
217 return myWorkingDirectory;
220 //=======================================================================
221 //function : SetKeepFiles
222 //=======================================================================
224 void GHS3DPlugin_Hypothesis::SetKeepFiles(bool toKeep)
226 if ( myKeepFiles != toKeep ) {
227 myKeepFiles = toKeep;
228 NotifySubMeshesHypothesisModification();
232 //=======================================================================
233 //function : GetKeepFiles
234 //=======================================================================
236 bool GHS3DPlugin_Hypothesis::GetKeepFiles() const
241 //=======================================================================
242 //function : SetVerboseLevel
243 //=======================================================================
245 void GHS3DPlugin_Hypothesis::SetVerboseLevel(short level)
247 if ( myVerboseLevel != level ) {
248 myVerboseLevel = level;
249 NotifySubMeshesHypothesisModification();
253 //=======================================================================
254 //function : GetVerboseLevel
255 //=======================================================================
257 short GHS3DPlugin_Hypothesis::GetVerboseLevel() const
259 return myVerboseLevel;
262 //=======================================================================
263 //function : SetToCreateNewNodes
264 //=======================================================================
266 void GHS3DPlugin_Hypothesis::SetToCreateNewNodes(bool toCreate)
268 if ( myToCreateNewNodes != toCreate ) {
269 myToCreateNewNodes = toCreate;
270 NotifySubMeshesHypothesisModification();
274 //=======================================================================
275 //function : GetToCreateNewNodes
276 //=======================================================================
278 bool GHS3DPlugin_Hypothesis::GetToCreateNewNodes() const
280 return myToCreateNewNodes;
283 //=======================================================================
284 //function : SetToUseBoundaryRecoveryVersion
285 //=======================================================================
287 void GHS3DPlugin_Hypothesis::SetToUseBoundaryRecoveryVersion(bool toUse)
289 if ( myToUseBoundaryRecoveryVersion != toUse ) {
290 myToUseBoundaryRecoveryVersion = toUse;
291 NotifySubMeshesHypothesisModification();
295 //=======================================================================
296 //function : GetToUseBoundaryRecoveryVersion
297 //=======================================================================
299 bool GHS3DPlugin_Hypothesis::GetToUseBoundaryRecoveryVersion() const
301 return myToUseBoundaryRecoveryVersion;
304 //=======================================================================
305 //function : SetFEMCorrection
306 //=======================================================================
308 void GHS3DPlugin_Hypothesis::SetFEMCorrection(bool toUseFem)
310 if ( myToUseFemCorrection != toUseFem ) {
311 myToUseFemCorrection = toUseFem;
312 NotifySubMeshesHypothesisModification();
316 //=======================================================================
317 //function : GetFEMCorrection
318 //=======================================================================
320 bool GHS3DPlugin_Hypothesis::GetFEMCorrection() const
322 return myToUseFemCorrection;
325 //=======================================================================
326 //function : SetToRemoveCentralPoint
327 //=======================================================================
329 void GHS3DPlugin_Hypothesis::SetToRemoveCentralPoint(bool toRemove)
331 if ( myToRemoveCentralPoint != toRemove ) {
332 myToRemoveCentralPoint = toRemove;
333 NotifySubMeshesHypothesisModification();
337 //=======================================================================
338 //function : GetToRemoveCentralPoint
339 //=======================================================================
341 bool GHS3DPlugin_Hypothesis::GetToRemoveCentralPoint() const
343 return myToRemoveCentralPoint;
346 //=======================================================================
347 //function : SetTextOption
348 //=======================================================================
350 void GHS3DPlugin_Hypothesis::SetTextOption(const std::string& option)
352 if ( myTextOption != option ) {
353 myTextOption = option;
354 NotifySubMeshesHypothesisModification();
358 //=======================================================================
359 //function : GetTextOption
360 //=======================================================================
362 std::string GHS3DPlugin_Hypothesis::GetTextOption() const
367 //=======================================================================
368 //function : SetGradation
369 //=======================================================================
371 void GHS3DPlugin_Hypothesis::SetGradation(double gradation)
373 if ( myGradation != gradation ) {
374 myGradation = gradation;
375 NotifySubMeshesHypothesisModification();
379 //=======================================================================
380 //function : GetGradation
381 //=======================================================================
383 double GHS3DPlugin_Hypothesis::GetGradation() const
388 //=======================================================================
389 //function : SetStandardOutputLog
390 //=======================================================================
392 void GHS3DPlugin_Hypothesis::SetStandardOutputLog(bool logInStandardOutput)
394 if ( myLogInStandardOutput != logInStandardOutput ) {
395 myLogInStandardOutput = logInStandardOutput;
396 NotifySubMeshesHypothesisModification();
400 //=======================================================================
401 //function : GetStandardOutputLog
402 //=======================================================================
404 bool GHS3DPlugin_Hypothesis::GetStandardOutputLog() const
406 return myLogInStandardOutput;
409 //=======================================================================
410 //function : SetRemoveLogOnSuccess
411 //=======================================================================
413 void GHS3DPlugin_Hypothesis::SetRemoveLogOnSuccess(bool removeLogOnSuccess)
415 if ( myRemoveLogOnSuccess != removeLogOnSuccess ) {
416 myRemoveLogOnSuccess = removeLogOnSuccess;
417 NotifySubMeshesHypothesisModification();
421 //=======================================================================
422 //function : GetRemoveLogOnSuccess
423 //=======================================================================
425 bool GHS3DPlugin_Hypothesis::GetRemoveLogOnSuccess() const
427 return myRemoveLogOnSuccess;
430 //=======================================================================
431 //function : SetEnforcedVertex
432 //=======================================================================
434 bool GHS3DPlugin_Hypothesis::SetEnforcedVertex(std::string theName, std::string theEntry, std::string theGroupName,
435 double size, double x, double y, double z, bool isCompound)
437 MESSAGE("GHS3DPlugin_Hypothesis::SetEnforcedVertex(\""<< theName << "\", \""<< theEntry << "\", \"" << theGroupName << "\", "
438 << size << ", " << x << ", " << y << ", " << z << ", "<< isCompound << ")");
440 bool toNotify = false;
441 bool toCreate = true;
443 TGHS3DEnforcedVertex *oldEnVertex;
444 TGHS3DEnforcedVertex *newEnfVertex = new TGHS3DEnforcedVertex();
445 newEnfVertex->name = theName;
446 newEnfVertex->geomEntry = theEntry;
447 newEnfVertex->coords.clear();
449 newEnfVertex->coords.push_back(x);
450 newEnfVertex->coords.push_back(y);
451 newEnfVertex->coords.push_back(z);
453 newEnfVertex->groupName = theGroupName;
454 newEnfVertex->size = size;
455 newEnfVertex->isCompound = isCompound;
458 // update _enfVertexList
459 TGHS3DEnforcedVertexList::iterator it = _enfVertexList.find(newEnfVertex);
460 if (it != _enfVertexList.end()) {
463 MESSAGE("Enforced Vertex was found => Update");
464 if (oldEnVertex->name != theName) {
465 MESSAGE("Update name from \"" << oldEnVertex->name << "\" to \"" << theName << "\"");
466 oldEnVertex->name = theName;
469 if (oldEnVertex->groupName != theGroupName) {
470 MESSAGE("Update group name from \"" << oldEnVertex->groupName << "\" to \"" << theGroupName << "\"");
471 oldEnVertex->groupName = theGroupName;
474 if (oldEnVertex->size != size) {
475 MESSAGE("Update size from \"" << oldEnVertex->size << "\" to \"" << size << "\"");
476 oldEnVertex->size = size;
480 // update map coords / enf vertex if needed
481 if (oldEnVertex->coords.size()) {
482 _coordsEnfVertexMap[oldEnVertex->coords] = oldEnVertex;
483 _enfVertexCoordsSizeList[oldEnVertex->coords] = size;
486 // update map geom entry / enf vertex if needed
487 if (oldEnVertex->geomEntry != "") {
488 _geomEntryEnfVertexMap[oldEnVertex->geomEntry] = oldEnVertex;
489 _enfVertexEntrySizeList[oldEnVertex->geomEntry] = size;
494 // //////// CREATE ////////////
497 MESSAGE("Creating new enforced vertex");
498 _enfVertexList.insert(newEnfVertex);
499 if (theEntry == "") {
500 _coordsEnfVertexMap[newEnfVertex->coords] = newEnfVertex;
501 _enfVertexCoordsSizeList[newEnfVertex->coords] = size;
504 _geomEntryEnfVertexMap[newEnfVertex->geomEntry] = newEnfVertex;
505 _enfVertexEntrySizeList[newEnfVertex->geomEntry] = size;
510 NotifySubMeshesHypothesisModification();
512 MESSAGE("GHS3DPlugin_Hypothesis::SetEnforcedVertex END");
517 //=======================================================================
518 //function : SetEnforcedMesh
519 //=======================================================================
520 bool GHS3DPlugin_Hypothesis::SetEnforcedMesh(SMESH_Mesh& theMesh, SMESH::ElementType elementType, std::string name, std::string entry, std::string groupName)
522 TIDSortedElemSet theElemSet;
523 SMDS_ElemIteratorPtr eIt = theMesh.GetMeshDS()->elementsIterator(SMDSAbs_ElementType(elementType));
524 while ( eIt->more() )
525 theElemSet.insert( eIt->next() );
526 MESSAGE("Add "<<theElemSet.size()<<" types["<<elementType<<"] from source mesh");
527 bool added = SetEnforcedElements( theElemSet, elementType, groupName);
529 TGHS3DEnforcedMesh* newEnfMesh = new TGHS3DEnforcedMesh();
530 newEnfMesh->persistID = theMesh.GetMeshDS()->GetPersistentId();
531 newEnfMesh->name = name;
532 newEnfMesh->entry = entry;
533 newEnfMesh->elementType = elementType;
534 newEnfMesh->groupName = groupName;
536 TGHS3DEnforcedMeshList::iterator it = _enfMeshList.find(newEnfMesh);
537 if (it == _enfMeshList.end()) {
538 _entryEnfMeshMap[entry].insert(newEnfMesh);
539 _enfMeshList.insert(newEnfMesh);
548 //=======================================================================
549 //function : SetEnforcedGroup
550 //=======================================================================
551 bool GHS3DPlugin_Hypothesis::SetEnforcedGroup(const SMESHDS_Mesh* theMeshDS, SMESH::long_array_var theIDs, SMESH::ElementType elementType, std::string name, std::string entry, std::string groupName)
553 MESSAGE("GHS3DPlugin_Hypothesis::SetEnforcedGroup");
554 TIDSortedElemSet theElemSet;
555 if ( theIDs->length() == 0 ){MESSAGE("The source group is empty");}
556 for (int i=0; i < theIDs->length(); i++) {
557 CORBA::Long ind = theIDs[i];
558 if (elementType == SMESH::NODE)
560 const SMDS_MeshNode * node = theMeshDS->FindNode(ind);
562 theElemSet.insert( node );
566 const SMDS_MeshElement * elem = theMeshDS->FindElement(ind);
568 theElemSet.insert( elem );
572 // SMDS_ElemIteratorPtr it = theGroup->GetGroupDS()->GetElements();
573 // while ( it->more() )
574 // theElemSet.insert( it->next() );
576 MESSAGE("Add "<<theElemSet.size()<<" types["<<elementType<<"] from source group ");
577 bool added = SetEnforcedElements( theElemSet, elementType, groupName);
579 TGHS3DEnforcedMesh* newEnfMesh = new TGHS3DEnforcedMesh();
580 newEnfMesh->name = name;
581 newEnfMesh->entry = entry;
582 newEnfMesh->elementType = elementType;
583 newEnfMesh->groupName = groupName;
585 TGHS3DEnforcedMeshList::iterator it = _enfMeshList.find(newEnfMesh);
586 if (it == _enfMeshList.end()) {
587 _entryEnfMeshMap[entry].insert(newEnfMesh);
588 _enfMeshList.insert(newEnfMesh);
594 //=======================================================================
595 //function : SetEnforcedElements
596 //=======================================================================
597 bool GHS3DPlugin_Hypothesis::SetEnforcedElements(TIDSortedElemSet theElemSet, SMESH::ElementType elementType, std::string groupName)
599 MESSAGE("GHS3DPlugin_Hypothesis::SetEnforcedElements");
600 TIDSortedElemSet::const_iterator it = theElemSet.begin();
601 const SMDS_MeshElement* elem;
602 const SMDS_MeshNode* node;
604 pair<TIDSortedNodeGroupMap::iterator,bool> nodeRet;
605 pair<TIDSortedElemGroupMap::iterator,bool> elemRet;
607 for (;it != theElemSet.end();++it)
610 switch (elementType) {
612 node = dynamic_cast<const SMDS_MeshNode*>(elem);
614 nodeRet = _enfNodes.insert(make_pair(node,groupName));
615 added = added && nodeRet.second;
616 string msg = added ? "yes":"no";
617 MESSAGE( "Node (" <<node->X()<<","<<node->Y()<<","<<node->Z()<< ") with ID " << node->GetID() <<" added ? " << msg);
620 SMDS_ElemIteratorPtr nodeIt = elem->nodesIterator();
621 for (;nodeIt->more();) {
622 node = dynamic_cast<const SMDS_MeshNode*>(nodeIt->next());
623 nodeRet = _enfNodes.insert(make_pair(node,groupName));
624 added = added && nodeRet.second;
630 if (elem->GetType() == SMDSAbs_Edge) {
631 elemRet = _enfEdges.insert(make_pair(elem,groupName));
632 added = added && elemRet.second;
634 else if (elem->GetType() > SMDSAbs_Edge) {
635 SMDS_ElemIteratorPtr it = elem->edgesIterator();
637 const SMDS_MeshElement* anEdge = it->next();
638 elemRet = _enfEdges.insert(make_pair(anEdge,groupName));
639 added = added && elemRet.second;
644 if (elem->GetType() == SMDSAbs_Face)
646 if (elem->NbCornerNodes() == 3) {
647 elemRet = _enfTriangles.insert(make_pair(elem,groupName));
648 added = added && elemRet.second;
651 else if (elem->GetType() > SMDSAbs_Face) { // Group of faces
652 SMDS_ElemIteratorPtr it = elem->facesIterator();
654 const SMDS_MeshElement* aFace = it->next();
655 if (aFace->NbCornerNodes() == 3) {
656 elemRet = _enfTriangles.insert(make_pair(aFace,groupName));
657 added = added && elemRet.second;
667 NotifySubMeshesHypothesisModification();
672 //=======================================================================
673 //function : GetEnforcedVertex
674 //=======================================================================
676 GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertex* GHS3DPlugin_Hypothesis::GetEnforcedVertex(double x, double y, double z)
677 throw (std::invalid_argument)
679 std::vector<double> coord(3);
683 if (_coordsEnfVertexMap.count(coord)>0)
684 return _coordsEnfVertexMap[coord];
685 std::ostringstream msg ;
686 msg << "No enforced vertex at " << x << ", " << y << ", " << z;
687 throw std::invalid_argument(msg.str());
690 GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertex* GHS3DPlugin_Hypothesis::GetEnforcedVertex(const std::string theEntry)
691 throw (std::invalid_argument)
693 if (_geomEntryEnfVertexMap.count(theEntry)>0)
694 return _geomEntryEnfVertexMap[theEntry];
696 std::ostringstream msg ;
697 msg << "No enforced vertex with entry " << theEntry;
698 throw std::invalid_argument(msg.str());
701 //=======================================================================
702 //function : RemoveEnforcedVertex
703 //=======================================================================
705 bool GHS3DPlugin_Hypothesis::RemoveEnforcedVertex(double x, double y, double z, const std::string theEntry)
706 throw (std::invalid_argument)
708 bool toNotify = false;
709 std::ostringstream msg;
710 TGHS3DEnforcedVertex *oldEnfVertex;
711 std::vector<double> coords(3);
716 // check that enf vertex with given enf vertex entry exists
717 TGeomEntryGHS3DEnforcedVertexMap::iterator it_enfVertexEntry = _geomEntryEnfVertexMap.find(theEntry);
718 if (it_enfVertexEntry != _geomEntryEnfVertexMap.end()) {
720 MESSAGE("Found enforced vertex with geom entry " << theEntry);
721 oldEnfVertex = it_enfVertexEntry->second;
722 _geomEntryEnfVertexMap.erase(it_enfVertexEntry);
725 MESSAGE("Enforced vertex with geom entry " << theEntry << " not found");
726 // check that enf vertex with given coords exists
727 TCoordsGHS3DEnforcedVertexMap::iterator it_coords_enf = _coordsEnfVertexMap.find(coords);
728 if (it_coords_enf != _coordsEnfVertexMap.end()) {
730 MESSAGE("Found enforced vertex with coords " << x << ", " << y << ", " << z);
731 oldEnfVertex = it_coords_enf->second;
732 _coordsEnfVertexMap.erase(it_coords_enf);
733 _enfVertexCoordsSizeList.erase(_enfVertexCoordsSizeList.find(coords));
736 MESSAGE("Enforced vertex with coords " << x << ", " << y << ", " << z << " not found");
737 throw std::invalid_argument(msg.str());
741 MESSAGE("Remove enf vertex from _enfVertexList");
743 // update _enfVertexList
744 TGHS3DEnforcedVertexList::iterator it = _enfVertexList.find(oldEnfVertex);
745 if (it != _enfVertexList.end()) {
746 if ((*it)->groupName != "")
747 _groupsToRemove.insert((*it)->groupName);
748 _enfVertexList.erase(it);
754 NotifySubMeshesHypothesisModification();
759 //=======================================================================
760 //function : ClearEnforcedVertices
761 //=======================================================================
762 void GHS3DPlugin_Hypothesis::ClearEnforcedVertices()
764 TGHS3DEnforcedVertexList::const_iterator it = _enfVertexList.begin();
765 for(;it != _enfVertexList.end();++it) {
766 if ((*it)->groupName != "")
767 _groupsToRemove.insert((*it)->groupName);
769 _enfVertexList.clear();
770 _coordsEnfVertexMap.clear();
771 _geomEntryEnfVertexMap.clear();
772 _enfVertexCoordsSizeList.clear();
773 _enfVertexEntrySizeList.clear();
774 NotifySubMeshesHypothesisModification();
777 //=======================================================================
778 //function : ClearEnforcedMeshes
779 //=======================================================================
780 void GHS3DPlugin_Hypothesis::ClearEnforcedMeshes()
782 TGHS3DEnforcedMeshList::const_iterator it = _enfMeshList.begin();
783 for(;it != _enfMeshList.end();++it) {
784 if ((*it)->groupName != "")
785 _groupsToRemove.insert((*it)->groupName);
789 _enfTriangles.clear();
790 _nodeIDToSizeMap.clear();
791 _enfMeshList.clear();
792 _entryEnfMeshMap.clear();
793 NotifySubMeshesHypothesisModification();
796 //================================================================================
798 * \brief At mesh loading, restore enforced elements by just loaded enforced meshes
800 //================================================================================
802 void GHS3DPlugin_Hypothesis::RestoreEnfElemsByMeshes()
804 TGHS3DEnforcedMeshList::const_iterator it = _enfMeshList.begin();
805 for(;it != _enfMeshList.end();++it) {
806 TGHS3DEnforcedMesh* enfMesh = *it;
807 if ( SMESH_Mesh* mesh = GetMeshByPersistentID( enfMesh->persistID ))
808 SetEnforcedMesh( *mesh,
809 enfMesh->elementType,
812 enfMesh->groupName );
813 enfMesh->persistID = -1; // not to restore again
817 //=======================================================================
818 //function : SetGroupsToRemove
819 //=======================================================================
821 void GHS3DPlugin_Hypothesis::ClearGroupsToRemove()
823 _groupsToRemove.clear();
827 //=======================================================================
828 //function : DefaultMeshHoles
829 //=======================================================================
831 bool GHS3DPlugin_Hypothesis::DefaultMeshHoles()
833 return false; // PAL19680
836 //=======================================================================
837 //function : DefaultToMakeGroupsOfDomains
838 //=======================================================================
840 bool GHS3DPlugin_Hypothesis::DefaultToMakeGroupsOfDomains()
842 return false; // issue 0022172
845 //=======================================================================
846 //function : DefaultMaximumMemory
847 //=======================================================================
850 #include <sys/sysinfo.h>
855 double GHS3DPlugin_Hypothesis::DefaultMaximumMemory()
859 int err = sysinfo( &si );
861 int ramMB = si.totalram * si.mem_unit / 1024 / 1024;
862 return ( 0.7 * ramMB );
865 // See http://msdn.microsoft.com/en-us/library/aa366589.aspx
866 MEMORYSTATUSEX statex;
867 statex.dwLength = sizeof (statex);
868 int err = GlobalMemoryStatusEx (&statex);
871 statex.ullTotalPhys / 1024 / 1024 +
872 statex.ullTotalPageFile / 1024 / 1024 +
873 statex.ullTotalVirtual / 1024 / 1024;
874 return ( 0.7 * totMB );
880 //=======================================================================
881 //function : DefaultInitialMemory
882 //=======================================================================
884 double GHS3DPlugin_Hypothesis::DefaultInitialMemory()
886 return DefaultMaximumMemory();
889 //=======================================================================
890 //function : DefaultOptimizationLevel
891 //=======================================================================
893 short GHS3DPlugin_Hypothesis::DefaultOptimizationLevel()
898 //=======================================================================
899 //function : DefaultWorkingDirectory
900 //=======================================================================
902 std::string GHS3DPlugin_Hypothesis::DefaultWorkingDirectory()
904 TCollection_AsciiString aTmpDir;
906 char *Tmp_dir = getenv("SALOME_TMP_DIR");
907 if(Tmp_dir != NULL) {
912 aTmpDir = TCollection_AsciiString("C:\\");
914 aTmpDir = TCollection_AsciiString("/tmp/");
917 return aTmpDir.ToCString();
920 //=======================================================================
921 //function : DefaultKeepFiles
922 //=======================================================================
924 bool GHS3DPlugin_Hypothesis::DefaultKeepFiles()
929 //=======================================================================
930 //function : DefaultRemoveLogOnSuccess
931 //=======================================================================
933 bool GHS3DPlugin_Hypothesis::DefaultRemoveLogOnSuccess()
939 //=======================================================================
940 //function : DefaultVerboseLevel
941 //=======================================================================
943 short GHS3DPlugin_Hypothesis::DefaultVerboseLevel()
948 //=======================================================================
949 //function : DefaultToCreateNewNodes
950 //=======================================================================
952 bool GHS3DPlugin_Hypothesis::DefaultToCreateNewNodes()
957 //=======================================================================
958 //function : DefaultToUseBoundaryRecoveryVersion
959 //=======================================================================
961 bool GHS3DPlugin_Hypothesis::DefaultToUseBoundaryRecoveryVersion()
966 //=======================================================================
967 //function : DefaultToUseFEMCorrection
968 //=======================================================================
970 bool GHS3DPlugin_Hypothesis::DefaultToUseFEMCorrection()
975 //=======================================================================
976 //function : DefaultToRemoveCentralPoint
977 //=======================================================================
979 bool GHS3DPlugin_Hypothesis::DefaultToRemoveCentralPoint()
984 //=======================================================================
985 //function : DefaultGradation
986 //=======================================================================
988 double GHS3DPlugin_Hypothesis::DefaultGradation()
993 //=======================================================================
994 //function : DefaultStandardOutputLog
995 //=======================================================================
997 bool GHS3DPlugin_Hypothesis::DefaultStandardOutputLog()
1002 // //=======================================================================
1003 // //function : DefaultID2SizeMap
1004 // //=======================================================================
1006 // GHS3DPlugin_Hypothesis::TID2SizeMap GHS3DPlugin_Hypothesis::DefaultID2SizeMap()
1008 // return GHS3DPlugin_Hypothesis::TID2SizeMap();
1012 //=======================================================================
1014 //=======================================================================
1016 std::ostream & GHS3DPlugin_Hypothesis::SaveTo(std::ostream & save)
1018 save << (int) myToMeshHoles << " ";
1019 save << myMaximumMemory << " ";
1020 save << myInitialMemory << " ";
1021 save << myOptimizationLevel << " ";
1022 save << myWorkingDirectory << " ";
1023 save << (int)myKeepFiles << " ";
1024 save << myVerboseLevel << " ";
1025 save << (int)myToCreateNewNodes << " ";
1026 save << (int)myToUseBoundaryRecoveryVersion << " ";
1027 save << (int)myToUseFemCorrection << " ";
1028 save << (int)myToRemoveCentralPoint << " ";
1029 save << myGradation << " ";
1030 save << myToMakeGroupsOfDomains << " ";
1031 if (!myTextOption.empty()) {
1032 save << "__OPTIONS_BEGIN__ ";
1033 save << myTextOption << " ";
1034 save << "__OPTIONS_END__ ";
1038 TGHS3DEnforcedVertexList::iterator it = _enfVertexList.begin();
1039 if (it != _enfVertexList.end()) {
1040 save << " " << "__ENFORCED_VERTICES_BEGIN__ ";
1041 for ( ; it != _enfVertexList.end(); ++it ) {
1042 TGHS3DEnforcedVertex *enfVertex = (*it);
1043 save << " " << "__BEGIN_VERTEX__";
1044 if (!enfVertex->name.empty()) {
1045 save << " " << "__BEGIN_NAME__";
1046 save << " " << enfVertex->name;
1047 save << " " << "__END_NAME__";
1049 if (!enfVertex->geomEntry.empty()) {
1050 save << " " << "__BEGIN_ENTRY__";
1051 save << " " << enfVertex->geomEntry;
1052 save << " " << enfVertex->isCompound;
1053 save << " " << "__END_ENTRY__";
1055 if (!enfVertex->groupName.empty()) {
1056 save << " " << "__BEGIN_GROUP__";
1057 save << " " << enfVertex->groupName;
1058 save << " " << "__END_GROUP__";
1060 if (enfVertex->coords.size()) {
1061 save << " " << "__BEGIN_COORDS__";
1062 for (int i=0;i<enfVertex->coords.size();i++)
1063 save << " " << enfVertex->coords[i];
1064 save << " " << "__END_COORDS__";
1066 save << " " << "__BEGIN_SIZE__";
1067 save << " " << enfVertex->size;
1068 save << " " << "__END_SIZE__";
1069 save << " " << "__END_VERTEX__";
1071 save << " " << "__ENFORCED_VERTICES_END__ ";
1074 TGHS3DEnforcedMeshList::iterator it_mesh = _enfMeshList.begin();
1075 if (it_mesh != _enfMeshList.end()) {
1076 save << " " << "__ENFORCED_MESHES_BEGIN__ ";
1077 for ( ; it_mesh != _enfMeshList.end(); ++it_mesh ) {
1078 TGHS3DEnforcedMesh *enfMesh = (*it_mesh);
1079 save << " " << "__BEGIN_ENF_MESH__";
1081 save << " " << "__BEGIN_NAME__";
1082 save << " " << enfMesh->name;
1083 save << " " << "__END_NAME__";
1085 save << " " << "__BEGIN_ENTRY__";
1086 save << " " << enfMesh->entry;
1087 save << " " << "__END_ENTRY__";
1089 save << " " << "__BEGIN_ELEM_TYPE__";
1090 save << " " << (int)enfMesh->elementType;
1091 save << " " << "__END_ELEM_TYPE__";
1093 if (!enfMesh->groupName.empty()) {
1094 save << " " << "__BEGIN_GROUP__";
1095 save << " " << enfMesh->groupName;
1096 save << " " << "__END_GROUP__";
1098 save << " " << "__PERSIST_ID__";
1099 save << " " << enfMesh->persistID;
1100 save << " " << "__END_ENF_MESH__";
1101 std::cout << "Saving of enforced mesh " << enfMesh->name.c_str() << " done" << std::endl;
1103 save << " " << "__ENFORCED_MESHES_END__ ";
1108 //=======================================================================
1109 //function : LoadFrom
1110 //=======================================================================
1112 std::istream & GHS3DPlugin_Hypothesis::LoadFrom(std::istream & load)
1122 load.clear(ios::badbit | load.rdstate());
1126 myMaximumMemory = d;
1128 load.clear(ios::badbit | load.rdstate());
1132 myInitialMemory = d;
1134 load.clear(ios::badbit | load.rdstate());
1138 myOptimizationLevel = i;
1140 load.clear(ios::badbit | load.rdstate());
1142 isOK = (load >> myWorkingDirectory);
1144 if ( myWorkingDirectory == "0") { // myWorkingDirectory was empty
1145 myKeepFiles = false;
1146 myWorkingDirectory.clear();
1148 else if ( myWorkingDirectory == "1" ) {
1150 myWorkingDirectory.clear();
1154 load.clear(ios::badbit | load.rdstate());
1156 if ( !myWorkingDirectory.empty() ) {
1161 load.clear(ios::badbit | load.rdstate());
1166 myVerboseLevel = (short) i;
1168 load.clear(ios::badbit | load.rdstate());
1172 myToCreateNewNodes = (bool) i;
1174 load.clear(ios::badbit | load.rdstate());
1178 myToUseBoundaryRecoveryVersion = (bool) i;
1180 load.clear(ios::badbit | load.rdstate());
1184 myToUseFemCorrection = (bool) i;
1186 load.clear(ios::badbit | load.rdstate());
1190 myToRemoveCentralPoint = (bool) i;
1192 load.clear(ios::badbit | load.rdstate());
1198 load.clear(ios::badbit | load.rdstate());
1200 std::string separator;
1201 bool hasOptions = false;
1202 bool hasEnforcedVertices = false;
1203 bool hasEnforcedMeshes = false;
1204 isOK = (load >> separator);
1206 if ( isOK && ( separator == "0" || separator == "1" ))
1208 myToMakeGroupsOfDomains = ( separator == "1" );
1209 isOK = (load >> separator);
1213 if (separator == "__OPTIONS_BEGIN__")
1215 else if (separator == "__ENFORCED_VERTICES_BEGIN__")
1216 hasEnforcedVertices = true;
1217 else if (separator == "__ENFORCED_MESHES_BEGIN__")
1218 hasEnforcedMeshes = true;
1224 isOK = (load >> txt);
1226 if (txt == "__OPTIONS_END__") {
1227 if (!myTextOption.empty()) {
1228 // Remove last space
1229 myTextOption.erase(myTextOption.end()-1);
1234 myTextOption += txt;
1235 myTextOption += " ";
1241 isOK = (load >> separator);
1242 if (isOK && separator == "__ENFORCED_VERTICES_BEGIN__")
1243 hasEnforcedVertices = true;
1244 if (isOK && separator == "__ENFORCED_MESHES_BEGIN__")
1245 hasEnforcedMeshes = true;
1248 if (hasEnforcedVertices) {
1249 std::string txt, name, entry, groupName;
1250 double size, coords[3];
1252 bool hasCoords = false;
1253 isOK = (load >> txt); // __BEGIN_VERTEX__
1255 if (txt == "__ENFORCED_VERTICES_END__")
1258 TGHS3DEnforcedVertex *enfVertex = new TGHS3DEnforcedVertex();
1260 isOK = (load >> txt);
1261 if (txt == "__END_VERTEX__") {
1262 enfVertex->name = name;
1263 enfVertex->geomEntry = entry;
1264 enfVertex->isCompound = isCompound;
1265 enfVertex->groupName = groupName;
1266 enfVertex->coords.clear();
1268 enfVertex->coords.assign(coords,coords+3);
1270 _enfVertexList.insert(enfVertex);
1272 if (enfVertex->coords.size())
1273 _coordsEnfVertexMap[enfVertex->coords] = enfVertex;
1274 if (!enfVertex->geomEntry.empty())
1275 _geomEntryEnfVertexMap[enfVertex->geomEntry] = enfVertex;
1284 if (txt == "__BEGIN_NAME__") { // __BEGIN_NAME__
1285 while (isOK && (txt != "__END_NAME__")) {
1286 isOK = (load >> txt);
1287 if (txt != "__END_NAME__") {
1293 MESSAGE("name: " <<name);
1296 if (txt == "__BEGIN_ENTRY__") { // __BEGIN_ENTRY__
1297 isOK = (load >> entry);
1298 isOK = (load >> isCompound);
1299 isOK = (load >> txt); // __END_ENTRY__
1300 if (txt != "__END_ENTRY__")
1301 throw std::exception();
1302 MESSAGE("entry: " << entry);
1305 if (txt == "__BEGIN_GROUP__") { // __BEGIN_GROUP__
1306 while (isOK && (txt != "__END_GROUP__")) {
1307 isOK = (load >> txt);
1308 if (txt != "__END_GROUP__") {
1309 if (!groupName.empty())
1314 MESSAGE("groupName: " << groupName);
1317 if (txt == "__BEGIN_COORDS__") { // __BEGIN_COORDS__
1319 isOK = (load >> coords[0] >> coords[1] >> coords[2]);
1320 isOK = (load >> txt); // __END_COORDS__
1321 if (txt != "__END_COORDS__")
1322 throw std::exception();
1323 MESSAGE("coords: " << coords[0] <<","<< coords[1] <<","<< coords[2]);
1326 if (txt == "__BEGIN_SIZE__") { // __BEGIN_ENTRY__
1327 isOK = (load >> size);
1328 isOK = (load >> txt); // __END_ENTRY__
1329 if (txt != "__END_SIZE__") {
1330 throw std::exception();
1332 MESSAGE("size: " << size);
1335 isOK = (load >> txt); // __BEGIN_VERTEX__
1339 if (hasEnforcedVertices) {
1340 isOK = (load >> separator);
1341 if (isOK && separator == "__ENFORCED_MESHES_BEGIN__")
1342 hasEnforcedMeshes = true;
1345 if (hasEnforcedMeshes) {
1346 std::string txt, name, entry, groupName;
1347 int elementType = -1, persistID = -1;
1348 isOK = (load >> txt); // __BEGIN_ENF_MESH__
1351 if (txt == "__ENFORCED_MESHES_END__")
1354 TGHS3DEnforcedMesh *enfMesh = new TGHS3DEnforcedMesh();
1356 isOK = (load >> txt);
1357 if (txt == "__END_ENF_MESH__") {
1358 enfMesh->name = name;
1359 enfMesh->entry = entry;
1360 enfMesh->elementType = (SMESH::ElementType)elementType;
1361 enfMesh->groupName = groupName;
1362 enfMesh->persistID = persistID;
1364 _enfMeshList.insert(enfMesh);
1365 std::cout << "Restoring of enforced mesh " <<name << " done" << std::endl;
1375 if (txt == "__BEGIN_NAME__") { // __BEGIN_NAME__
1376 while (isOK && (txt != "__END_NAME__")) {
1377 isOK = (load >> txt);
1378 if (txt != "__END_NAME__") {
1384 MESSAGE("name: " <<name);
1387 if (txt == "__BEGIN_ENTRY__") { // __BEGIN_ENTRY__
1388 isOK = (load >> entry);
1389 isOK = (load >> txt); // __END_ENTRY__
1390 if (txt != "__END_ENTRY__")
1391 throw std::exception();
1392 MESSAGE("entry: " << entry);
1395 if (txt == "__BEGIN_ELEM_TYPE__") { // __BEGIN_ELEM_TYPE__
1396 isOK = (load >> elementType);
1397 isOK = (load >> txt); // __END_ELEM_TYPE__
1398 if (txt != "__END_ELEM_TYPE__")
1399 throw std::exception();
1400 MESSAGE("elementType: " << elementType);
1403 if (txt == "__BEGIN_GROUP__") { // __BEGIN_GROUP__
1404 while (isOK && (txt != "__END_GROUP__")) {
1405 isOK = (load >> txt);
1406 if (txt != "__END_GROUP__") {
1407 if (!groupName.empty())
1412 MESSAGE("groupName: " << groupName);
1415 if (txt == "__PERSIST_ID__") {
1416 isOK = (load >> persistID);
1417 MESSAGE("persistID: " << persistID);
1419 std::cout << "isOK: " << isOK << std::endl;
1422 isOK = (load >> txt); // __BEGIN_ENF_MESH__
1429 //=======================================================================
1430 //function : SetParametersByMesh
1431 //=======================================================================
1433 bool GHS3DPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh* ,const TopoDS_Shape&)
1439 //================================================================================
1441 * \brief Sets myToMakeGroupsOfDomains depending on whether theMesh is on shape or not
1443 //================================================================================
1445 bool GHS3DPlugin_Hypothesis::SetParametersByDefaults(const TDefaults& dflts,
1446 const SMESH_Mesh* /*theMesh*/)
1448 myToMakeGroupsOfDomains = ( !dflts._shape || dflts._shape->IsNull() );
1452 //================================================================================
1454 * \brief Return command to run ghs3d mesher excluding file prefix (-f)
1456 //================================================================================
1458 std::string GHS3DPlugin_Hypothesis::CommandToRun(const GHS3DPlugin_Hypothesis* hyp,
1459 const bool hasShapeToMesh)
1461 TCollection_AsciiString cmd = GetExeName().c_str();
1462 // check if any option is overridden by hyp->myTextOption
1463 bool m = hyp ? ( hyp->myTextOption.find("-m") == std::string::npos ) : true;
1464 bool M = hyp ? ( hyp->myTextOption.find("-M") == std::string::npos ) : true;
1465 bool c = hyp ? ( hyp->myTextOption.find("-c") == std::string::npos ) : true;
1466 bool o = hyp ? ( hyp->myTextOption.find("-o") == std::string::npos ) : true;
1467 bool p0 = hyp ? ( hyp->myTextOption.find("-p0") == std::string::npos ) : true;
1468 bool C = hyp ? ( hyp->myTextOption.find("-C") == std::string::npos ) : true;
1469 bool v = hyp ? ( hyp->myTextOption.find("-v") == std::string::npos ) : true;
1470 bool fem = hyp ? ( hyp->myTextOption.find("-FEM")== std::string::npos ) : true;
1471 bool rem = hyp ? ( hyp->myTextOption.find("-no_initial_central_point")== std::string::npos ) : true;
1472 bool gra = hyp ? ( hyp->myTextOption.find("-Dcpropa")== std::string::npos ) : true;
1474 // if use boundary recovery version, few options are allowed
1475 bool useBndRecovery = !C;
1476 if ( !useBndRecovery && hyp )
1477 useBndRecovery = hyp->myToUseBoundaryRecoveryVersion;
1479 // ghs3d needs to know amount of memory it may use (MB).
1480 // Default memory is defined at ghs3d installation but it may be not enough,
1481 // so allow to use about all available memory
1483 double aMaximumMemory = hyp ? hyp->myMaximumMemory : -1;
1485 if ( aMaximumMemory < 0 )
1486 cmd += DefaultMaximumMemory();
1488 cmd += aMaximumMemory;
1490 if ( M && !useBndRecovery ) {
1491 double aInitialMemory = hyp ? hyp->myInitialMemory : -1;
1493 if ( aInitialMemory > 0 )
1494 cmd += aInitialMemory;
1498 // component to mesh
1499 // 0 , all components to be meshed
1500 // 1 , only the main ( outermost ) component to be meshed
1501 if ( c && !useBndRecovery ) {
1502 // We always run GHS3D with "to mesh holes'==TRUE (see PAL19680)
1503 if ( hasShapeToMesh )
1506 bool aToMeshHoles = hyp ? hyp->myToMeshHoles : DefaultMeshHoles();
1514 // optimization level
1515 if ( o && hyp && !useBndRecovery ) {
1516 if ( hyp->myOptimizationLevel >= 0 && hyp->myOptimizationLevel < 5 ) {
1517 const char* level[] = { "none" , "light" , "standard" , "standard+" , "strong" };
1519 cmd += level[ hyp->myOptimizationLevel ];
1523 // to create internal nodes
1524 if ( p0 && hyp && !hyp->myToCreateNewNodes ) {
1531 cmd += hyp->myVerboseLevel;
1534 // boundary recovery version
1535 if ( useBndRecovery ) {
1539 // to use FEM correction
1540 if ( fem && hyp && hyp->myToUseFemCorrection) {
1544 // to remove initial central point.
1545 if ( rem && hyp && hyp->myToRemoveCentralPoint) {
1546 cmd += " -no_initial_central_point";
1550 if ( hyp && !hyp->myTextOption.empty() ) {
1552 cmd += (char*) hyp->myTextOption.c_str();
1555 // to define volumic gradation.
1557 cmd += " -Dcpropa=";
1558 cmd += hyp->myGradation;
1565 return cmd.ToCString();
1568 //================================================================================
1570 * \brief Return a unique file name
1572 //================================================================================
1574 std::string GHS3DPlugin_Hypothesis::GetFileName(const GHS3DPlugin_Hypothesis* hyp)
1576 std::string aTmpDir = hyp ? hyp->GetWorkingDirectory() : DefaultWorkingDirectory();
1577 const char lastChar = *aTmpDir.rbegin();
1579 if(lastChar != '\\') aTmpDir+='\\';
1581 if(lastChar != '/') aTmpDir+='/';
1584 TCollection_AsciiString aGenericName = (char*)aTmpDir.c_str();
1585 aGenericName += "GHS3D_";
1586 aGenericName += getpid();
1587 aGenericName += "_";
1588 aGenericName += Abs((Standard_Integer)(long) aGenericName.ToCString());
1590 return aGenericName.ToCString();
1593 //================================================================================
1595 * Return the name of executable
1597 //================================================================================
1599 std::string GHS3DPlugin_Hypothesis::GetExeName()
1601 return "mg-tetra.exe";
1604 //================================================================================
1606 * \brief Return the enforced vertices
1608 //================================================================================
1610 GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertexList GHS3DPlugin_Hypothesis::GetEnforcedVertices(const GHS3DPlugin_Hypothesis* hyp)
1612 return hyp ? hyp->_GetEnforcedVertices():DefaultGHS3DEnforcedVertexList();
1615 GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertexCoordsValues GHS3DPlugin_Hypothesis::GetEnforcedVerticesCoordsSize (const GHS3DPlugin_Hypothesis* hyp)
1617 return hyp ? hyp->_GetEnforcedVerticesCoordsSize(): DefaultGHS3DEnforcedVertexCoordsValues();
1620 GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertexEntryValues GHS3DPlugin_Hypothesis::GetEnforcedVerticesEntrySize (const GHS3DPlugin_Hypothesis* hyp)
1622 return hyp ? hyp->_GetEnforcedVerticesEntrySize(): DefaultGHS3DEnforcedVertexEntryValues();
1625 GHS3DPlugin_Hypothesis::TCoordsGHS3DEnforcedVertexMap GHS3DPlugin_Hypothesis::GetEnforcedVerticesByCoords (const GHS3DPlugin_Hypothesis* hyp)
1627 return hyp ? hyp->_GetEnforcedVerticesByCoords(): DefaultCoordsGHS3DEnforcedVertexMap();
1630 GHS3DPlugin_Hypothesis::TGeomEntryGHS3DEnforcedVertexMap GHS3DPlugin_Hypothesis::GetEnforcedVerticesByEntry (const GHS3DPlugin_Hypothesis* hyp)
1632 return hyp ? hyp->_GetEnforcedVerticesByEntry(): DefaultGeomEntryGHS3DEnforcedVertexMap();
1635 GHS3DPlugin_Hypothesis::TIDSortedNodeGroupMap GHS3DPlugin_Hypothesis::GetEnforcedNodes(const GHS3DPlugin_Hypothesis* hyp)
1637 return hyp ? hyp->_GetEnforcedNodes():DefaultIDSortedNodeGroupMap();
1640 GHS3DPlugin_Hypothesis::TIDSortedElemGroupMap GHS3DPlugin_Hypothesis::GetEnforcedEdges(const GHS3DPlugin_Hypothesis* hyp)
1642 return hyp ? hyp->_GetEnforcedEdges():DefaultIDSortedElemGroupMap();
1645 GHS3DPlugin_Hypothesis::TIDSortedElemGroupMap GHS3DPlugin_Hypothesis::GetEnforcedTriangles(const GHS3DPlugin_Hypothesis* hyp)
1647 return hyp ? hyp->_GetEnforcedTriangles():DefaultIDSortedElemGroupMap();
1650 GHS3DPlugin_Hypothesis::TID2SizeMap GHS3DPlugin_Hypothesis::GetNodeIDToSizeMap(const GHS3DPlugin_Hypothesis* hyp)
1652 return hyp ? hyp->_GetNodeIDToSizeMap(): DefaultID2SizeMap();
1655 GHS3DPlugin_Hypothesis::TSetStrings GHS3DPlugin_Hypothesis::GetGroupsToRemove(const GHS3DPlugin_Hypothesis* hyp)
1657 return hyp ? hyp->_GetGroupsToRemove(): DefaultGroupsToRemove();