X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FBLSURFPlugin%2FBLSURFPluginBuilder.py;h=8fcb6e959f06c583b2db517920f118b91b07c6ee;hb=refs%2Fheads%2Fgpusph_v2;hp=36e522ef91f7a3d68711e017b3074d32315a9eba;hpb=a108b93a70bc926cae1014190c51368f7cceaee5;p=plugins%2Fblsurfplugin.git diff --git a/src/BLSURFPlugin/BLSURFPluginBuilder.py b/src/BLSURFPlugin/BLSURFPluginBuilder.py index 36e522e..8fcb6e9 100644 --- a/src/BLSURFPlugin/BLSURFPluginBuilder.py +++ b/src/BLSURFPlugin/BLSURFPluginBuilder.py @@ -22,6 +22,7 @@ # Python API for the MG-CADSurf meshing plug-in module. from salome.smesh.smesh_algorithm import Mesh_Algorithm +import GEOM LIBRARY = "libBLSURFEngine.so" @@ -74,6 +75,7 @@ class BLSURF_Algorithm(Mesh_Algorithm): _bad_surface_element_aspect_ratio = 1000 _geometric_approximation = 22 _gradation = 1.3 + _volume_gradation = 2 _metric = "isotropic" _remove_tiny_edges = 0 @@ -85,7 +87,11 @@ class BLSURF_Algorithm(Mesh_Algorithm): Mesh_Algorithm.__init__(self) if noBLSURFPlugin: print "Warning: BLSURFPlugin module unavailable" - self.Create(mesh, geom, BLSURF, LIBRARY) + if mesh.GetMesh().HasShapeToMesh(): + self.Create(mesh, geom, self.algoType, LIBRARY) + else: + self.Create(mesh, geom, self.algoType+"_NOGEOM", LIBRARY) + mesh.smeshpyD.SetName( self.algo, self.algoType ) self.params=None self.geompyD = mesh.geompyD #self.SetPhysicalMesh() - PAL19680 @@ -158,12 +164,25 @@ class BLSURF_Algorithm(Mesh_Algorithm): pass ## Sets maximal allowed ratio between the lengths of two adjacent edges. + # @param toUseGradation to use gradation # @param theVal value of maximal length ratio - def SetGradation(self, theVal=_gradation): + def SetGradation(self, toUseGradation=True, theVal=_gradation): + if isinstance( toUseGradation, float ): ## backward compatibility + toUseGradation, theVal = True, toUseGradation if self.Parameters().GetGeometricMesh() == 0: theVal = self._gradation + self.Parameters().SetUseGradation(toUseGradation) self.Parameters().SetGradation(theVal) pass + ## Sets maximal allowed ratio between the lengths of two adjacent edges in 3D mesh. + # @param toUseGradation to use gradation + # @param theVal value of maximal length ratio + def SetVolumeGradation(self, toUseGradation=True, theVal=_gradation): + if self.Parameters().GetGeometricMesh() == 0: theVal = self._volume_gradation + self.Parameters().SetUseVolumeGradation(toUseGradation) + self.Parameters().SetVolumeGradation(theVal) + pass + ## Sets topology usage way. # @param way defines how mesh conformity is assured