1 // Copyright (C) 2004-2024 CEA, EDF
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, or (at your option) any later version.
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 // GHS3DPlugin : C++ implementation
21 // File : GHS3DPlugin_Hypothesis_i.hxx
25 #ifndef _GHS3DPlugin_Hypothesis_i_HXX_
26 #define _GHS3DPlugin_Hypothesis_i_HXX_
28 #include "GHS3DPlugin_Defs.hxx"
30 #include <SALOMEconfig.h>
31 #include CORBA_SERVER_HEADER(GHS3DPlugin_Algorithm)
33 #include "SMESH_Hypothesis_i.hxx"
34 #include "SMESH_Mesh_i.hxx"
35 #include "GHS3DPlugin_Hypothesis.hxx"
39 // GHS3DPlugin parameters hypothesis
41 class GHS3DPLUGIN_EXPORT GHS3DPlugin_Hypothesis_i:
42 public virtual POA_GHS3DPlugin::GHS3DPlugin_Hypothesis,
43 public virtual SMESH_Hypothesis_i
47 GHS3DPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
48 ::SMESH_Gen* theGenImpl);
50 virtual ~GHS3DPlugin_Hypothesis_i();
53 * To mesh "holes" in a solid or not. Default is to mesh.
55 void SetToMeshHoles(CORBA::Boolean toMesh);
56 CORBA::Boolean GetToMeshHoles();
58 * Activate/deactivate volume proximity computation
60 void SetVolumeProximity( CORBA::Boolean toUse );
61 CORBA::Boolean GetVolumeProximity();
63 * Set number of surface element layers to be generated due to volume proximity
65 void SetNbVolumeProximityLayers( CORBA::Short nbLayers );
66 CORBA::Short GetNbVolumeProximityLayers();
68 void SetMaxSize(CORBA::Double theMaxSize);
69 CORBA::Double GetMaxSize();
71 void SetMinSize(CORBA::Double theMinSize);
72 CORBA::Double GetMinSize();
74 * To make groups of volumes of different domains when mesh is generated from skin.
75 * Default is to make groups.
76 * This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true
78 void SetToMakeGroupsOfDomains(CORBA::Boolean toMakeGroups);
79 CORBA::Boolean GetToMakeGroupsOfDomains();
81 * Maximal size of memory to be used by the algorithm (in Megabytes)
83 void SetMaximumMemory(CORBA::Float MB);
84 CORBA::Float GetMaximumMemory();
86 * Initial size of memory to be used by the algorithm (in Megabytes) in
87 * automatic memory adjustment mode. Default is zero
89 void SetInitialMemory(CORBA::Float MB);
90 CORBA::Float GetInitialMemory();
92 * Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
94 void SetOptimizationLevel(CORBA::Short level);
95 CORBA::Short GetOptimizationLevel();
97 * Algorithm Id: 0-MGTetra HPC, 1-MGTetra
99 void SetAlgorithm(CORBA::Short algoId);
100 CORBA::Short GetAlgorithm();
102 * Flag for set get optional use parallelism in MGTetra
104 void SetUseNumOfThreads(CORBA::Boolean useThreads);
105 CORBA::Boolean GetUseNumOfThreads();
107 * Get set number of threads to use on the parallel MGTetra algorithm
109 void SetNumOfThreads(CORBA::Short numThreads);
110 CORBA::Short GetNumOfThreads();
113 * PthreadMode: 0-PThreadNone, 1-PThreadAggressive, 2-Safe
115 void SetPthreadMode(CORBA::Short pThreadMode);
116 CORBA::Short GetPthreadMode();
119 * SetParallelMode level: 0-ParallelNone, 1-ReproducibleGivenMaxNumThreads, 2-Reproducible, 3-ParallelAggressive
121 void SetParallelMode(CORBA::Short parallelMode);
122 CORBA::Short GetParallelMode();
124 * Path to working directory
126 void SetWorkingDirectory(const char* path);
127 char* GetWorkingDirectory();
129 * To keep working files or remove them. Log file remains in case of errors anyway.
131 void SetKeepFiles(CORBA::Boolean toKeep);
132 CORBA::Boolean GetKeepFiles();
134 * Verbose level [0-10]
135 * 0 - no standard output,
136 * 2 - prints the data, quality statistics of the skin and final meshes and
137 * indicates when the final mesh is being saved. In addition the software
138 * gives indication regarding the CPU time.
139 * 10 - same as 2 plus the main steps in the computation, quality statistics
140 * histogram of the skin mesh, quality statistics histogram together with
141 * the characteristics of the final mesh.
143 void SetVerboseLevel(CORBA::Short level);
144 CORBA::Short GetVerboseLevel();
146 * To create new nodes
148 void SetToCreateNewNodes(CORBA::Boolean toCreate);
149 CORBA::Boolean GetToCreateNewNodes();
151 * To use boundary recovery version which tries to create mesh on a very poor
152 * quality surface mesh
154 void SetToUseBoundaryRecoveryVersion(CORBA::Boolean toUse);
155 CORBA::Boolean GetToUseBoundaryRecoveryVersion();
157 * Applies finite-element correction by replacing overconstrained elements where
158 * it is possible. The process is cutting first the overconstrained edges and
159 * second the overconstrained facets. This insure that no edges have two boundary
160 * vertices and that no facets have three boundary vertices.
162 void SetFEMCorrection(CORBA::Boolean toUseFem);
163 CORBA::Boolean GetFEMCorrection();
165 * To removes initial central point.
167 void SetToRemoveCentralPoint(CORBA::Boolean toRemove);
168 CORBA::Boolean GetToRemoveCentralPoint();
170 * To set hiden/undocumented/advanced options
172 void SetAdvancedOption(const char* option);
173 char* GetAdvancedOption();
174 void SetTextOption(const char* option); // obsolete
175 char* GetTextOption();
177 void SetOptionValue(const char* optionName, const char* optionValue);
178 char* GetOptionValue(const char* optionName);
179 void UnsetOption(const char* optionName);
181 GHS3DPlugin::string_array* GetOptionValues();
182 GHS3DPlugin::string_array* GetAdvancedOptionValues();
184 void SetOptionValues(const GHS3DPlugin::string_array& options);
185 void SetAdvancedOptionValues(const GHS3DPlugin::string_array& options);
187 void AddOption(const char* optionName, const char* optionValue);
188 char* GetOption(const char* optionName);
190 * To define the volumic gradation
192 void SetGradation(CORBA::Double gradation);
193 CORBA::Double GetGradation();
195 * Print log in standard output
197 void SetStandardOutputLog(CORBA::Boolean logInStandardOutput);
198 CORBA::Boolean GetStandardOutputLog();
200 * Remove log file on success
202 void SetRemoveLogOnSuccess(CORBA::Boolean removeLogOnSuccess);
203 CORBA::Boolean GetRemoveLogOnSuccess();
205 * To set an enforced vertex
207 bool p_SetEnforcedVertex(CORBA::Double size, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0,
208 const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "",
209 CORBA::Boolean isCompound = false);
210 bool SetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size);
211 bool SetEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName);
212 bool SetEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theGroupName);
213 bool SetEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName, const char* theGroupName);
214 bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size);
215 bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size, const char* theGroupName);
216 CORBA::Double GetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z);
217 CORBA::Double GetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex);
218 bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z);
219 bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex);
220 GHS3DPlugin::GHS3DEnforcedVertexList* GetEnforcedVertices();
221 void ClearEnforcedVertices();
223 * To set an enforced mesh
225 bool p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theName="", const char* theGroupName="");
226 bool SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType);
227 bool SetEnforcedMeshWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theGroupName);
229 /* OBSOLETE FUNCTIONS */
230 bool SetEnforcedMeshSize(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double /*size*/);
231 bool SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double /*size*/, const char* theGroupName);
232 /* OBSOLETE FUNCTIONS */
234 GHS3DPlugin::GHS3DEnforcedMeshList* GetEnforcedMeshes();
235 void ClearEnforcedMeshes();
238 CORBA::Double GetMaxSizeDefault();
239 CORBA::Double GetMinSizeDefault();
240 void SetMinMaxSizeDefault( CORBA::Double theMinSize, CORBA::Double theMaxSize );
242 // Get implementation
243 ::GHS3DPlugin_Hypothesis* GetImpl();
245 // Verify whether hypothesis supports given entity type
246 CORBA::Boolean IsDimSupported( SMESH::Dimension type );
249 // Methods for copying mesh definition to other geometry
251 // Return geometry this hypothesis depends on. Return false if there is no geometry parameter
252 virtual bool getObjectsDependOn( std::vector< std::string > & entryArray,
253 std::vector< int > & subIDArray ) const;
255 // Set new geometry instead of that returned by getObjectsDependOn()
256 virtual bool setObjectsDependOn( std::vector< std::string > & entryArray,
257 std::vector< int > & subIDArray );