]> SALOME platform Git repositories - plugins/hybridplugin.git/blob - src/HYBRIDPlugin/HYBRIDPlugin_Hypothesis_i.hxx
Salome HOME
Update copyrights
[plugins/hybridplugin.git] / src / HYBRIDPlugin / HYBRIDPlugin_Hypothesis_i.hxx
1 // Copyright (C) 2007-2019  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_Hypothesis_i.hxx
22 // Author : Christian VAN WAMBEKE (CEA)
23 // ---
24 //
25 #ifndef _HYBRIDPlugin_Hypothesis_i_HXX_
26 #define _HYBRIDPlugin_Hypothesis_i_HXX_
27
28 #include "HYBRIDPlugin_Defs.hxx"
29
30 #include <SALOMEconfig.h>
31 #include CORBA_SERVER_HEADER(HYBRIDPlugin_Algorithm)
32
33 #include "SMESH_Hypothesis_i.hxx"
34 #include "SMESH_Mesh_i.hxx"
35 #include "HYBRIDPlugin_Hypothesis.hxx"
36
37 class SMESH_Gen;
38
39 // HYBRIDPlugin parameters hypothesis
40
41 class HYBRIDPLUGIN_EXPORT HYBRIDPlugin_Hypothesis_i:
42   public virtual POA_HYBRIDPlugin::HYBRIDPlugin_Hypothesis,
43   public virtual SMESH_Hypothesis_i
44 {
45  public:
46   // Constructor
47   HYBRIDPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
48                              ::SMESH_Gen*            theGenImpl);
49   // Destructor
50   virtual ~HYBRIDPlugin_Hypothesis_i();
51
52   /*!
53    * To mesh "holes" in a solid or not. Default is to mesh.
54    */
55   void SetToMeshHoles(CORBA::Boolean toMesh);
56   CORBA::Boolean GetToMeshHoles();
57    /*!
58    * IDs of faces to grow the layers on
59    */
60   void SetFacesWithLayers(const SMESH::long_array& faceIDs);
61   SMESH::long_array* GetFacesWithLayers();
62   /*!
63    * IDs of faces to imprint the layers on
64    */
65   void SetFacesWithImprinting(const SMESH::long_array& faceIDs);
66   SMESH::long_array* GetFacesWithImprinting();
67   /*!
68    * IDs of faces to snap the layers on (faces that already have surface layers)
69    */
70   void SetFacesWithSnapping(const SMESH::long_array& faceIDs);
71   SMESH::long_array* GetFacesWithSnapping();
72   /*!
73    * To mesh "layers on all wrap". Default is to mesh.
74    */
75   void SetLayersOnAllWrap(CORBA::Boolean toMesh);
76   CORBA::Boolean GetLayersOnAllWrap();
77   /*!
78    * To make groups of volumes of different domains when mesh is generated from skin.
79    * Default is to make groups.
80    * This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true
81    */
82   void SetToMakeGroupsOfDomains(CORBA::Boolean toMakeGroups);
83   CORBA::Boolean GetToMakeGroupsOfDomains();
84   /*!
85    * Maximal size of memory to be used by the algorithm (in Megabytes)
86    */
87   void SetMaximumMemory(CORBA::Double MB) throw ( SALOME::SALOME_Exception );
88   CORBA::Double GetMaximumMemory();
89   /*!
90    * Initial size of memory to be used by the algorithm (in Megabytes) in
91    * automatic memory adjustment mode. Default is zero
92    */
93   void SetInitialMemory(CORBA::Double MB) throw ( SALOME::SALOME_Exception );
94   CORBA::Double GetInitialMemory();
95   /*!
96    * Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
97    */
98   void SetOptimizationLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception );
99   CORBA::Short GetOptimizationLevel();
100   /*!
101    * Collision Mode: 0-decrease, 1-stop. Default is decrease
102    */
103   void SetCollisionMode(CORBA::Short mode) throw ( SALOME::SALOME_Exception );
104   CORBA::Short GetCollisionMode();
105   /*!
106    * Path to working directory
107    */
108   void SetWorkingDirectory(const char* path) throw ( SALOME::SALOME_Exception );
109   char* GetWorkingDirectory();
110   /*!
111    * To keep working files or remove them. Log file remains in case of errors anyway.
112    */
113   void SetKeepFiles(CORBA::Boolean toKeep);
114   CORBA::Boolean GetKeepFiles();
115   /*!
116    * Verbose level [0-10]
117    *  0 - no standard output,
118    *  2 - prints the data, quality statistics of the skin and final meshes and
119    *     indicates when the final mesh is being saved. In addition the software
120    *     gives indication regarding the CPU time.
121    * 10 - same as 2 plus the main steps in the computation, quality statistics
122    *     histogram of the skin mesh, quality statistics histogram together with
123    *     the characteristics of the final mesh.
124    */
125   void SetVerboseLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception );
126   CORBA::Short GetVerboseLevel();
127   /*!
128    * To create new nodes
129    */
130   void SetToCreateNewNodes(CORBA::Boolean toCreate);
131   CORBA::Boolean GetToCreateNewNodes();
132   /*!
133    * To use boundary recovery version which tries to create mesh on a very poor
134    * quality surface mesh
135    */
136   void SetToUseBoundaryRecoveryVersion(CORBA::Boolean toUse);
137   CORBA::Boolean GetToUseBoundaryRecoveryVersion();
138   /*!
139    * Applies finite-element correction by replacing overconstrained elements where
140    * it is possible. The process is cutting first the overconstrained edges and
141    * second the overconstrained facets. This insure that no edges have two boundary
142    * vertices and that no facets have three boundary vertices.
143    */
144   void SetFEMCorrection(CORBA::Boolean toUseFem);
145   CORBA::Boolean GetFEMCorrection();
146   /*!
147    * To removes initial central point.
148    */
149   void SetToRemoveCentralPoint(CORBA::Boolean toRemove);
150   CORBA::Boolean GetToRemoveCentralPoint();
151   /*!
152    * To set hiden/undocumented/advanced options
153    */
154   void SetAdvancedOption(const char* theOptAndVals );
155   char* GetAdvancedOption();
156   void SetTextOption(const char* option);
157   char* GetTextOption();
158   /*!
159   * To define the volumic gradation
160   */
161   void SetGradation(CORBA::Double gradation);
162   CORBA::Double GetGradation();
163   /*!
164   * Print log in standard output
165   */
166   void SetStandardOutputLog(CORBA::Boolean logInStandardOutput);
167   CORBA::Boolean GetStandardOutputLog();
168   /*!
169   * Remove log file on success
170   */
171   void SetRemoveLogOnSuccess(CORBA::Boolean removeLogOnSuccess);
172   CORBA::Boolean GetRemoveLogOnSuccess();
173   
174   void SetBoundaryLayersGrowth(CORBA::Short mode) throw ( SALOME::SALOME_Exception );
175   CORBA::Short GetBoundaryLayersGrowth();
176
177   void SetElementGeneration(CORBA::Short mode) throw ( SALOME::SALOME_Exception );
178   CORBA::Short GetElementGeneration();
179
180   void SetAddMultinormals(CORBA::Boolean toAddMultinormals);
181   CORBA::Boolean GetAddMultinormals();
182
183   void SetSmoothNormals(CORBA::Boolean toSmoothNormals);
184   CORBA::Boolean GetSmoothNormals();
185
186   void SetHeightFirstLayer(CORBA::Double toHeightFirstLayer);
187   CORBA::Double GetHeightFirstLayer();
188
189   void SetBoundaryLayersProgression(CORBA::Double toBoundaryLayersProgression);
190   CORBA::Double GetBoundaryLayersProgression();
191   
192   void SetCoreSize(CORBA::Double toCoreSize);
193   CORBA::Double GetCoreSize();
194
195   void SetMultinormalsAngle(CORBA::Double toMultinormalsAngle);
196   CORBA::Double GetMultinormalsAngle();
197   
198   void SetNbOfBoundaryLayers(CORBA::Short toNbOfBoundaryLayers);
199   CORBA::Short GetNbOfBoundaryLayers();
200
201   /*!
202    * To set an enforced vertex
203    */
204   bool p_SetEnforcedVertex(CORBA::Double size, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0,
205                            const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "",
206                            CORBA::Boolean isCompound = false) 
207     throw (SALOME::SALOME_Exception);
208   bool SetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size) throw (SALOME::SALOME_Exception);
209   bool SetEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName) throw (SALOME::SALOME_Exception);
210   bool SetEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
211   bool SetEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName, const char* theGroupName) throw (SALOME::SALOME_Exception);
212   bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size) throw (SALOME::SALOME_Exception);
213   bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
214   CORBA::Double GetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception);
215   CORBA::Double GetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) throw (SALOME::SALOME_Exception);
216   bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception);
217   bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) throw (SALOME::SALOME_Exception);
218   HYBRIDPlugin::HYBRIDEnforcedVertexList* GetEnforcedVertices();
219   void ClearEnforcedVertices();
220   /*!
221    * To set an enforced mesh
222    */  
223   bool p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theName="", const char* theGroupName="") throw (SALOME::SALOME_Exception);
224   bool SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType) throw (SALOME::SALOME_Exception);
225   bool SetEnforcedMeshWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theGroupName) throw (SALOME::SALOME_Exception);
226
227   /* OBSOLETE FUNCTIONS */
228   bool SetEnforcedMeshSize(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double size) throw (SALOME::SALOME_Exception);
229   bool SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
230   /* OBSOLETE FUNCTIONS */
231
232   HYBRIDPlugin::HYBRIDEnforcedMeshList* GetEnforcedMeshes();
233   void ClearEnforcedMeshes();
234
235   // Get implementation
236   ::HYBRIDPlugin_Hypothesis* GetImpl();
237
238   // Verify whether hypothesis supports given entity type
239   CORBA::Boolean IsDimSupported( SMESH::Dimension type );
240   
241   // Methods for copying mesh definition to other geometry
242   virtual bool getObjectsDependOn( std::vector< std::string > & entryArray,
243                                    std::vector< int >         & subIDArray ) const { return false; }
244   virtual bool setObjectsDependOn( std::vector< std::string > & entryArray,
245                                    std::vector< int >         & subIDArray ) { return true; }
246 };
247
248 #endif