1 // Copyright (C) 2007-2020 CEA/DEN, EDF R&D
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
21 // File : HYBRIDPlugin_Hypothesis_i.hxx
22 // Author : Christian VAN WAMBEKE (CEA)
25 #ifndef _HYBRIDPlugin_Hypothesis_i_HXX_
26 #define _HYBRIDPlugin_Hypothesis_i_HXX_
28 #include "HYBRIDPlugin_Defs.hxx"
30 #include <SALOMEconfig.h>
31 #include CORBA_SERVER_HEADER(HYBRIDPlugin_Algorithm)
33 #include "SMESH_Hypothesis_i.hxx"
34 #include "SMESH_Mesh_i.hxx"
35 #include "HYBRIDPlugin_Hypothesis.hxx"
39 // HYBRIDPlugin parameters hypothesis
41 class HYBRIDPLUGIN_EXPORT HYBRIDPlugin_Hypothesis_i:
42 public virtual POA_HYBRIDPlugin::HYBRIDPlugin_Hypothesis,
43 public virtual SMESH_Hypothesis_i
47 HYBRIDPlugin_Hypothesis_i (PortableServer::POA_ptr thePOA,
48 ::SMESH_Gen* theGenImpl);
50 virtual ~HYBRIDPlugin_Hypothesis_i();
53 * Sizes of boundary layers are relative to the surface size. Default no
55 void SetHeightIsRelative( CORBA::Boolean isRelative );
56 CORBA::Boolean GetHeightIsRelative();
58 * Maximum internal angles of boundary elements (in degree)
60 void SetBoundaryLayersMaxElemAngle( CORBA::Double angle );
61 CORBA::Double GetBoundaryLayersMaxElemAngle();
63 * To mesh "holes" in a solid or not. Default is to mesh.
65 void SetToMeshHoles(CORBA::Boolean toMesh);
66 CORBA::Boolean GetToMeshHoles();
68 * IDs of faces to grow the layers on
70 void SetFacesWithLayers(const SMESH::long_array& faceIDs);
71 SMESH::long_array* GetFacesWithLayers();
73 * IDs of faces to imprint the layers on
75 void SetFacesWithImprinting(const SMESH::long_array& faceIDs);
76 SMESH::long_array* GetFacesWithImprinting();
78 * IDs of faces to snap the layers on (faces that already have surface layers)
80 void SetFacesWithSnapping(const SMESH::long_array& faceIDs);
81 SMESH::long_array* GetFacesWithSnapping();
83 * To mesh "layers on all wrap". Default is to mesh.
85 void SetLayersOnAllWrap(CORBA::Boolean toMesh);
86 CORBA::Boolean GetLayersOnAllWrap();
88 * To make groups of volumes of different domains when mesh is generated from skin.
89 * Default is to make groups.
90 * This option works only (1) for the mesh w/o shape and (2) if GetToMeshHoles() == true
92 void SetToMakeGroupsOfDomains(CORBA::Boolean toMakeGroups);
93 CORBA::Boolean GetToMakeGroupsOfDomains();
95 * Maximal size of memory to be used by the algorithm (in Megabytes)
97 void SetMaximumMemory(CORBA::Double MB) throw ( SALOME::SALOME_Exception );
98 CORBA::Double GetMaximumMemory();
100 * Initial size of memory to be used by the algorithm (in Megabytes) in
101 * automatic memory adjustment mode. Default is zero
103 void SetInitialMemory(CORBA::Double MB) throw ( SALOME::SALOME_Exception );
104 CORBA::Double GetInitialMemory();
106 * Optimization level: 0-none, 1-light, 2-medium, 3-strong. Default is medium
108 void SetOptimizationLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception );
109 CORBA::Short GetOptimizationLevel();
111 * Collision Mode: 0-decrease, 1-stop. Default is decrease
113 void SetCollisionMode(CORBA::Short mode) throw ( SALOME::SALOME_Exception );
114 CORBA::Short GetCollisionMode();
116 * Path to working directory
118 void SetWorkingDirectory(const char* path) throw ( SALOME::SALOME_Exception );
119 char* GetWorkingDirectory();
121 * To keep working files or remove them. Log file remains in case of errors anyway.
123 void SetKeepFiles(CORBA::Boolean toKeep);
124 CORBA::Boolean GetKeepFiles();
126 * Verbose level [0-10]
127 * 0 - no standard output,
128 * 2 - prints the data, quality statistics of the skin and final meshes and
129 * indicates when the final mesh is being saved. In addition the software
130 * gives indication regarding the CPU time.
131 * 10 - same as 2 plus the main steps in the computation, quality statistics
132 * histogram of the skin mesh, quality statistics histogram together with
133 * the characteristics of the final mesh.
135 void SetVerboseLevel(CORBA::Short level) throw ( SALOME::SALOME_Exception );
136 CORBA::Short GetVerboseLevel();
138 * To create new nodes
140 void SetToCreateNewNodes(CORBA::Boolean toCreate);
141 CORBA::Boolean GetToCreateNewNodes();
143 * To use boundary recovery version which tries to create mesh on a very poor
144 * quality surface mesh
146 void SetToUseBoundaryRecoveryVersion(CORBA::Boolean toUse);
147 CORBA::Boolean GetToUseBoundaryRecoveryVersion();
149 * Applies finite-element correction by replacing overconstrained elements where
150 * it is possible. The process is cutting first the overconstrained edges and
151 * second the overconstrained facets. This insure that no edges have two boundary
152 * vertices and that no facets have three boundary vertices.
154 void SetFEMCorrection(CORBA::Boolean toUseFem);
155 CORBA::Boolean GetFEMCorrection();
157 * To removes initial central point.
159 void SetToRemoveCentralPoint(CORBA::Boolean toRemove);
160 CORBA::Boolean GetToRemoveCentralPoint();
162 void SetOptionValue(const char* optionName, const char* optionValue) throw (SALOME::SALOME_Exception);
163 char* GetOptionValue(const char* optionName) throw (SALOME::SALOME_Exception);
164 void UnsetOption(const char* optionName);
166 HYBRIDPlugin::string_array* GetOptionValues();
167 HYBRIDPlugin::string_array* GetAdvancedOptionValues();
169 void SetOptionValues(const HYBRIDPlugin::string_array& options) throw (SALOME::SALOME_Exception);
170 void SetAdvancedOptionValues(const HYBRIDPlugin::string_array& options);
172 void AddOption(const char* optionName, const char* optionValue);
173 char* GetOption(const char* optionName);
175 * To set hiden/undocumented/advanced options
177 void SetAdvancedOption(const char* theOptAndVals ) throw (SALOME::SALOME_Exception);
178 char* GetAdvancedOption();
179 void SetTextOption(const char* option);
180 char* GetTextOption();
182 * To define the volumic gradation
184 void SetGradation(CORBA::Double gradation);
185 CORBA::Double GetGradation();
187 * Print log in standard output
189 void SetStandardOutputLog(CORBA::Boolean logInStandardOutput);
190 CORBA::Boolean GetStandardOutputLog();
192 * Remove log file on success
194 void SetRemoveLogOnSuccess(CORBA::Boolean removeLogOnSuccess);
195 CORBA::Boolean GetRemoveLogOnSuccess();
197 void SetBoundaryLayersGrowth(CORBA::Short mode) throw ( SALOME::SALOME_Exception );
198 CORBA::Short GetBoundaryLayersGrowth();
200 void SetElementGeneration(CORBA::Short mode) throw ( SALOME::SALOME_Exception );
201 CORBA::Short GetElementGeneration();
203 void SetAddMultinormals(CORBA::Boolean toAddMultinormals);
204 CORBA::Boolean GetAddMultinormals();
206 void SetSmoothNormals(CORBA::Boolean toSmoothNormals);
207 CORBA::Boolean GetSmoothNormals();
209 void SetHeightFirstLayer(CORBA::Double toHeightFirstLayer);
210 CORBA::Double GetHeightFirstLayer();
212 void SetBoundaryLayersProgression(CORBA::Double toBoundaryLayersProgression);
213 CORBA::Double GetBoundaryLayersProgression();
215 void SetCoreSize(CORBA::Double toCoreSize);
216 CORBA::Double GetCoreSize();
218 void SetMultinormalsAngle(CORBA::Double toMultinormalsAngle);
219 CORBA::Double GetMultinormalsAngle();
221 void SetNbOfBoundaryLayers(CORBA::Short toNbOfBoundaryLayers);
222 CORBA::Short GetNbOfBoundaryLayers();
225 * To set an enforced vertex
227 bool p_SetEnforcedVertex(CORBA::Double size, CORBA::Double x = 0, CORBA::Double y = 0, CORBA::Double z = 0,
228 const char* theVertexName = "", const char* theVertexEntry = "", const char* theGroupName = "",
229 CORBA::Boolean isCompound = false)
230 throw (SALOME::SALOME_Exception);
231 bool SetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size) throw (SALOME::SALOME_Exception);
232 bool SetEnforcedVertexNamed(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName) throw (SALOME::SALOME_Exception);
233 bool SetEnforcedVertexWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
234 bool SetEnforcedVertexNamedWithGroup(CORBA::Double x, CORBA::Double y, CORBA::Double z, CORBA::Double size, const char* theVertexName, const char* theGroupName) throw (SALOME::SALOME_Exception);
235 bool SetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size) throw (SALOME::SALOME_Exception);
236 bool SetEnforcedVertexGeomWithGroup(GEOM::GEOM_Object_ptr theVertex, CORBA::Double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
237 CORBA::Double GetEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception);
238 CORBA::Double GetEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) throw (SALOME::SALOME_Exception);
239 bool RemoveEnforcedVertex(CORBA::Double x, CORBA::Double y, CORBA::Double z) throw (SALOME::SALOME_Exception);
240 bool RemoveEnforcedVertexGeom(GEOM::GEOM_Object_ptr theVertex) throw (SALOME::SALOME_Exception);
241 HYBRIDPlugin::HYBRIDEnforcedVertexList* GetEnforcedVertices();
242 void ClearEnforcedVertices();
244 * To set an enforced mesh
246 bool p_SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theName="", const char* theGroupName="") throw (SALOME::SALOME_Exception);
247 bool SetEnforcedMesh(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType) throw (SALOME::SALOME_Exception);
248 bool SetEnforcedMeshWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, const char* theGroupName) throw (SALOME::SALOME_Exception);
250 /* OBSOLETE FUNCTIONS */
251 bool SetEnforcedMeshSize(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double size) throw (SALOME::SALOME_Exception);
252 bool SetEnforcedMeshSizeWithGroup(SMESH::SMESH_IDSource_ptr theSource, SMESH::ElementType elementType, double size, const char* theGroupName) throw (SALOME::SALOME_Exception);
253 /* OBSOLETE FUNCTIONS */
255 HYBRIDPlugin::HYBRIDEnforcedMeshList* GetEnforcedMeshes();
256 void ClearEnforcedMeshes();
258 // Get implementation
259 ::HYBRIDPlugin_Hypothesis* GetImpl();
261 // Verify whether hypothesis supports given entity type
262 CORBA::Boolean IsDimSupported( SMESH::Dimension type );
264 // Methods for copying mesh definition to other geometry
265 virtual bool getObjectsDependOn( std::vector< std::string > & entryArray,
266 std::vector< int > & subIDArray ) const { return false; }
267 virtual bool setObjectsDependOn( std::vector< std::string > & entryArray,
268 std::vector< int > & subIDArray ) { return true; }