-// Copyright (C) 2004-2012 CEA/DEN, EDF R&D
+// Copyright (C) 2004-2013 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
////////////////////
struct TGHS3DEnforcedMesh {
+ int persistID;
std::string name;
std::string entry;
- SMESH::ElementType elementType;
std::string groupName;
- double size;
+ SMESH::ElementType elementType;
};
struct CompareGHS3DEnforcedMesh {
};
typedef std::set< TGHS3DEnforcedMesh*, CompareGHS3DEnforcedMesh > TGHS3DEnforcedMeshList;
// Map mesh entry / Enforced mesh list
- // ex: 0:1:2:1 -> [ ("Mesh_1", "0:1:2:1", TopAbs_NODE, "", -1),
- // ("Mesh_1", "0:1:2:1", TopAbs_EDGE, "edge group", 5)]
+ // ex: 0:1:2:1 -> [ ("Mesh_1", "0:1:2:1", TopAbs_NODE, ""),
+ // ("Mesh_1", "0:1:2:1", TopAbs_EDGE, "edge group")]
typedef std::map< std::string, TGHS3DEnforcedMeshList > TEntryGHS3DEnforcedMeshListMap;
typedef std::map<int,double> TID2SizeMap;
+
+ struct TIDMeshIDCompare {
+ bool operator () (const SMDS_MeshElement* e1, const SMDS_MeshElement* e2) const
+ { return e1->getMeshId() == e2->getMeshId() ? e1->GetID() < e2->GetID() : e1->getMeshId() < e2->getMeshId() ; }
+ };
- typedef std::map<const SMDS_MeshElement*, std::string, TIDCompare > TIDSortedElemGroupMap;
- typedef std::map<const SMDS_MeshNode*, std::string, TIDCompare > TIDSortedNodeGroupMap;
+ typedef std::map<const SMDS_MeshElement*, std::string, TIDMeshIDCompare > TIDSortedElemGroupMap;
+ typedef std::map<const SMDS_MeshNode*, std::string, TIDMeshIDCompare > TIDSortedNodeGroupMap;
typedef std::set<std::string> TSetStrings;
static const char* GetHypType() { return "GHS3D_Parameters"; }
*/
void SetToMeshHoles(bool toMesh);
bool GetToMeshHoles(bool checkFreeOption = false) const;
+ /*!
+ * To make groups of volumes of different domains when mesh is generated from skin.
+ * Default is to make groups.
+ * This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true
+ */
+ void SetToMakeGroupsOfDomains(bool toMakeGroups);
+ bool GetToMakeGroupsOfDomains() const;
/*!
* Maximal size of memory to be used by the algorithm (in Megabytes)
*/
- void SetMaximumMemory(short MB);
- short GetMaximumMemory() const;
+ void SetMaximumMemory(double MB);
+ double GetMaximumMemory() const;
/*!
* Initial size of memory to be used by the algorithm (in Megabytes) in
* automatic memory adjustment mode. Default is zero
*/
- void SetInitialMemory(short MB);
- short GetInitialMemory() const;
+ void SetInitialMemory(double MB);
+ double GetInitialMemory() const;
/*!
* Optimization level: 0-none, 1-light, 2-medium, 3-standard+, 4-strong. Default is medium
*/
*/
void SetTextOption(const std::string& option);
std::string GetTextOption() const;
+ /*!
+ * To define the volumic gradation
+ */
+ void SetGradation(double gradation);
+ double GetGradation() const ;
+ /*!
+ * Print log in standard output
+ */
+ void SetStandardOutputLog(bool logInStandardOutput);
+ bool GetStandardOutputLog() const ;
+ /*!
+ * Remove log file on success
+ */
+ void SetRemoveLogOnSuccess(bool removeLogOnSuccess);
+ bool GetRemoveLogOnSuccess() const ;
// struct TEnforcedEdge {
* \brief Return a unique file name
*/
static std::string GetFileName(const GHS3DPlugin_Hypothesis* hyp);
+ /*!
+ * \brief Return the name of executable
+ */
+ static std::string GetExeName();
/*!
* To set an enforced vertex
/*!
* To set enforced elements
*/
- bool SetEnforcedMesh(SMESH_Mesh& theMesh, SMESH::ElementType elementType, std::string name, std::string entry, double size, std::string groupName = "");
- bool SetEnforcedGroup(const SMESHDS_Mesh* theMeshDS, SMESH::long_array_var theIDs, SMESH::ElementType elementType, std::string name, std::string entry, double size, std::string groupName = "");
- bool SetEnforcedElements(TIDSortedElemSet theElemSet, SMESH::ElementType elementType, double size, std::string groupName = "");
+ bool SetEnforcedMesh(SMESH_Mesh& theMesh, SMESH::ElementType elementType, std::string name, std::string entry, std::string groupName = "");
+ bool SetEnforcedGroup(const SMESHDS_Mesh* theMeshDS, SMESH::long_array_var theIDs, SMESH::ElementType elementType, std::string name, std::string entry, std::string groupName = "");
+ bool SetEnforcedElements(TIDSortedElemSet theElemSet, SMESH::ElementType elementType, std::string groupName = "");
const TGHS3DEnforcedMeshList _GetEnforcedMeshes() const { return _enfMeshList; }
const TEntryGHS3DEnforcedMeshListMap _GetEnforcedMeshesByEntry() const { return _entryEnfMeshMap; }
void ClearEnforcedMeshes();
const TIDSortedElemGroupMap _GetEnforcedEdges() const { return _enfEdges; }
const TIDSortedElemGroupMap _GetEnforcedTriangles() const { return _enfTriangles; }
const TID2SizeMap _GetNodeIDToSizeMap() const {return _nodeIDToSizeMap; }
- const TID2SizeMap _GetElementIDToSizeMap() const {return _elementIDToSizeMap; }
const TSetStrings _GetGroupsToRemove() const {return _groupsToRemove; }
+ void RestoreEnfElemsByMeshes(); // persistence
/*!
* \brief Return the enforced vertices
*/
static TIDSortedElemGroupMap GetEnforcedEdges(const GHS3DPlugin_Hypothesis* hyp);
static TIDSortedElemGroupMap GetEnforcedTriangles(const GHS3DPlugin_Hypothesis* hyp);
static TID2SizeMap GetNodeIDToSizeMap(const GHS3DPlugin_Hypothesis* hyp);
- static TID2SizeMap GetElementIDToSizeMap(const GHS3DPlugin_Hypothesis* hyp);
static TSetStrings GetGroupsToRemove(const GHS3DPlugin_Hypothesis* hyp);
+ static bool GetToMakeGroupsOfDomains(const GHS3DPlugin_Hypothesis* hyp);
void ClearGroupsToRemove();
static bool DefaultMeshHoles();
- static short DefaultMaximumMemory();
- static short DefaultInitialMemory();
+ static bool DefaultToMakeGroupsOfDomains();
+ static double DefaultMaximumMemory();
+ static double DefaultInitialMemory();
static short DefaultOptimizationLevel();
static std::string DefaultWorkingDirectory();
static bool DefaultKeepFiles();
static bool DefaultToUseBoundaryRecoveryVersion();
static bool DefaultToUseFEMCorrection();
static bool DefaultToRemoveCentralPoint();
+ static bool DefaultStandardOutputLog();
+ static bool DefaultRemoveLogOnSuccess();
+ static double DefaultGradation();
static TGHS3DEnforcedVertex DefaultGHS3DEnforcedVertex() {return TGHS3DEnforcedVertex();}
static TGHS3DEnforcedVertexList DefaultGHS3DEnforcedVertexList() {return TGHS3DEnforcedVertexList();}
virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape);
/*!
- * \brief Does nothing
+ * \brief Sets myToMakeGroupsOfDomains depending on whether theMesh is on shape or not
*/
virtual bool SetParametersByDefaults(const TDefaults& dflts, const SMESH_Mesh* theMesh=0);
private:
bool myToMeshHoles;
- short myMaximumMemory;
- short myInitialMemory;
+ bool myToMakeGroupsOfDomains;
+ double myMaximumMemory;
+ double myInitialMemory;
short myOptimizationLevel;
bool myKeepFiles;
std::string myWorkingDirectory;
bool myToUseBoundaryRecoveryVersion;
bool myToUseFemCorrection;
bool myToRemoveCentralPoint;
+ bool myLogInStandardOutput;
+ bool myRemoveLogOnSuccess;
std::string myTextOption;
+ double myGradation;
TGHS3DEnforcedVertexList _enfVertexList;
TGHS3DEnforcedVertexCoordsValues _enfVertexCoordsSizeList;
TIDSortedElemGroupMap _enfEdges;
TIDSortedElemGroupMap _enfTriangles;
TID2SizeMap _nodeIDToSizeMap;
- TID2SizeMap _elementIDToSizeMap;
std::map<std::string, TIDSortedElemSet > _entryToElemsMap;
TSetStrings _groupsToRemove;