Salome HOME
updated copyright message
[plugins/ghs3dplugin.git] / idl / GHS3DPlugin_Algorithm.idl
1 // Copyright (C) 2004-2023  CEA, EDF
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 //  File   : GHS3D_Algorithm.idl
21 //  Author : Julia DOROVSKIKH
22 //
23 #ifndef _GHS3D_Algorithm_IDL_
24 #define _GHS3D_Algorithm_IDL_
25
26 #include "SALOME_Exception.idl"
27 #include "SMESH_Hypothesis.idl"
28 #include "SMESH_Mesh.idl"
29
30 /*!
31  * GHS3DPlugin: interfaces to GHS3D related hypotheses and algorithms
32  */
33 module GHS3DPlugin
34 {
35   typedef sequence<string> string_array;
36
37   typedef sequence<double,3> TCoords;
38   struct GHS3DEnforcedVertex {
39     string name;
40     string geomEntry;
41     boolean isCompound;
42     TCoords coords;
43     string groupName;
44     double size;
45   };
46   
47   typedef sequence<GHS3DEnforcedVertex> GHS3DEnforcedVertexList;
48
49   struct GHS3DEnforcedMesh {
50     string name;
51     string entry;
52     SMESH::ElementType elementType;
53     string groupName;
54   };
55   
56   typedef sequence<GHS3DEnforcedMesh> GHS3DEnforcedMeshList;
57
58   /*!
59    * GHS3DPlugin_GHS3D: interface of "MG-Tetra" algorithm
60    */
61   interface GHS3DPlugin_GHS3D : SMESH::SMESH_3D_Algo
62   {
63     SMESH::SMESH_Mesh importGMFMesh(in string aGMFFileName);
64   };
65
66   /*!
67    * Parameters of "MG-Tetra" algorithm
68    */
69   interface GHS3DPlugin_Hypothesis : SMESH::SMESH_Hypothesis
70   {
71     /*!
72      * To mesh "holes" in a solid or not. Default is to mesh.
73      */
74     void SetToMeshHoles(in boolean toMesh);
75     boolean GetToMeshHoles();
76     /*!
77      *Set lower boundary of mesh element size
78      */
79     void SetMinSize(in double theMinSize);
80     double GetMinSize();
81     /*!
82      *Set upper boundary of mesh element size
83      */
84     void SetMaxSize(in double theMaxSize);
85     double GetMaxSize();
86     /*!
87      *  Activate/deactivate volume proximity computation
88      */
89     void SetVolumeProximity( in boolean toUse );
90     boolean GetVolumeProximity();
91     /*!
92      * Set number of surface element layers to be generated due to volume proximity
93      */
94     void SetNbVolumeProximityLayers( in short nbLayers );
95     short GetNbVolumeProximityLayers();
96     /*!
97      * To make groups of volumes of different domains when mesh is generated from skin.
98      * Default is to make groups.
99      * This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true
100      */
101     void SetToMakeGroupsOfDomains(in boolean toMakeGroups);
102     boolean GetToMakeGroupsOfDomains();
103     /*!
104      * Maximal size of memory to be used by the algorithm (in Megabytes).
105      * Negative value means not to use this option
106      */
107     void SetMaximumMemory(in float MB) raises (SALOME::SALOME_Exception);
108     float GetMaximumMemory();
109     /*!
110      * Initial size of memory to be used by the algorithm (in Megabytes) in
111      * automatic memory adjustment mode. Default is zero.
112      * Negative value means not to use this option
113      */
114     void SetInitialMemory(in float MB) raises (SALOME::SALOME_Exception);
115     float GetInitialMemory();
116     /*!
117      * Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
118      */
119     void SetOptimizationLevel(in short level) raises (SALOME::SALOME_Exception);
120     short GetOptimizationLevel();
121     /*!
122      * Algorithm selection: 0-MGTetra HPC, 1-MGTetra
123      */
124     void SetAlgorithm(in short level) raises (SALOME::SALOME_Exception);
125     short GetAlgorithm();
126     /*!
127      * Set use number of threads
128      */
129     void SetUseNumOfThreads(in boolean setThread) raises (SALOME::SALOME_Exception);
130     boolean GetUseNumOfThreads();
131     /*!
132      * Set number of threads to use
133      */
134     void SetNumOfThreads(in short numThreads);
135     short GetNumOfThreads();
136      /*!
137      * PThreadMode defined for MGTetra
138      */
139     void SetPthreadMode(in short pThreadMode) raises (SALOME::SALOME_Exception);
140     short GetPthreadMode();
141      /*!
142      * ParallelMode defined for MGTetra HPC
143      */
144     void SetParallelMode(in short parallelMode) raises (SALOME::SALOME_Exception);
145     short GetParallelMode();
146     /*!
147      * Path to working directory
148      */
149     void SetWorkingDirectory(in string path) raises (SALOME::SALOME_Exception);
150     string GetWorkingDirectory();
151     /*!
152      * To keep working files or remove them. Log file remains in case of errors anyway.
153      */
154     void SetKeepFiles(in boolean toKeep);
155     boolean GetKeepFiles();
156     /*!
157      * Verbose level [0-10]
158      *  0 - no standard output,
159      *  2 - prints the data, quality statistics of the skin and final meshes and
160      *     indicates when the final mesh is being saved. In addition the software
161      *     gives indication regarding the CPU time.
162      * 10 - same as 2 plus the main steps in the computation, quality statistics
163      *     histogram of the skin mesh, quality statistics histogram together with
164      *     the characteristics of the final mesh.
165      */
166     void SetVerboseLevel(in short level);
167     short GetVerboseLevel();
168     /*!
169      * To create new nodes
170      */
171     void SetToCreateNewNodes(in boolean toCreate);
172     boolean GetToCreateNewNodes();
173     /*!
174      * To use boundary recovery version which tries to create mesh on a very poor
175      * quality surface mesh
176      */
177     void SetToUseBoundaryRecoveryVersion(in boolean toUse);
178     boolean GetToUseBoundaryRecoveryVersion();
179     /*!
180      * Applies finite-element correction by replacing overconstrained elements where
181      * it is possible. The process is cutting first the overconstrained edges and
182      * second the overconstrained facets. This insure that no edges have two boundary
183      * vertices and that no facets have three boundary vertices.
184      */
185     void SetFEMCorrection(in boolean toUseFem);
186     boolean GetFEMCorrection();
187     /*!
188      * To removes initial central point.
189      */
190     void SetToRemoveCentralPoint(in boolean toRemove);
191     boolean GetToRemoveCentralPoint();
192     /*!
193      * To define the volumic gradation
194      */
195     void SetGradation(in double gradation);
196     double GetGradation();
197     /*!
198      * Print log in standard output
199      */
200     void SetStandardOutputLog(in boolean logInStandardOutput);
201     boolean GetStandardOutputLog();
202     /*!
203     * Remove log file on success
204     */
205     void SetRemoveLogOnSuccess(in boolean removeLogOnSuccess);
206     boolean GetRemoveLogOnSuccess();
207     /*!
208      * Set advanced option value
209      */
210     void SetOptionValue(in string optionName,
211                         in string optionValue) raises (SALOME::SALOME_Exception);
212     string GetOptionValue(in string optionName) raises (SALOME::SALOME_Exception);
213     void UnsetOption(in string optionName);
214     /*!
215      * Adds custom advanced option and its value
216      */
217     void SetAdvancedOption(in string optionsAndValues) // in a form "option_1 v1 option_2 v2'"
218       raises (SALOME::SALOME_Exception);
219     string GetAdvancedOption();
220     void AddOption(in string optionName, in string optionValue);
221     string GetOption(in string optionName);
222     void SetTextOption(in string option); // obsolete
223     string GetTextOption(); // obsolete
224     /*!
225      * Return array of strings each of which is option name concatenated
226      * with option value devided by semicolon - "option_name:option_value:option_type".
227      * Option value is empty if an option is not set.
228      * option_type: 1 if user-define, 0 if default
229      * Note: the method is mostly for interaction with GUI.
230      */
231     string_array GetOptionValues();
232     string_array GetAdvancedOptionValues();
233     /*!
234      * Set option values each in the form "option_name[:option_value][:option_type]".
235      * Note: the method is mostly for interaction with GUI.
236      */
237     void SetOptionValues(in string_array options) raises (SALOME::SALOME_Exception);
238     void SetAdvancedOptionValues(in string_array options);
239
240     /*!
241      * To set an enforced vertex
242      */
243     boolean SetEnforcedVertex(in double x, in double y, in double z, in double size) raises (SALOME::SALOME_Exception);
244     boolean SetEnforcedVertexNamed(in double x, in double y, in double z, in double size, in string vertexName) raises (SALOME::SALOME_Exception);
245     boolean SetEnforcedVertexWithGroup(in double x, in double y, in double z, in double size, in string groupName) raises (SALOME::SALOME_Exception);
246     boolean SetEnforcedVertexNamedWithGroup(in double x, in double y, in double z, in double size, in string vertexName, in string groupName) raises (SALOME::SALOME_Exception);
247     boolean SetEnforcedVertexGeom(in GEOM::GEOM_Object theVertex, in double size) raises (SALOME::SALOME_Exception);
248     boolean SetEnforcedVertexGeomWithGroup(in GEOM::GEOM_Object theVertex, in double size, in string groupName) raises (SALOME::SALOME_Exception);
249     double GetEnforcedVertex(in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
250     double GetEnforcedVertexGeom(in GEOM::GEOM_Object theVertex) raises (SALOME::SALOME_Exception);
251     boolean RemoveEnforcedVertex(in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
252     boolean RemoveEnforcedVertexGeom(in GEOM::GEOM_Object theVertex) raises (SALOME::SALOME_Exception);
253     GHS3DEnforcedVertexList GetEnforcedVertices();
254     void ClearEnforcedVertices();
255    /*!
256     * Set/get/unset an enforced vertex (private method for GUI)
257     */
258     boolean p_SetEnforcedVertex(in double size, in double x, in double y, in double z,
259                              in string theVertexName, in string theVertexEntry, in string groupName,
260                              in boolean isCompound) raises (SALOME::SALOME_Exception);
261     
262     boolean SetEnforcedMesh(in SMESH::SMESH_IDSource theSource, in SMESH::ElementType elementType) raises (SALOME::SALOME_Exception);
263     boolean SetEnforcedMeshWithGroup(in SMESH::SMESH_IDSource theSource, in SMESH::ElementType elementType, in string groupName) raises (SALOME::SALOME_Exception);
264     
265     /* OBSOLETE FUNCTIONS */
266     boolean SetEnforcedMeshSize(in SMESH::SMESH_IDSource theSource, in SMESH::ElementType elementType, in double size) raises (SALOME::SALOME_Exception);
267     boolean SetEnforcedMeshSizeWithGroup(in SMESH::SMESH_IDSource theSource, in SMESH::ElementType elementType, in double size, in string groupName) raises (SALOME::SALOME_Exception);
268     /* OBSOLETE FUNCTIONS */
269     
270     GHS3DEnforcedMeshList GetEnforcedMeshes();
271     void ClearEnforcedMeshes();
272
273    /*!
274     * Set/get/unset an enforced vertex (private method for GUI)
275     */
276     boolean p_SetEnforcedMesh(in SMESH::SMESH_IDSource theSource, in SMESH::ElementType elementType, in string name, in string groupName) raises (SALOME::SALOME_Exception);
277
278     // GUI methods
279     double GetMaxSizeDefault();
280     double GetMinSizeDefault();
281     void SetMinMaxSizeDefault( in double theMinSize, in double theMaxSize );
282   };
283
284   /*!
285    * GHS3DPlugin_Optimizer: interface of "MG-Tetra Optimization" algorithm
286    */
287   interface GHS3DPlugin_Optimizer : SMESH::SMESH_3D_Algo
288   {
289   };
290
291   enum PThreadsMode { SAFE, AGGRESSIVE, NONE };
292   enum Mode { NO, YES, ONLY };
293
294   /*!
295    * Parameters of "MG-Tetra Optimization" algorithm
296    *
297    * params inherited from GHS3DPlugin_Hypothesis:
298    * - create new nodes
299    * - optimization level
300    * - init and max memory
301    * - work dir
302    * - verbosity
303    * - log to file
304    * - keep work files
305    * - remove log file
306    * - advanced options
307    */
308   interface GHS3DPlugin_OptimizerHypothesis: GHS3DPlugin_Hypothesis
309   {
310     void SetOptimization( in Mode optMode );
311     Mode GetOptimization();
312
313     void SetSplitOverConstrained( in Mode ovcMode );
314     Mode GetSplitOverConstrained();
315
316     void SetSmoothOffSlivers( in boolean toSmooth );
317     boolean GetSmoothOffSlivers();
318
319     void SetPThreadsMode( in PThreadsMode mode );
320     PThreadsMode GetPThreadsMode();
321
322     void SetMaximalNumberOfThreads( in short nb );
323     short GetMaximalNumberOfThreads();
324   };
325
326 };
327
328 #endif