Salome HOME
Copyright update 2021
[plugins/ghs3dplugin.git] / idl / GHS3DPlugin_Algorithm.idl
1 // Copyright (C) 2004-2021  CEA/DEN, EDF R&D
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      * Path to working directory
123      */
124     void SetWorkingDirectory(in string path) raises (SALOME::SALOME_Exception);
125     string GetWorkingDirectory();
126     /*!
127      * To keep working files or remove them. Log file remains in case of errors anyway.
128      */
129     void SetKeepFiles(in boolean toKeep);
130     boolean GetKeepFiles();
131     /*!
132      * Verbose level [0-10]
133      *  0 - no standard output,
134      *  2 - prints the data, quality statistics of the skin and final meshes and
135      *     indicates when the final mesh is being saved. In addition the software
136      *     gives indication regarding the CPU time.
137      * 10 - same as 2 plus the main steps in the computation, quality statistics
138      *     histogram of the skin mesh, quality statistics histogram together with
139      *     the characteristics of the final mesh.
140      */
141     void SetVerboseLevel(in short level);
142     short GetVerboseLevel();
143     /*!
144      * To create new nodes
145      */
146     void SetToCreateNewNodes(in boolean toCreate);
147     boolean GetToCreateNewNodes();
148     /*!
149      * To use boundary recovery version which tries to create mesh on a very poor
150      * quality surface mesh
151      */
152     void SetToUseBoundaryRecoveryVersion(in boolean toUse);
153     boolean GetToUseBoundaryRecoveryVersion();
154     /*!
155      * Applies finite-element correction by replacing overconstrained elements where
156      * it is possible. The process is cutting first the overconstrained edges and
157      * second the overconstrained facets. This insure that no edges have two boundary
158      * vertices and that no facets have three boundary vertices.
159      */
160     void SetFEMCorrection(in boolean toUseFem);
161     boolean GetFEMCorrection();
162     /*!
163      * To removes initial central point.
164      */
165     void SetToRemoveCentralPoint(in boolean toRemove);
166     boolean GetToRemoveCentralPoint();
167     /*!
168      * To define the volumic gradation
169      */
170     void SetGradation(in double gradation);
171     double GetGradation();
172     /*!
173      * Print log in standard output
174      */
175     void SetStandardOutputLog(in boolean logInStandardOutput);
176     boolean GetStandardOutputLog();
177     /*!
178     * Remove log file on success
179     */
180     void SetRemoveLogOnSuccess(in boolean removeLogOnSuccess);
181     boolean GetRemoveLogOnSuccess();
182     /*!
183      * Set advanced option value
184      */
185     void SetOptionValue(in string optionName,
186                         in string optionValue) raises (SALOME::SALOME_Exception);
187     string GetOptionValue(in string optionName) raises (SALOME::SALOME_Exception);
188     void UnsetOption(in string optionName);
189     /*!
190      * Adds custom advanced option and its value
191      */
192     void SetAdvancedOption(in string optionsAndValues) // in a form "option_1 v1 option_2 v2'"
193       raises (SALOME::SALOME_Exception);
194     string GetAdvancedOption();
195     void AddOption(in string optionName, in string optionValue);
196     string GetOption(in string optionName);
197     void SetTextOption(in string option); // obsolete
198     string GetTextOption(); // obsolete
199     /*!
200      * Return array of strings each of which is option name concatenated
201      * with option value devided by semicolon - "option_name:option_value:option_type".
202      * Option value is empty if an option is not set.
203      * option_type: 1 if user-define, 0 if default
204      * Note: the method is mostly for interaction with GUI.
205      */
206     string_array GetOptionValues();
207     string_array GetAdvancedOptionValues();
208     /*!
209      * Set option values each in the form "option_name[:option_value][:option_type]".
210      * Note: the method is mostly for interaction with GUI.
211      */
212     void SetOptionValues(in string_array options) raises (SALOME::SALOME_Exception);
213     void SetAdvancedOptionValues(in string_array options);
214
215     /*!
216      * To set an enforced vertex
217      */
218     boolean SetEnforcedVertex(in double x, in double y, in double z, in double size) raises (SALOME::SALOME_Exception);
219     boolean SetEnforcedVertexNamed(in double x, in double y, in double z, in double size, in string vertexName) raises (SALOME::SALOME_Exception);
220     boolean SetEnforcedVertexWithGroup(in double x, in double y, in double z, in double size, in string groupName) raises (SALOME::SALOME_Exception);
221     boolean SetEnforcedVertexNamedWithGroup(in double x, in double y, in double z, in double size, in string vertexName, in string groupName) raises (SALOME::SALOME_Exception);
222     boolean SetEnforcedVertexGeom(in GEOM::GEOM_Object theVertex, in double size) raises (SALOME::SALOME_Exception);
223     boolean SetEnforcedVertexGeomWithGroup(in GEOM::GEOM_Object theVertex, in double size, in string groupName) raises (SALOME::SALOME_Exception);
224     double GetEnforcedVertex(in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
225     double GetEnforcedVertexGeom(in GEOM::GEOM_Object theVertex) raises (SALOME::SALOME_Exception);
226     boolean RemoveEnforcedVertex(in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
227     boolean RemoveEnforcedVertexGeom(in GEOM::GEOM_Object theVertex) raises (SALOME::SALOME_Exception);
228     GHS3DEnforcedVertexList GetEnforcedVertices();
229     void ClearEnforcedVertices();
230    /*!
231     * Set/get/unset an enforced vertex (private method for GUI)
232     */
233     boolean p_SetEnforcedVertex(in double size, in double x, in double y, in double z,
234                              in string theVertexName, in string theVertexEntry, in string groupName,
235                              in boolean isCompound) raises (SALOME::SALOME_Exception);
236     
237     boolean SetEnforcedMesh(in SMESH::SMESH_IDSource theSource, in SMESH::ElementType elementType) raises (SALOME::SALOME_Exception);
238     boolean SetEnforcedMeshWithGroup(in SMESH::SMESH_IDSource theSource, in SMESH::ElementType elementType, in string groupName) raises (SALOME::SALOME_Exception);
239     
240     /* OBSOLETE FUNCTIONS */
241     boolean SetEnforcedMeshSize(in SMESH::SMESH_IDSource theSource, in SMESH::ElementType elementType, in double size) raises (SALOME::SALOME_Exception);
242     boolean SetEnforcedMeshSizeWithGroup(in SMESH::SMESH_IDSource theSource, in SMESH::ElementType elementType, in double size, in string groupName) raises (SALOME::SALOME_Exception);
243     /* OBSOLETE FUNCTIONS */
244     
245     GHS3DEnforcedMeshList GetEnforcedMeshes();
246     void ClearEnforcedMeshes();
247
248    /*!
249     * Set/get/unset an enforced vertex (private method for GUI)
250     */
251     boolean p_SetEnforcedMesh(in SMESH::SMESH_IDSource theSource, in SMESH::ElementType elementType, in string name, in string groupName) raises (SALOME::SALOME_Exception);
252
253     // GUI methods
254     double GetMaxSizeDefault();
255     double GetMinSizeDefault();
256     void SetMinMaxSizeDefault( in double theMinSize, in double theMaxSize );
257   };
258
259   /*!
260    * GHS3DPlugin_Optimizer: interface of "MG-Tetra Optimization" algorithm
261    */
262   interface GHS3DPlugin_Optimizer : SMESH::SMESH_3D_Algo
263   {
264   };
265
266   enum PThreadsMode { SAFE, AGGRESSIVE, NONE };
267   enum Mode { NO, YES, ONLY };
268
269   /*!
270    * Parameters of "MG-Tetra Optimization" algorithm
271    *
272    * params inherited from GHS3DPlugin_Hypothesis:
273    * - create new nodes
274    * - optimization level
275    * - init and max memory
276    * - work dir
277    * - verbosity
278    * - log to file
279    * - keep work files
280    * - remove log file
281    * - advanced options
282    */
283   interface GHS3DPlugin_OptimizerHypothesis: GHS3DPlugin_Hypothesis
284   {
285     void SetOptimization( in Mode optMode );
286     Mode GetOptimization();
287
288     void SetSplitOverConstrained( in Mode ovcMode );
289     Mode GetSplitOverConstrained();
290
291     void SetSmoothOffSlivers( in boolean toSmooth );
292     boolean GetSmoothOffSlivers();
293
294     void SetPThreadsMode( in PThreadsMode mode );
295     PThreadsMode GetPThreadsMode();
296
297     void SetMaximalNumberOfThreads( in short nb );
298     short GetMaximalNumberOfThreads();
299   };
300
301 };
302
303 #endif