1 # Copyright (C) 2007-2014 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 # @package GHS3DPRLPluginBuilder
22 # Python API for the GHS3DPRL meshing plug-in module.
24 from salome.smesh.smesh_algorithm import Mesh_Algorithm
25 from salome.smesh.smeshBuilder import AssureGeomPublished
27 # import GHS3DPRLPlugin module if possible
35 # Optimization level of GHS3D
37 None_Optimization, Light_Optimization, Medium_Optimization, Strong_Optimization = 0,1,2,3
38 # V4.1 (partialy redefines V3.1). Issue 0020574
39 None_Optimization, Light_Optimization, Standard_Optimization, StandardPlus_Optimization, Strong_Optimization = 0,1,2,3,4
41 #----------------------------
42 # Mesh algo type identifiers
43 #----------------------------
45 ## Algorithm type: MG-Tetra Parallel tetrahedron 3D algorithm, see GHS3DPRL_Algorithm
46 MG_Tetra_Parallel = "MG-Tetra Parallel"
47 GHS3DPRL = MG_Tetra_Parallel
49 #----------------------------
51 #----------------------------
53 ## Tetrahedron GHS3DPRL 3D algorithm
55 # It can be created by calling smeshBuilder.Mesh.Tetrahedron( smeshBuilder.MG_Tetra_Parallel )
56 class GHS3DPRL_Algorithm(Mesh_Algorithm):
58 ## name of the dynamic method in smeshBuilder.Mesh class
60 meshMethod = "Tetrahedron"
61 ## type of algorithm used with helper function in smeshBuilder.Mesh class
64 ## doc string of the method in smeshBuilder.Mesh class
66 docHelper = "Creates tetrahedron 3D algorithm for volumes"
68 ## Private constructor.
69 # @param mesh parent mesh object algorithm is assigned to
70 # @param geom geometry (shape/sub-shape) algorithm is assigned to;
71 # if it is @c 0 (default), the algorithm is assigned to the main shape
72 def __init__(self, mesh, geom=0):
73 Mesh_Algorithm.__init__(self)
74 if noGHS3DPRLPlugin: print "Warning: GHS3DPRLPlugin module unavailable"
75 self.Create(mesh, geom, self.algoType, "libGHS3DPRLEngine.so")
79 ## Defines hypothesis having several parameters
80 # @return hypothesis object
83 self.params = self.Hypothesis("MG-Tetra Parallel Parameters", [],
84 "libGHS3DPRLEngine.so", UseExisting=0)
88 ## To keep working files or remove them. Log file remains in case of errors anyway.
89 # @param toKeep "keep working files" flag value
90 def SetKeepFiles(self, toKeep):
91 self.Parameters().SetKeepFiles(toKeep)
94 ## Sets MED files name and path.
95 # @param value MED file name
96 def SetMEDName(self, value):
97 self.Parameters().SetMEDName(value)
100 ## Sets the number of partition of the initial mesh
101 # @param value number of partition value
102 def SetNbPart(self, value):
103 self.Parameters().SetNbPart(value)
106 ## When big mesh, start tepal in background
107 # @param value "background mode" flag value
108 def SetBackground(self, value):
109 self.Parameters().SetBackground(value)
112 ## To mesh "holes" in a solid or not. Default is to mesh.
113 # @param toMesh "mesh holes" flag value
114 def SetToMeshHoles(self, toMesh):
115 self.Parameters().SetToMeshHoles(toMesh)
118 pass # end of GHS3DPRL_Algorithm class