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 _enfVertexList(DefaultGHS3DEnforcedVertexList()),
58 _enfVertexCoordsSizeList(DefaultGHS3DEnforcedVertexCoordsValues()),
59 _enfVertexEntrySizeList(DefaultGHS3DEnforcedVertexEntryValues()),
60 _coordsEnfVertexMap(DefaultCoordsGHS3DEnforcedVertexMap()),
61 _geomEntryEnfVertexMap(DefaultGeomEntryGHS3DEnforcedVertexMap()),
62 _enfMeshList(DefaultGHS3DEnforcedMeshList()),
63 _entryEnfMeshMap(DefaultEntryGHS3DEnforcedMeshListMap()),
64 _enfNodes(TIDSortedNodeGroupMap()),
65 _enfEdges(TIDSortedElemGroupMap()),
66 _enfTriangles(TIDSortedElemGroupMap()),
67 _nodeIDToSizeMap(DefaultID2SizeMap()),
68 _groupsToRemove(DefaultGroupsToRemove())
70 _name = "GHS3D_Parameters";
74 //=======================================================================
75 //function : SetToMeshHoles
76 //=======================================================================
78 void GHS3DPlugin_Hypothesis::SetToMeshHoles(bool toMesh)
80 if ( myToMeshHoles != toMesh ) {
81 myToMeshHoles = toMesh;
82 NotifySubMeshesHypothesisModification();
86 //=======================================================================
87 //function : GetToMeshHoles
88 //=======================================================================
90 bool GHS3DPlugin_Hypothesis::GetToMeshHoles(bool checkFreeOption) const
92 if (checkFreeOption && !myTextOption.empty()) {
93 if ( myTextOption.find("-c 0"))
95 if ( myTextOption.find("-c 1"))
101 //=======================================================================
102 //function : SetToMakeGroupsOfDomains
103 //=======================================================================
105 void GHS3DPlugin_Hypothesis::SetToMakeGroupsOfDomains(bool toMakeGroups)
107 if ( myToMakeGroupsOfDomains != toMakeGroups ) {
108 myToMakeGroupsOfDomains = toMakeGroups;
109 NotifySubMeshesHypothesisModification();
113 //=======================================================================
114 //function : GetToMakeGroupsOfDomains
115 //=======================================================================
117 bool GHS3DPlugin_Hypothesis::GetToMakeGroupsOfDomains() const
119 return myToMakeGroupsOfDomains;
122 //=======================================================================
123 //function : GetToMakeGroupsOfDomains
124 //=======================================================================
126 bool GHS3DPlugin_Hypothesis::GetToMakeGroupsOfDomains(const GHS3DPlugin_Hypothesis* hyp)
129 if ( hyp ) res = /*hyp->GetToMeshHoles(true) &&*/ hyp->GetToMakeGroupsOfDomains();
130 else res = /*DefaultMeshHoles() &&*/ DefaultToMakeGroupsOfDomains();
134 //=======================================================================
135 //function : SetMaximumMemory
136 //=======================================================================
138 void GHS3DPlugin_Hypothesis::SetMaximumMemory(short MB)
140 if ( myMaximumMemory != MB ) {
141 myMaximumMemory = MB;
142 NotifySubMeshesHypothesisModification();
146 //=======================================================================
147 //function : GetMaximumMemory
148 // * automatic memory adjustment mode. Default is zero
149 //=======================================================================
151 short GHS3DPlugin_Hypothesis::GetMaximumMemory() const
153 return myMaximumMemory;
156 //=======================================================================
157 //function : SetInitialMemory
158 //=======================================================================
160 void GHS3DPlugin_Hypothesis::SetInitialMemory(short MB)
162 if ( myInitialMemory != MB ) {
163 myInitialMemory = MB;
164 NotifySubMeshesHypothesisModification();
168 //=======================================================================
169 //function : GetInitialMemory
170 //=======================================================================
172 short GHS3DPlugin_Hypothesis::GetInitialMemory() const
174 return myInitialMemory;
177 //=======================================================================
178 //function : SetOptimizationLevel
179 //=======================================================================
181 void GHS3DPlugin_Hypothesis::SetOptimizationLevel(OptimizationLevel level)
183 if ( myOptimizationLevel != level ) {
184 myOptimizationLevel = level;
185 NotifySubMeshesHypothesisModification();
189 //=======================================================================
190 //function : GetOptimizationLevel
191 //=======================================================================
193 GHS3DPlugin_Hypothesis::OptimizationLevel GHS3DPlugin_Hypothesis::GetOptimizationLevel() const
195 return (OptimizationLevel) myOptimizationLevel;
198 //=======================================================================
199 //function : SetWorkingDirectory
200 //=======================================================================
202 void GHS3DPlugin_Hypothesis::SetWorkingDirectory(const std::string& path)
204 if ( myWorkingDirectory != path ) {
205 myWorkingDirectory = path;
206 NotifySubMeshesHypothesisModification();
210 //=======================================================================
211 //function : GetWorkingDirectory
212 //=======================================================================
214 std::string GHS3DPlugin_Hypothesis::GetWorkingDirectory() const
216 return myWorkingDirectory;
219 //=======================================================================
220 //function : SetKeepFiles
221 //=======================================================================
223 void GHS3DPlugin_Hypothesis::SetKeepFiles(bool toKeep)
225 if ( myKeepFiles != toKeep ) {
226 myKeepFiles = toKeep;
227 NotifySubMeshesHypothesisModification();
231 //=======================================================================
232 //function : GetKeepFiles
233 //=======================================================================
235 bool GHS3DPlugin_Hypothesis::GetKeepFiles() const
240 //=======================================================================
241 //function : SetVerboseLevel
242 //=======================================================================
244 void GHS3DPlugin_Hypothesis::SetVerboseLevel(short level)
246 if ( myVerboseLevel != level ) {
247 myVerboseLevel = level;
248 NotifySubMeshesHypothesisModification();
252 //=======================================================================
253 //function : GetVerboseLevel
254 //=======================================================================
256 short GHS3DPlugin_Hypothesis::GetVerboseLevel() const
258 return myVerboseLevel;
261 //=======================================================================
262 //function : SetToCreateNewNodes
263 //=======================================================================
265 void GHS3DPlugin_Hypothesis::SetToCreateNewNodes(bool toCreate)
267 if ( myToCreateNewNodes != toCreate ) {
268 myToCreateNewNodes = toCreate;
269 NotifySubMeshesHypothesisModification();
273 //=======================================================================
274 //function : GetToCreateNewNodes
275 //=======================================================================
277 bool GHS3DPlugin_Hypothesis::GetToCreateNewNodes() const
279 return myToCreateNewNodes;
282 //=======================================================================
283 //function : SetToUseBoundaryRecoveryVersion
284 //=======================================================================
286 void GHS3DPlugin_Hypothesis::SetToUseBoundaryRecoveryVersion(bool toUse)
288 if ( myToUseBoundaryRecoveryVersion != toUse ) {
289 myToUseBoundaryRecoveryVersion = toUse;
290 NotifySubMeshesHypothesisModification();
294 //=======================================================================
295 //function : GetToUseBoundaryRecoveryVersion
296 //=======================================================================
298 bool GHS3DPlugin_Hypothesis::GetToUseBoundaryRecoveryVersion() const
300 return myToUseBoundaryRecoveryVersion;
303 //=======================================================================
304 //function : SetFEMCorrection
305 //=======================================================================
307 void GHS3DPlugin_Hypothesis::SetFEMCorrection(bool toUseFem)
309 if ( myToUseFemCorrection != toUseFem ) {
310 myToUseFemCorrection = toUseFem;
311 NotifySubMeshesHypothesisModification();
315 //=======================================================================
316 //function : GetFEMCorrection
317 //=======================================================================
319 bool GHS3DPlugin_Hypothesis::GetFEMCorrection() const
321 return myToUseFemCorrection;
324 //=======================================================================
325 //function : SetToRemoveCentralPoint
326 //=======================================================================
328 void GHS3DPlugin_Hypothesis::SetToRemoveCentralPoint(bool toRemove)
330 if ( myToRemoveCentralPoint != toRemove ) {
331 myToRemoveCentralPoint = toRemove;
332 NotifySubMeshesHypothesisModification();
336 //=======================================================================
337 //function : GetToRemoveCentralPoint
338 //=======================================================================
340 bool GHS3DPlugin_Hypothesis::GetToRemoveCentralPoint() const
342 return myToRemoveCentralPoint;
345 //=======================================================================
346 //function : SetTextOption
347 //=======================================================================
349 void GHS3DPlugin_Hypothesis::SetTextOption(const std::string& option)
351 if ( myTextOption != option ) {
352 myTextOption = option;
353 NotifySubMeshesHypothesisModification();
357 //=======================================================================
358 //function : GetTextOption
359 //=======================================================================
361 std::string GHS3DPlugin_Hypothesis::GetTextOption() const
366 //=======================================================================
367 //function : SetGradation
368 //=======================================================================
370 void GHS3DPlugin_Hypothesis::SetGradation(double gradation)
372 if ( myGradation != gradation ) {
373 myGradation = gradation;
374 NotifySubMeshesHypothesisModification();
378 //=======================================================================
379 //function : GetGradation
380 //=======================================================================
382 double GHS3DPlugin_Hypothesis::GetGradation() const
387 //=======================================================================
388 //function : SetEnforcedVertex
389 //=======================================================================
391 bool GHS3DPlugin_Hypothesis::SetEnforcedVertex(std::string theName, std::string theEntry, std::string theGroupName,
392 double size, double x, double y, double z, bool isCompound)
394 MESSAGE("GHS3DPlugin_Hypothesis::SetEnforcedVertex(\""<< theName << "\", \""<< theEntry << "\", \"" << theGroupName << "\", "
395 << size << ", " << x << ", " << y << ", " << z << ", "<< isCompound << ")");
397 bool toNotify = false;
398 bool toCreate = true;
400 TGHS3DEnforcedVertex *oldEnVertex;
401 TGHS3DEnforcedVertex *newEnfVertex = new TGHS3DEnforcedVertex();
402 newEnfVertex->name = theName;
403 newEnfVertex->geomEntry = theEntry;
404 newEnfVertex->coords.clear();
406 newEnfVertex->coords.push_back(x);
407 newEnfVertex->coords.push_back(y);
408 newEnfVertex->coords.push_back(z);
410 newEnfVertex->groupName = theGroupName;
411 newEnfVertex->size = size;
412 newEnfVertex->isCompound = isCompound;
415 // update _enfVertexList
416 TGHS3DEnforcedVertexList::iterator it = _enfVertexList.find(newEnfVertex);
417 if (it != _enfVertexList.end()) {
420 MESSAGE("Enforced Vertex was found => Update");
421 if (oldEnVertex->name != theName) {
422 MESSAGE("Update name from \"" << oldEnVertex->name << "\" to \"" << theName << "\"");
423 oldEnVertex->name = theName;
426 if (oldEnVertex->groupName != theGroupName) {
427 MESSAGE("Update group name from \"" << oldEnVertex->groupName << "\" to \"" << theGroupName << "\"");
428 oldEnVertex->groupName = theGroupName;
431 if (oldEnVertex->size != size) {
432 MESSAGE("Update size from \"" << oldEnVertex->size << "\" to \"" << size << "\"");
433 oldEnVertex->size = size;
437 // update map coords / enf vertex if needed
438 if (oldEnVertex->coords.size()) {
439 _coordsEnfVertexMap[oldEnVertex->coords] = oldEnVertex;
440 _enfVertexCoordsSizeList[oldEnVertex->coords] = size;
443 // update map geom entry / enf vertex if needed
444 if (oldEnVertex->geomEntry != "") {
445 _geomEntryEnfVertexMap[oldEnVertex->geomEntry] = oldEnVertex;
446 _enfVertexEntrySizeList[oldEnVertex->geomEntry] = size;
451 // //////// CREATE ////////////
454 MESSAGE("Creating new enforced vertex");
455 _enfVertexList.insert(newEnfVertex);
456 if (theEntry == "") {
457 _coordsEnfVertexMap[newEnfVertex->coords] = newEnfVertex;
458 _enfVertexCoordsSizeList[newEnfVertex->coords] = size;
461 _geomEntryEnfVertexMap[newEnfVertex->geomEntry] = newEnfVertex;
462 _enfVertexEntrySizeList[newEnfVertex->geomEntry] = size;
467 NotifySubMeshesHypothesisModification();
469 MESSAGE("GHS3DPlugin_Hypothesis::SetEnforcedVertex END");
474 //=======================================================================
475 //function : SetEnforcedMesh
476 //=======================================================================
477 bool GHS3DPlugin_Hypothesis::SetEnforcedMesh(SMESH_Mesh& theMesh, SMESH::ElementType elementType, std::string name, std::string entry, std::string groupName)
479 TIDSortedElemSet theElemSet;
480 SMDS_ElemIteratorPtr eIt = theMesh.GetMeshDS()->elementsIterator(SMDSAbs_ElementType(elementType));
481 while ( eIt->more() )
482 theElemSet.insert( eIt->next() );
483 MESSAGE("Add "<<theElemSet.size()<<" types["<<elementType<<"] from source mesh");
484 bool added = SetEnforcedElements( theElemSet, elementType, groupName);
486 TGHS3DEnforcedMesh* newEnfMesh = new TGHS3DEnforcedMesh();
487 newEnfMesh->persistID = theMesh.GetMeshDS()->GetPersistentId();
488 newEnfMesh->name = name;
489 newEnfMesh->entry = entry;
490 newEnfMesh->elementType = elementType;
491 newEnfMesh->groupName = groupName;
493 TGHS3DEnforcedMeshList::iterator it = _enfMeshList.find(newEnfMesh);
494 if (it == _enfMeshList.end()) {
495 _entryEnfMeshMap[entry].insert(newEnfMesh);
496 _enfMeshList.insert(newEnfMesh);
505 //=======================================================================
506 //function : SetEnforcedGroup
507 //=======================================================================
508 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)
510 MESSAGE("GHS3DPlugin_Hypothesis::SetEnforcedGroup");
511 TIDSortedElemSet theElemSet;
512 if ( theIDs->length() == 0 ){MESSAGE("The source group is empty");}
513 for (int i=0; i < theIDs->length(); i++) {
514 CORBA::Long ind = theIDs[i];
515 if (elementType == SMESH::NODE)
517 const SMDS_MeshNode * node = theMeshDS->FindNode(ind);
519 theElemSet.insert( node );
523 const SMDS_MeshElement * elem = theMeshDS->FindElement(ind);
525 theElemSet.insert( elem );
529 // SMDS_ElemIteratorPtr it = theGroup->GetGroupDS()->GetElements();
530 // while ( it->more() )
531 // theElemSet.insert( it->next() );
533 MESSAGE("Add "<<theElemSet.size()<<" types["<<elementType<<"] from source group ");
534 bool added = SetEnforcedElements( theElemSet, elementType, groupName);
536 TGHS3DEnforcedMesh* newEnfMesh = new TGHS3DEnforcedMesh();
537 newEnfMesh->name = name;
538 newEnfMesh->entry = entry;
539 newEnfMesh->elementType = elementType;
540 newEnfMesh->groupName = groupName;
542 TGHS3DEnforcedMeshList::iterator it = _enfMeshList.find(newEnfMesh);
543 if (it == _enfMeshList.end()) {
544 _entryEnfMeshMap[entry].insert(newEnfMesh);
545 _enfMeshList.insert(newEnfMesh);
551 //=======================================================================
552 //function : SetEnforcedElements
553 //=======================================================================
554 bool GHS3DPlugin_Hypothesis::SetEnforcedElements(TIDSortedElemSet theElemSet, SMESH::ElementType elementType, std::string groupName)
556 MESSAGE("GHS3DPlugin_Hypothesis::SetEnforcedElements");
557 TIDSortedElemSet::const_iterator it = theElemSet.begin();
558 const SMDS_MeshElement* elem;
559 const SMDS_MeshNode* node;
561 pair<TIDSortedNodeGroupMap::iterator,bool> nodeRet;
562 pair<TIDSortedElemGroupMap::iterator,bool> elemRet;
564 for (;it != theElemSet.end();++it)
567 switch (elementType) {
569 node = dynamic_cast<const SMDS_MeshNode*>(elem);
571 nodeRet = _enfNodes.insert(make_pair(node,groupName));
572 added = added && nodeRet.second;
573 string msg = added ? "yes":"no";
574 MESSAGE( "Node (" <<node->X()<<","<<node->Y()<<","<<node->Z()<< ") with ID " << node->GetID() <<" added ? " << msg);
577 SMDS_ElemIteratorPtr nodeIt = elem->nodesIterator();
578 for (;nodeIt->more();) {
579 node = dynamic_cast<const SMDS_MeshNode*>(nodeIt->next());
580 nodeRet = _enfNodes.insert(make_pair(node,groupName));
581 added = added && nodeRet.second;
587 if (elem->GetType() == SMDSAbs_Edge) {
588 elemRet = _enfEdges.insert(make_pair(elem,groupName));
589 added = added && elemRet.second;
591 else if (elem->GetType() > SMDSAbs_Edge) {
592 SMDS_ElemIteratorPtr it = elem->edgesIterator();
594 const SMDS_MeshElement* anEdge = it->next();
595 elemRet = _enfEdges.insert(make_pair(anEdge,groupName));
596 added = added && elemRet.second;
601 if (elem->GetType() == SMDSAbs_Face)
603 if (elem->NbCornerNodes() == 3) {
604 elemRet = _enfTriangles.insert(make_pair(elem,groupName));
605 added = added && elemRet.second;
608 else if (elem->GetType() > SMDSAbs_Face) { // Group of faces
609 SMDS_ElemIteratorPtr it = elem->facesIterator();
611 const SMDS_MeshElement* aFace = it->next();
612 if (aFace->NbCornerNodes() == 3) {
613 elemRet = _enfTriangles.insert(make_pair(aFace,groupName));
614 added = added && elemRet.second;
624 NotifySubMeshesHypothesisModification();
629 //=======================================================================
630 //function : GetEnforcedVertex
631 //=======================================================================
633 GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertex* GHS3DPlugin_Hypothesis::GetEnforcedVertex(double x, double y, double z)
634 throw (std::invalid_argument)
636 std::vector<double> coord(3);
640 if (_coordsEnfVertexMap.count(coord)>0)
641 return _coordsEnfVertexMap[coord];
642 std::ostringstream msg ;
643 msg << "No enforced vertex at " << x << ", " << y << ", " << z;
644 throw std::invalid_argument(msg.str());
647 GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertex* GHS3DPlugin_Hypothesis::GetEnforcedVertex(const std::string theEntry)
648 throw (std::invalid_argument)
650 if (_geomEntryEnfVertexMap.count(theEntry)>0)
651 return _geomEntryEnfVertexMap[theEntry];
653 std::ostringstream msg ;
654 msg << "No enforced vertex with entry " << theEntry;
655 throw std::invalid_argument(msg.str());
658 //=======================================================================
659 //function : RemoveEnforcedVertex
660 //=======================================================================
662 bool GHS3DPlugin_Hypothesis::RemoveEnforcedVertex(double x, double y, double z, const std::string theEntry)
663 throw (std::invalid_argument)
665 bool toNotify = false;
666 std::ostringstream msg;
667 TGHS3DEnforcedVertex *oldEnfVertex;
668 std::vector<double> coords(3);
673 // check that enf vertex with given enf vertex entry exists
674 TGeomEntryGHS3DEnforcedVertexMap::iterator it_enfVertexEntry = _geomEntryEnfVertexMap.find(theEntry);
675 if (it_enfVertexEntry != _geomEntryEnfVertexMap.end()) {
677 MESSAGE("Found enforced vertex with geom entry " << theEntry);
678 oldEnfVertex = it_enfVertexEntry->second;
679 _geomEntryEnfVertexMap.erase(it_enfVertexEntry);
682 MESSAGE("Enforced vertex with geom entry " << theEntry << " not found");
683 // check that enf vertex with given coords exists
684 TCoordsGHS3DEnforcedVertexMap::iterator it_coords_enf = _coordsEnfVertexMap.find(coords);
685 if (it_coords_enf != _coordsEnfVertexMap.end()) {
687 MESSAGE("Found enforced vertex with coords " << x << ", " << y << ", " << z);
688 oldEnfVertex = it_coords_enf->second;
689 _coordsEnfVertexMap.erase(it_coords_enf);
690 _enfVertexCoordsSizeList.erase(_enfVertexCoordsSizeList.find(coords));
693 MESSAGE("Enforced vertex with coords " << x << ", " << y << ", " << z << " not found");
694 throw std::invalid_argument(msg.str());
698 MESSAGE("Remove enf vertex from _enfVertexList");
700 // update _enfVertexList
701 TGHS3DEnforcedVertexList::iterator it = _enfVertexList.find(oldEnfVertex);
702 if (it != _enfVertexList.end()) {
703 if ((*it)->groupName != "")
704 _groupsToRemove.insert((*it)->groupName);
705 _enfVertexList.erase(it);
711 NotifySubMeshesHypothesisModification();
716 //=======================================================================
717 //function : ClearEnforcedVertices
718 //=======================================================================
719 void GHS3DPlugin_Hypothesis::ClearEnforcedVertices()
721 TGHS3DEnforcedVertexList::const_iterator it = _enfVertexList.begin();
722 for(;it != _enfVertexList.end();++it) {
723 if ((*it)->groupName != "")
724 _groupsToRemove.insert((*it)->groupName);
726 _enfVertexList.clear();
727 _coordsEnfVertexMap.clear();
728 _geomEntryEnfVertexMap.clear();
729 _enfVertexCoordsSizeList.clear();
730 _enfVertexEntrySizeList.clear();
731 NotifySubMeshesHypothesisModification();
734 //=======================================================================
735 //function : ClearEnforcedMeshes
736 //=======================================================================
737 void GHS3DPlugin_Hypothesis::ClearEnforcedMeshes()
739 TGHS3DEnforcedMeshList::const_iterator it = _enfMeshList.begin();
740 for(;it != _enfMeshList.end();++it) {
741 if ((*it)->groupName != "")
742 _groupsToRemove.insert((*it)->groupName);
746 _enfTriangles.clear();
747 _nodeIDToSizeMap.clear();
748 _enfMeshList.clear();
749 _entryEnfMeshMap.clear();
750 NotifySubMeshesHypothesisModification();
753 //================================================================================
755 * \brief At mesh loading, restore enforced elements by just loaded enforced meshes
757 //================================================================================
759 void GHS3DPlugin_Hypothesis::RestoreEnfElemsByMeshes()
761 TGHS3DEnforcedMeshList::const_iterator it = _enfMeshList.begin();
762 for(;it != _enfMeshList.end();++it) {
763 TGHS3DEnforcedMesh* enfMesh = *it;
764 if ( SMESH_Mesh* mesh = GetMeshByPersistentID( enfMesh->persistID ))
765 SetEnforcedMesh( *mesh,
766 enfMesh->elementType,
769 enfMesh->groupName );
770 enfMesh->persistID = -1; // not to restore again
774 //=======================================================================
775 //function : SetGroupsToRemove
776 //=======================================================================
778 void GHS3DPlugin_Hypothesis::ClearGroupsToRemove()
780 _groupsToRemove.clear();
784 //=======================================================================
785 //function : DefaultMeshHoles
786 //=======================================================================
788 bool GHS3DPlugin_Hypothesis::DefaultMeshHoles()
790 return false; // PAL19680
793 //=======================================================================
794 //function : DefaultToMakeGroupsOfDomains
795 //=======================================================================
797 bool GHS3DPlugin_Hypothesis::DefaultToMakeGroupsOfDomains()
799 return true; // issue 0022172
802 //=======================================================================
803 //function : DefaultMaximumMemory
804 //=======================================================================
807 #include <sys/sysinfo.h>
812 short GHS3DPlugin_Hypothesis::DefaultMaximumMemory()
816 int err = sysinfo( &si );
818 int ramMB = si.totalram * si.mem_unit / 1024 / 1024;
819 return (int) ( 0.7 * ramMB );
822 // See http://msdn.microsoft.com/en-us/library/aa366589.aspx
823 MEMORYSTATUSEX statex;
824 statex.dwLength = sizeof (statex);
825 int err = GlobalMemoryStatusEx (&statex);
828 statex.ullTotalPhys / 1024 / 1024 +
829 statex.ullTotalPageFile / 1024 / 1024 +
830 statex.ullTotalVirtual / 1024 / 1024;
831 return (int) ( 0.7 * totMB );
837 //=======================================================================
838 //function : DefaultInitialMemory
839 //=======================================================================
841 short GHS3DPlugin_Hypothesis::DefaultInitialMemory()
843 return DefaultMaximumMemory();
846 //=======================================================================
847 //function : DefaultOptimizationLevel
848 //=======================================================================
850 short GHS3DPlugin_Hypothesis::DefaultOptimizationLevel()
855 //=======================================================================
856 //function : DefaultWorkingDirectory
857 //=======================================================================
859 std::string GHS3DPlugin_Hypothesis::DefaultWorkingDirectory()
861 TCollection_AsciiString aTmpDir;
863 char *Tmp_dir = getenv("SALOME_TMP_DIR");
864 if(Tmp_dir != NULL) {
869 aTmpDir = TCollection_AsciiString("C:\\");
871 aTmpDir = TCollection_AsciiString("/tmp/");
874 return aTmpDir.ToCString();
877 //=======================================================================
878 //function : DefaultKeepFiles
879 //=======================================================================
881 bool GHS3DPlugin_Hypothesis::DefaultKeepFiles()
886 //=======================================================================
887 //function : DefaultVerboseLevel
888 //=======================================================================
890 short GHS3DPlugin_Hypothesis::DefaultVerboseLevel()
895 //=======================================================================
896 //function : DefaultToCreateNewNodes
897 //=======================================================================
899 bool GHS3DPlugin_Hypothesis::DefaultToCreateNewNodes()
904 //=======================================================================
905 //function : DefaultToUseBoundaryRecoveryVersion
906 //=======================================================================
908 bool GHS3DPlugin_Hypothesis::DefaultToUseBoundaryRecoveryVersion()
913 //=======================================================================
914 //function : DefaultToUseFEMCorrection
915 //=======================================================================
917 bool GHS3DPlugin_Hypothesis::DefaultToUseFEMCorrection()
922 //=======================================================================
923 //function : DefaultToRemoveCentralPoint
924 //=======================================================================
926 bool GHS3DPlugin_Hypothesis::DefaultToRemoveCentralPoint()
931 //=======================================================================
932 //function : DefaultGradation
933 //=======================================================================
935 double GHS3DPlugin_Hypothesis::DefaultGradation()
940 // //=======================================================================
941 // //function : DefaultID2SizeMap
942 // //=======================================================================
944 // GHS3DPlugin_Hypothesis::TID2SizeMap GHS3DPlugin_Hypothesis::DefaultID2SizeMap()
946 // return GHS3DPlugin_Hypothesis::TID2SizeMap();
950 //=======================================================================
952 //=======================================================================
954 std::ostream & GHS3DPlugin_Hypothesis::SaveTo(std::ostream & save)
956 save << (int) myToMeshHoles << " ";
957 save << myMaximumMemory << " ";
958 save << myInitialMemory << " ";
959 save << myOptimizationLevel << " ";
960 save << myWorkingDirectory << " ";
961 save << (int)myKeepFiles << " ";
962 save << myVerboseLevel << " ";
963 save << (int)myToCreateNewNodes << " ";
964 save << (int)myToUseBoundaryRecoveryVersion << " ";
965 save << (int)myToUseFemCorrection << " ";
966 save << (int)myToRemoveCentralPoint << " ";
967 save << myGradation << " ";
968 save << myToMakeGroupsOfDomains << " ";
969 if (!myTextOption.empty()) {
970 save << "__OPTIONS_BEGIN__ ";
971 save << myTextOption << " ";
972 save << "__OPTIONS_END__ ";
976 TGHS3DEnforcedVertexList::iterator it = _enfVertexList.begin();
977 if (it != _enfVertexList.end()) {
978 save << " " << "__ENFORCED_VERTICES_BEGIN__ ";
979 for ( ; it != _enfVertexList.end(); ++it ) {
980 TGHS3DEnforcedVertex *enfVertex = (*it);
981 save << " " << "__BEGIN_VERTEX__";
982 if (!enfVertex->name.empty()) {
983 save << " " << "__BEGIN_NAME__";
984 save << " " << enfVertex->name;
985 save << " " << "__END_NAME__";
987 if (!enfVertex->geomEntry.empty()) {
988 save << " " << "__BEGIN_ENTRY__";
989 save << " " << enfVertex->geomEntry;
990 save << " " << enfVertex->isCompound;
991 save << " " << "__END_ENTRY__";
993 if (!enfVertex->groupName.empty()) {
994 save << " " << "__BEGIN_GROUP__";
995 save << " " << enfVertex->groupName;
996 save << " " << "__END_GROUP__";
998 if (enfVertex->coords.size()) {
999 save << " " << "__BEGIN_COORDS__";
1000 for (int i=0;i<enfVertex->coords.size();i++)
1001 save << " " << enfVertex->coords[i];
1002 save << " " << "__END_COORDS__";
1004 save << " " << "__BEGIN_SIZE__";
1005 save << " " << enfVertex->size;
1006 save << " " << "__END_SIZE__";
1007 save << " " << "__END_VERTEX__";
1009 save << " " << "__ENFORCED_VERTICES_END__ ";
1012 TGHS3DEnforcedMeshList::iterator it_mesh = _enfMeshList.begin();
1013 if (it_mesh != _enfMeshList.end()) {
1014 save << " " << "__ENFORCED_MESHES_BEGIN__ ";
1015 for ( ; it_mesh != _enfMeshList.end(); ++it_mesh ) {
1016 TGHS3DEnforcedMesh *enfMesh = (*it_mesh);
1017 save << " " << "__BEGIN_ENF_MESH__";
1019 save << " " << "__BEGIN_NAME__";
1020 save << " " << enfMesh->name;
1021 save << " " << "__END_NAME__";
1023 save << " " << "__BEGIN_ENTRY__";
1024 save << " " << enfMesh->entry;
1025 save << " " << "__END_ENTRY__";
1027 save << " " << "__BEGIN_ELEM_TYPE__";
1028 save << " " << (int)enfMesh->elementType;
1029 save << " " << "__END_ELEM_TYPE__";
1031 if (!enfMesh->groupName.empty()) {
1032 save << " " << "__BEGIN_GROUP__";
1033 save << " " << enfMesh->groupName;
1034 save << " " << "__END_GROUP__";
1036 save << " " << "__PERSIST_ID__";
1037 save << " " << enfMesh->persistID;
1038 save << " " << "__END_ENF_MESH__";
1039 std::cout << "Saving of enforced mesh " << enfMesh->name.c_str() << " done" << std::endl;
1041 save << " " << "__ENFORCED_MESHES_END__ ";
1046 //=======================================================================
1047 //function : LoadFrom
1048 //=======================================================================
1050 std::istream & GHS3DPlugin_Hypothesis::LoadFrom(std::istream & load)
1060 load.clear(ios::badbit | load.rdstate());
1064 myMaximumMemory = i;
1066 load.clear(ios::badbit | load.rdstate());
1070 myInitialMemory = i;
1072 load.clear(ios::badbit | load.rdstate());
1076 myOptimizationLevel = i;
1078 load.clear(ios::badbit | load.rdstate());
1080 isOK = (load >> myWorkingDirectory);
1082 if ( myWorkingDirectory == "0") { // myWorkingDirectory was empty
1083 myKeepFiles = false;
1084 myWorkingDirectory.clear();
1086 else if ( myWorkingDirectory == "1" ) {
1088 myWorkingDirectory.clear();
1092 load.clear(ios::badbit | load.rdstate());
1094 if ( !myWorkingDirectory.empty() ) {
1099 load.clear(ios::badbit | load.rdstate());
1104 myVerboseLevel = (short) i;
1106 load.clear(ios::badbit | load.rdstate());
1110 myToCreateNewNodes = (bool) i;
1112 load.clear(ios::badbit | load.rdstate());
1116 myToUseBoundaryRecoveryVersion = (bool) i;
1118 load.clear(ios::badbit | load.rdstate());
1122 myToUseFemCorrection = (bool) i;
1124 load.clear(ios::badbit | load.rdstate());
1128 myToRemoveCentralPoint = (bool) i;
1130 load.clear(ios::badbit | load.rdstate());
1136 load.clear(ios::badbit | load.rdstate());
1138 std::string separator;
1139 bool hasOptions = false;
1140 bool hasEnforcedVertices = false;
1141 bool hasEnforcedMeshes = false;
1142 isOK = (load >> separator);
1144 if ( isOK && ( separator == "0" || separator == "1" ))
1146 myToMakeGroupsOfDomains = ( separator == "1" );
1147 isOK = (load >> separator);
1151 if (separator == "__OPTIONS_BEGIN__")
1153 else if (separator == "__ENFORCED_VERTICES_BEGIN__")
1154 hasEnforcedVertices = true;
1155 else if (separator == "__ENFORCED_MESHES_BEGIN__")
1156 hasEnforcedMeshes = true;
1162 isOK = (load >> txt);
1164 if (txt == "__OPTIONS_END__") {
1165 if (!myTextOption.empty()) {
1166 // Remove last space
1167 myTextOption.erase(myTextOption.end()-1);
1172 myTextOption += txt;
1173 myTextOption += " ";
1179 isOK = (load >> separator);
1180 if (isOK && separator == "__ENFORCED_VERTICES_BEGIN__")
1181 hasEnforcedVertices = true;
1182 if (isOK && separator == "__ENFORCED_MESHES_BEGIN__")
1183 hasEnforcedMeshes = true;
1186 if (hasEnforcedVertices) {
1187 std::string txt, name, entry, groupName;
1188 double size, coords[3];
1190 bool hasCoords = false;
1191 isOK = (load >> txt); // __BEGIN_VERTEX__
1193 if (txt == "__ENFORCED_VERTICES_END__")
1196 TGHS3DEnforcedVertex *enfVertex = new TGHS3DEnforcedVertex();
1198 isOK = (load >> txt);
1199 if (txt == "__END_VERTEX__") {
1200 enfVertex->name = name;
1201 enfVertex->geomEntry = entry;
1202 enfVertex->isCompound = isCompound;
1203 enfVertex->groupName = groupName;
1204 enfVertex->coords.clear();
1206 enfVertex->coords.assign(coords,coords+3);
1208 _enfVertexList.insert(enfVertex);
1210 if (enfVertex->coords.size())
1211 _coordsEnfVertexMap[enfVertex->coords] = enfVertex;
1212 if (!enfVertex->geomEntry.empty())
1213 _geomEntryEnfVertexMap[enfVertex->geomEntry] = enfVertex;
1222 if (txt == "__BEGIN_NAME__") { // __BEGIN_NAME__
1223 while (isOK && (txt != "__END_NAME__")) {
1224 isOK = (load >> txt);
1225 if (txt != "__END_NAME__") {
1231 MESSAGE("name: " <<name);
1234 if (txt == "__BEGIN_ENTRY__") { // __BEGIN_ENTRY__
1235 isOK = (load >> entry);
1236 isOK = (load >> isCompound);
1237 isOK = (load >> txt); // __END_ENTRY__
1238 if (txt != "__END_ENTRY__")
1239 throw std::exception();
1240 MESSAGE("entry: " << entry);
1243 if (txt == "__BEGIN_GROUP__") { // __BEGIN_GROUP__
1244 while (isOK && (txt != "__END_GROUP__")) {
1245 isOK = (load >> txt);
1246 if (txt != "__END_GROUP__") {
1247 if (!groupName.empty())
1252 MESSAGE("groupName: " << groupName);
1255 if (txt == "__BEGIN_COORDS__") { // __BEGIN_COORDS__
1257 isOK = (load >> coords[0] >> coords[1] >> coords[2]);
1258 isOK = (load >> txt); // __END_COORDS__
1259 if (txt != "__END_COORDS__")
1260 throw std::exception();
1261 MESSAGE("coords: " << coords[0] <<","<< coords[1] <<","<< coords[2]);
1264 if (txt == "__BEGIN_SIZE__") { // __BEGIN_ENTRY__
1265 isOK = (load >> size);
1266 isOK = (load >> txt); // __END_ENTRY__
1267 if (txt != "__END_SIZE__") {
1268 throw std::exception();
1270 MESSAGE("size: " << size);
1273 isOK = (load >> txt); // __BEGIN_VERTEX__
1277 if (hasEnforcedVertices) {
1278 isOK = (load >> separator);
1279 if (isOK && separator == "__ENFORCED_MESHES_BEGIN__")
1280 hasEnforcedMeshes = true;
1283 if (hasEnforcedMeshes) {
1284 std::string txt, name, entry, groupName;
1285 int elementType = -1, persistID = -1;
1286 isOK = (load >> txt); // __BEGIN_ENF_MESH__
1289 if (txt == "__ENFORCED_MESHES_END__")
1292 TGHS3DEnforcedMesh *enfMesh = new TGHS3DEnforcedMesh();
1294 isOK = (load >> txt);
1295 if (txt == "__END_ENF_MESH__") {
1296 enfMesh->name = name;
1297 enfMesh->entry = entry;
1298 enfMesh->elementType = (SMESH::ElementType)elementType;
1299 enfMesh->groupName = groupName;
1300 enfMesh->persistID = persistID;
1302 _enfMeshList.insert(enfMesh);
1303 std::cout << "Restoring of enforced mesh " <<name << " done" << std::endl;
1313 if (txt == "__BEGIN_NAME__") { // __BEGIN_NAME__
1314 while (isOK && (txt != "__END_NAME__")) {
1315 isOK = (load >> txt);
1316 if (txt != "__END_NAME__") {
1322 MESSAGE("name: " <<name);
1325 if (txt == "__BEGIN_ENTRY__") { // __BEGIN_ENTRY__
1326 isOK = (load >> entry);
1327 isOK = (load >> txt); // __END_ENTRY__
1328 if (txt != "__END_ENTRY__")
1329 throw std::exception();
1330 MESSAGE("entry: " << entry);
1333 if (txt == "__BEGIN_ELEM_TYPE__") { // __BEGIN_ELEM_TYPE__
1334 isOK = (load >> elementType);
1335 isOK = (load >> txt); // __END_ELEM_TYPE__
1336 if (txt != "__END_ELEM_TYPE__")
1337 throw std::exception();
1338 MESSAGE("elementType: " << elementType);
1341 if (txt == "__BEGIN_GROUP__") { // __BEGIN_GROUP__
1342 while (isOK && (txt != "__END_GROUP__")) {
1343 isOK = (load >> txt);
1344 if (txt != "__END_GROUP__") {
1345 if (!groupName.empty())
1350 MESSAGE("groupName: " << groupName);
1353 if (txt == "__PERSIST_ID__") {
1354 isOK = (load >> persistID);
1355 MESSAGE("persistID: " << persistID);
1357 std::cout << "isOK: " << isOK << std::endl;
1360 isOK = (load >> txt); // __BEGIN_ENF_MESH__
1367 //=======================================================================
1368 //function : SetParametersByMesh
1369 //=======================================================================
1371 bool GHS3DPlugin_Hypothesis::SetParametersByMesh(const SMESH_Mesh* ,const TopoDS_Shape&)
1377 //================================================================================
1379 * \brief Return false
1381 //================================================================================
1383 bool GHS3DPlugin_Hypothesis::SetParametersByDefaults(const TDefaults& /*dflts*/,
1384 const SMESH_Mesh* /*theMesh*/)
1389 //================================================================================
1391 * \brief Return command to run ghs3d mesher excluding file prefix (-f)
1393 //================================================================================
1395 std::string GHS3DPlugin_Hypothesis::CommandToRun(const GHS3DPlugin_Hypothesis* hyp,
1396 const bool hasShapeToMesh)
1398 TCollection_AsciiString cmd = GetExeName().c_str();
1399 // check if any option is overridden by hyp->myTextOption
1400 bool m = hyp ? ( hyp->myTextOption.find("-m") == std::string::npos ) : true;
1401 bool M = hyp ? ( hyp->myTextOption.find("-M") == std::string::npos ) : true;
1402 bool c = hyp ? ( hyp->myTextOption.find("-c") == std::string::npos ) : true;
1403 bool o = hyp ? ( hyp->myTextOption.find("-o") == std::string::npos ) : true;
1404 bool p0 = hyp ? ( hyp->myTextOption.find("-p0") == std::string::npos ) : true;
1405 bool C = hyp ? ( hyp->myTextOption.find("-C") == std::string::npos ) : true;
1406 bool v = hyp ? ( hyp->myTextOption.find("-v") == std::string::npos ) : true;
1407 bool fem = hyp ? ( hyp->myTextOption.find("-FEM")== std::string::npos ) : true;
1408 bool rem = hyp ? ( hyp->myTextOption.find("-no_initial_central_point")== std::string::npos ) : true;
1409 bool gra = hyp ? ( hyp->myTextOption.find("-Dcpropa")== std::string::npos ) : true;
1411 // if use boundary recovery version, few options are allowed
1412 bool useBndRecovery = !C;
1413 if ( !useBndRecovery && hyp )
1414 useBndRecovery = hyp->myToUseBoundaryRecoveryVersion;
1416 // ghs3d needs to know amount of memory it may use (MB).
1417 // Default memory is defined at ghs3d installation but it may be not enough,
1418 // so allow to use about all available memory
1420 short aMaximumMemory = hyp ? hyp->myMaximumMemory : -1;
1422 if ( aMaximumMemory < 0 )
1423 cmd += DefaultMaximumMemory();
1425 cmd += aMaximumMemory;
1427 if ( M && !useBndRecovery ) {
1428 short aInitialMemory = hyp ? hyp->myInitialMemory : -1;
1430 if ( aInitialMemory > 0 )
1431 cmd += aInitialMemory;
1435 // component to mesh
1436 // 0 , all components to be meshed
1437 // 1 , only the main ( outermost ) component to be meshed
1438 if ( c && !useBndRecovery ) {
1439 // We always run GHS3D with "to mesh holes'==TRUE (see PAL19680)
1440 if ( hasShapeToMesh )
1443 bool aToMeshHoles = hyp ? hyp->myToMeshHoles : DefaultMeshHoles();
1451 // optimization level
1452 if ( o && hyp && !useBndRecovery ) {
1453 if ( hyp->myOptimizationLevel >= 0 && hyp->myOptimizationLevel < 5 ) {
1454 const char* level[] = { "none" , "light" , "standard" , "standard+" , "strong" };
1456 cmd += level[ hyp->myOptimizationLevel ];
1460 // to create internal nodes
1461 if ( p0 && hyp && !hyp->myToCreateNewNodes ) {
1468 cmd += hyp->myVerboseLevel;
1471 // boundary recovery version
1472 if ( useBndRecovery ) {
1476 // to use FEM correction
1477 if ( fem && hyp && hyp->myToUseFemCorrection) {
1481 // to remove initial central point.
1482 if ( rem && hyp && hyp->myToRemoveCentralPoint) {
1483 cmd += " -no_initial_central_point";
1487 if ( hyp && !hyp->myTextOption.empty() ) {
1489 cmd += (char*) hyp->myTextOption.c_str();
1492 // to define volumic gradation.
1494 cmd += " -Dcpropa=";
1495 cmd += hyp->myGradation;
1502 return cmd.ToCString();
1505 //================================================================================
1507 * \brief Return a unique file name
1509 //================================================================================
1511 std::string GHS3DPlugin_Hypothesis::GetFileName(const GHS3DPlugin_Hypothesis* hyp)
1513 std::string aTmpDir = hyp ? hyp->GetWorkingDirectory() : DefaultWorkingDirectory();
1514 const char lastChar = *aTmpDir.rbegin();
1516 if(lastChar != '\\') aTmpDir+='\\';
1518 if(lastChar != '/') aTmpDir+='/';
1521 TCollection_AsciiString aGenericName = (char*)aTmpDir.c_str();
1522 aGenericName += "GHS3D_";
1523 aGenericName += getpid();
1524 aGenericName += "_";
1525 aGenericName += Abs((Standard_Integer)(long) aGenericName.ToCString());
1527 return aGenericName.ToCString();
1530 //================================================================================
1532 * Return the name of executable
1534 //================================================================================
1536 std::string GHS3DPlugin_Hypothesis::GetExeName()
1538 return "mg-tetra.exe";
1541 //================================================================================
1543 * \brief Return the enforced vertices
1545 //================================================================================
1547 GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertexList GHS3DPlugin_Hypothesis::GetEnforcedVertices(const GHS3DPlugin_Hypothesis* hyp)
1549 return hyp ? hyp->_GetEnforcedVertices():DefaultGHS3DEnforcedVertexList();
1552 GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertexCoordsValues GHS3DPlugin_Hypothesis::GetEnforcedVerticesCoordsSize (const GHS3DPlugin_Hypothesis* hyp)
1554 return hyp ? hyp->_GetEnforcedVerticesCoordsSize(): DefaultGHS3DEnforcedVertexCoordsValues();
1557 GHS3DPlugin_Hypothesis::TGHS3DEnforcedVertexEntryValues GHS3DPlugin_Hypothesis::GetEnforcedVerticesEntrySize (const GHS3DPlugin_Hypothesis* hyp)
1559 return hyp ? hyp->_GetEnforcedVerticesEntrySize(): DefaultGHS3DEnforcedVertexEntryValues();
1562 GHS3DPlugin_Hypothesis::TCoordsGHS3DEnforcedVertexMap GHS3DPlugin_Hypothesis::GetEnforcedVerticesByCoords (const GHS3DPlugin_Hypothesis* hyp)
1564 return hyp ? hyp->_GetEnforcedVerticesByCoords(): DefaultCoordsGHS3DEnforcedVertexMap();
1567 GHS3DPlugin_Hypothesis::TGeomEntryGHS3DEnforcedVertexMap GHS3DPlugin_Hypothesis::GetEnforcedVerticesByEntry (const GHS3DPlugin_Hypothesis* hyp)
1569 return hyp ? hyp->_GetEnforcedVerticesByEntry(): DefaultGeomEntryGHS3DEnforcedVertexMap();
1572 GHS3DPlugin_Hypothesis::TIDSortedNodeGroupMap GHS3DPlugin_Hypothesis::GetEnforcedNodes(const GHS3DPlugin_Hypothesis* hyp)
1574 return hyp ? hyp->_GetEnforcedNodes():DefaultIDSortedNodeGroupMap();
1577 GHS3DPlugin_Hypothesis::TIDSortedElemGroupMap GHS3DPlugin_Hypothesis::GetEnforcedEdges(const GHS3DPlugin_Hypothesis* hyp)
1579 return hyp ? hyp->_GetEnforcedEdges():DefaultIDSortedElemGroupMap();
1582 GHS3DPlugin_Hypothesis::TIDSortedElemGroupMap GHS3DPlugin_Hypothesis::GetEnforcedTriangles(const GHS3DPlugin_Hypothesis* hyp)
1584 return hyp ? hyp->_GetEnforcedTriangles():DefaultIDSortedElemGroupMap();
1587 GHS3DPlugin_Hypothesis::TID2SizeMap GHS3DPlugin_Hypothesis::GetNodeIDToSizeMap(const GHS3DPlugin_Hypothesis* hyp)
1589 return hyp ? hyp->_GetNodeIDToSizeMap(): DefaultID2SizeMap();
1592 GHS3DPlugin_Hypothesis::TSetStrings GHS3DPlugin_Hypothesis::GetGroupsToRemove(const GHS3DPlugin_Hypothesis* hyp)
1594 return hyp ? hyp->_GetGroupsToRemove(): DefaultGroupsToRemove();