Salome HOME
Copyright update 2022
[plugins/hybridplugin.git] / idl / HYBRIDPlugin_Algorithm.idl
1 // Copyright (C) 2007-2022  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 // ---
21 // File   : HYBRIDPlugin_Algorithm.idl
22 // Author : Christian VAN WAMBEKE (CEA)
23 // ---
24 //
25 #ifndef _HYBRID_Algorithm_IDL_
26 #define _HYBRID_Algorithm_IDL_
27
28 #include "SALOME_Exception.idl"
29 #include "SMESH_Hypothesis.idl"
30 #include "SMESH_Mesh.idl"
31
32 /*!
33  * HYBRIDPlugin: interfaces to HYBRID related hypotheses and algorithms
34  */
35 module HYBRIDPlugin
36 {
37   typedef sequence<string> string_array;
38
39   typedef sequence<double,3> TCoords;
40   struct HYBRIDEnforcedVertex {
41     string name;
42     string geomEntry;
43     boolean isCompound;
44     TCoords coords;
45     string groupName;
46     double size;
47   };
48   
49   typedef sequence<HYBRIDEnforcedVertex> HYBRIDEnforcedVertexList;
50
51   struct HYBRIDEnforcedMesh {
52     string name;
53     string entry;
54     SMESH::ElementType elementType;
55     string groupName;
56   };
57   
58   typedef sequence<HYBRIDEnforcedMesh> HYBRIDEnforcedMeshList;
59
60   /*!
61    * HYBRIDPlugin_HYBRID: interface of "Tetra-hexahedron (HYBRID)" algorithm
62    */
63   interface HYBRIDPlugin_HYBRID : SMESH::SMESH_3D_Algo
64   {
65     SMESH::SMESH_Mesh importGMFMesh(in string aGMFFileName);
66   };
67
68   /*!
69    * Parameters of "Tetra-hexahedron (HYBRID)" algorithm
70    */
71   interface HYBRIDPlugin_Hypothesis : SMESH::SMESH_Hypothesis
72   {
73     /*!
74      * Sizes of boundary layers are relative to the surface size. Default no
75      */
76     void SetHeightIsRelative( in boolean isRelative );
77     boolean GetHeightIsRelative();
78     /*!
79      * Maximum internal angles of boundary elements (in degree)
80      */
81     void SetBoundaryLayersMaxElemAngle( in double angle );
82     double GetBoundaryLayersMaxElemAngle();
83     /*!
84      * To mesh "holes" in a solid or not. Default is to mesh.
85      */
86     void SetToMeshHoles(in boolean toMesh);
87     boolean GetToMeshHoles();
88     /*!
89      * To mesh layers on all wrap Default is yes.
90      */
91     void SetLayersOnAllWrap(in boolean toMesh);
92     boolean GetLayersOnAllWrap();
93     /*!
94      * To mesh layers on given faces.
95      */
96     void SetFacesWithLayers(in SMESH::long_array faceIDs);
97     SMESH::long_array GetFacesWithLayers();
98     /*!
99      * To imprint layers on given faces.
100      */
101     void SetFacesWithImprinting(in SMESH::long_array faceIDs);
102     SMESH::long_array GetFacesWithImprinting();
103     /*!
104      * To snap layers on given faces.
105      */
106     void SetFacesWithSnapping(in SMESH::long_array faceIDs);
107     SMESH::long_array GetFacesWithSnapping();
108     /*!
109      * To make groups of volumes of different domains when mesh is generated from skin.
110      * Default is to make groups.
111      * This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true
112      */
113     void SetToMakeGroupsOfDomains(in boolean toMakeGroups);
114     boolean GetToMakeGroupsOfDomains();
115     /*!
116      * Maximal size of memory to be used by the algorithm (in Megabytes).
117      * Negative value means not to use this option
118      */
119     void SetMaximumMemory(in double MB) raises (SALOME::SALOME_Exception);
120     double GetMaximumMemory();
121     /*!
122      * Initial size of memory to be used by the algorithm (in Megabytes) in
123      * automatic memory adjustment mode. Default is zero.
124      * Negative value means not to use this option
125      */
126     void SetInitialMemory(in double MB) raises (SALOME::SALOME_Exception);
127     double GetInitialMemory();
128     /*!
129      * Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
130      */
131     void SetOptimizationLevel(in short level) raises (SALOME::SALOME_Exception);
132     short GetOptimizationLevel();
133
134
135     /*!
136      * Collision mode: 0-decrease, 1-stop. Default is decrease
137      */
138     void SetCollisionMode(in short level) raises (SALOME::SALOME_Exception);
139     short GetCollisionMode();
140     /*!
141      * BoundaryLayersGrowth: 0-Layer_Growth_Inward, 1-Layer_Growth_Outward. Default is Layer_Growth_Inward
142      */
143     void SetBoundaryLayersGrowth(in short level) raises (SALOME::SALOME_Exception);
144     short GetBoundaryLayersGrowth();
145     /*!
146      * ElementGeneration: 0-Generation_Tetra_Dominant, 1-Generation_Hexa_Dominant, 2-Generation_Cartesian_Core. Default is Generation_Tetra_Dominant
147      */
148     void SetElementGeneration(in short level) raises (SALOME::SALOME_Exception);
149     short GetElementGeneration();
150     
151     /*!
152      * To mesh adding extra normals at opening ridges and corners.
153      * Default is no.
154      */
155     void SetAddMultinormals(in boolean toAddMultinormals);
156     boolean GetAddMultinormals();
157     /*!
158      * To mesh smoothing normals at closed ridges and corners.
159      * Default is no.
160      */
161     void SetSmoothNormals(in boolean toSmoothNormals);
162     boolean GetSmoothNormals();
163     /*!
164      * To set height of the first layer.
165      */
166     void SetHeightFirstLayer(in double HFL) raises (SALOME::SALOME_Exception);
167     double GetHeightFirstLayer();
168     /*!
169      * To set boundary layers coefficient of geometric progression.
170      * Default is 1.0
171      */
172     void SetBoundaryLayersProgression(in double BLP) raises (SALOME::SALOME_Exception);
173     double GetBoundaryLayersProgression();
174     /*!
175      * To set core size.
176      * Default is 0.0
177      */
178     void SetCoreSize(in double CS) raises (SALOME::SALOME_Exception);
179     double GetCoreSize();
180     /*!
181      * To set multinormals angle threshold at opening ridges.
182      * Default is 30.0
183      */
184     void SetMultinormalsAngle(in double MNA) raises (SALOME::SALOME_Exception);
185     double GetMultinormalsAngle();
186     /*!
187      * To set number of boundary layers.
188      * Default is 1
189      */
190     void SetNbOfBoundaryLayers(in short NBL) raises (SALOME::SALOME_Exception);
191     short GetNbOfBoundaryLayers();
192     
193  
194
195     /*!
196      * Path to working directory
197      */
198     void SetWorkingDirectory(in string path) raises (SALOME::SALOME_Exception);
199     string GetWorkingDirectory();
200     /*!
201      * To keep working files or remove them. Log file remains in case of errors anyway.
202      */
203     void SetKeepFiles(in boolean toKeep);
204     boolean GetKeepFiles();
205     /*!
206      * Verbose level [0-10]
207      *  0 - no standard output,
208      *  2 - prints the data, quality statistics of the skin and final meshes and
209      *     indicates when the final mesh is being saved. In addition the software
210      *     gives indication regarding the CPU time.
211      * 10 - same as 2 plus the main steps in the computation, quality statistics
212      *     histogram of the skin mesh, quality statistics histogram together with
213      *     the characteristics of the final mesh.
214      */
215     void SetVerboseLevel(in short level);
216     short GetVerboseLevel();
217     /*!
218      * To create new nodes
219      */
220     void SetToCreateNewNodes(in boolean toCreate);
221     boolean GetToCreateNewNodes();
222     /*!
223      * To use boundary recovery version which tries to create mesh on a very poor
224      * quality surface mesh
225      */
226     void SetToUseBoundaryRecoveryVersion(in boolean toUse);
227     boolean GetToUseBoundaryRecoveryVersion();
228     /*!
229      * Applies finite-element correction by replacing overconstrained elements where
230      * it is possible. The process is cutting first the overconstrained edges and
231      * second the overconstrained facets. This insure that no edges have two boundary
232      * vertices and that no facets have three boundary vertices.
233      */
234     void SetFEMCorrection(in boolean toUseFem);
235     boolean GetFEMCorrection();
236     /*!
237      * To removes initial central point.
238      */
239     void SetToRemoveCentralPoint(in boolean toRemove);
240     boolean GetToRemoveCentralPoint();
241     /*!
242      * Set advanced option value
243      */
244     void SetOptionValue(in string optionName,
245                         in string optionValue) raises (SALOME::SALOME_Exception);
246     string GetOptionValue(in string optionName) raises (SALOME::SALOME_Exception);
247     void UnsetOption(in string optionName);
248     /*!
249      * Adds custom advanced option and its value
250      */
251     void SetAdvancedOption(in string optionsAndValues) // in a form "option_1 v1 option_2 v2'"
252       raises (SALOME::SALOME_Exception);
253     string GetAdvancedOption();
254     void AddOption(in string optionName, in string optionValue);
255     string GetOption(in string optionName);
256     void SetTextOption(in string option); // obsolete
257     string GetTextOption(); // obsolete
258     /*!
259      * Return array of strings each of which is option name concatenated
260      * with option value devided by semicolon - "option_name:option_value:option_type".
261      * Option value is empty if an option is not set.
262      * option_type: 1 if user-define, 0 if default
263      * Note: the method is mostly for interaction with GUI.
264      */
265     string_array GetOptionValues();
266     string_array GetAdvancedOptionValues();
267     /*!
268      * Set option values each in the form "option_name[:option_value][:option_type]".
269      * Note: the method is mostly for interaction with GUI.
270      */
271     void SetOptionValues(in string_array options) raises (SALOME::SALOME_Exception);
272     void SetAdvancedOptionValues(in string_array options);
273
274     /*!
275      * To define the volumic gradation
276      */
277     void SetGradation(in double gradation);
278     double GetGradation();
279     /*!
280      * Print log in standard output
281      */
282     void SetStandardOutputLog(in boolean logInStandardOutput);
283     boolean GetStandardOutputLog();
284     /*!
285     * Remove log file on success
286     */
287     void SetRemoveLogOnSuccess(in boolean removeLogOnSuccess);
288     boolean GetRemoveLogOnSuccess();
289     /*!
290      * To set an enforced vertex
291      */
292     boolean SetEnforcedVertex(in double x, in double y, in double z, in double size) raises (SALOME::SALOME_Exception);
293     boolean SetEnforcedVertexNamed(in double x, in double y, in double z, in double size, in string vertexName) raises (SALOME::SALOME_Exception);
294     boolean SetEnforcedVertexWithGroup(in double x, in double y, in double z, in double size, in string groupName) raises (SALOME::SALOME_Exception);
295     boolean SetEnforcedVertexNamedWithGroup(in double x, in double y, in double z, in double size, in string vertexName, in string groupName) raises (SALOME::SALOME_Exception);
296     boolean SetEnforcedVertexGeom(in GEOM::GEOM_Object theVertex, in double size) raises (SALOME::SALOME_Exception);
297     boolean SetEnforcedVertexGeomWithGroup(in GEOM::GEOM_Object theVertex, in double size, in string groupName) raises (SALOME::SALOME_Exception);
298     double GetEnforcedVertex(in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
299     double GetEnforcedVertexGeom(in GEOM::GEOM_Object theVertex) raises (SALOME::SALOME_Exception);
300     boolean RemoveEnforcedVertex(in double x, in double y, in double z) raises (SALOME::SALOME_Exception);
301     boolean RemoveEnforcedVertexGeom(in GEOM::GEOM_Object theVertex) raises (SALOME::SALOME_Exception);
302     HYBRIDEnforcedVertexList GetEnforcedVertices();
303     void ClearEnforcedVertices();
304    /*!
305     * Set/get/unset an enforced vertex (private method for GUI)
306     */
307     boolean p_SetEnforcedVertex(in double size, in double x, in double y, in double z,
308                                 in string theVertexName, in string theVertexEntry, in string groupName,
309                                 in boolean isCompound) raises (SALOME::SALOME_Exception);
310     
311     boolean SetEnforcedMesh(in SMESH::SMESH_IDSource theSource, in SMESH::ElementType elementType) raises (SALOME::SALOME_Exception);
312     boolean SetEnforcedMeshWithGroup(in SMESH::SMESH_IDSource theSource, in SMESH::ElementType elementType, in string groupName) raises (SALOME::SALOME_Exception);
313     
314     /* OBSOLETE FUNCTIONS */
315     boolean SetEnforcedMeshSize(in SMESH::SMESH_IDSource theSource, in SMESH::ElementType elementType, in double size) raises (SALOME::SALOME_Exception);
316     boolean SetEnforcedMeshSizeWithGroup(in SMESH::SMESH_IDSource theSource, in SMESH::ElementType elementType, in double size, in string groupName) raises (SALOME::SALOME_Exception);
317     /* OBSOLETE FUNCTIONS */
318     
319     HYBRIDEnforcedMeshList GetEnforcedMeshes();
320     void ClearEnforcedMeshes();
321
322    /*!
323     * Set/get/unset an enforced vertex (private method for GUI)
324     */
325     boolean p_SetEnforcedMesh(in SMESH::SMESH_IDSource theSource, in SMESH::ElementType elementType, in string name, in string groupName) raises (SALOME::SALOME_Exception);
326   };
327 };
328
329 #endif