mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-11-16 02:28:34 +05:00
Bug 0020072: GHS3DPRLPLUGIN update. Integrating the attached patch.
This commit is contained in:
parent
21c57ac1ed
commit
b6f1b3a431
@ -57,6 +57,7 @@ dist_salomescript_DATA= \
|
|||||||
ex21_lamp.py \
|
ex21_lamp.py \
|
||||||
ex24_cylinder.py \
|
ex24_cylinder.py \
|
||||||
ex29_refine.py \
|
ex29_refine.py \
|
||||||
|
ex30_tepal.py \
|
||||||
SMESH_test.py\
|
SMESH_test.py\
|
||||||
SMESH_test0.py\
|
SMESH_test0.py\
|
||||||
SMESH_test1.py \
|
SMESH_test1.py \
|
||||||
|
63
src/SMESH_SWIG/ex30_tepal.py
Normal file
63
src/SMESH_SWIG/ex30_tepal.py
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
# CEA/LGLS 2008, Christian Van Wambeke (CEA/LGLS), Francis KLOSS (OCC)
|
||||||
|
# ====================================================================
|
||||||
|
|
||||||
|
import os
|
||||||
|
|
||||||
|
import geompy
|
||||||
|
import smesh
|
||||||
|
|
||||||
|
# Parameters
|
||||||
|
# ----------
|
||||||
|
|
||||||
|
results = "/export/home/wambeke/ZZ"
|
||||||
|
|
||||||
|
radius = 50
|
||||||
|
height = 200
|
||||||
|
|
||||||
|
# Build a cylinder
|
||||||
|
# ----------------
|
||||||
|
|
||||||
|
base = geompy.MakeVertex(0, 0, 0)
|
||||||
|
direction = geompy.MakeVectorDXDYDZ(0, 0, 1)
|
||||||
|
|
||||||
|
cylinder = geompy.MakeCylinder(base, direction, radius, height)
|
||||||
|
|
||||||
|
geompy.addToStudy(cylinder, "Cylinder")
|
||||||
|
|
||||||
|
# Define a mesh on a geometry
|
||||||
|
# ---------------------------
|
||||||
|
|
||||||
|
m = smesh.Mesh(cylinder)
|
||||||
|
|
||||||
|
# 2D mesh with BLSURF
|
||||||
|
# -------------------
|
||||||
|
|
||||||
|
algo2d = m.Triangle(smesh.BLSURF)
|
||||||
|
|
||||||
|
algo2d.SetPhysicalMesh(1)
|
||||||
|
algo2d.SetPhySize(5)
|
||||||
|
|
||||||
|
algo2d.SetGeometricMesh(0)
|
||||||
|
|
||||||
|
# 3D mesh with tepal
|
||||||
|
# ------------------
|
||||||
|
|
||||||
|
algo3d = m.Tetrahedron(smesh.GHS3DPRL)
|
||||||
|
|
||||||
|
algo3d.SetMEDName(results)
|
||||||
|
algo3d.SetNbPart(4)
|
||||||
|
algo3d.SetBackground(False)
|
||||||
|
algo3d.SetKeepFiles(False)
|
||||||
|
|
||||||
|
# Launch meshers
|
||||||
|
# --------------
|
||||||
|
|
||||||
|
status = m.Compute()
|
||||||
|
|
||||||
|
# Test if ok
|
||||||
|
# ----------
|
||||||
|
|
||||||
|
if os.access(results+".xml", os.F_OK):
|
||||||
|
print "Ok: tepal"
|
||||||
|
else:
|
||||||
|
print "KO: tepal"
|
@ -128,6 +128,7 @@ NETGEN_FULL = FULL_NETGEN
|
|||||||
Hexa = 8
|
Hexa = 8
|
||||||
Hexotic = 9
|
Hexotic = 9
|
||||||
BLSURF = 10
|
BLSURF = 10
|
||||||
|
GHS3DPRL = 11
|
||||||
|
|
||||||
# MirrorType enumeration
|
# MirrorType enumeration
|
||||||
POINT = SMESH_MeshEditor.POINT
|
POINT = SMESH_MeshEditor.POINT
|
||||||
@ -777,7 +778,7 @@ class Mesh:
|
|||||||
# The parameter \a algo permits to choose the algorithm: NETGEN or GHS3D
|
# The parameter \a algo permits to choose the algorithm: NETGEN or GHS3D
|
||||||
# If the optional \a geom parameter is not set, this algorithm is global.
|
# If the optional \a geom parameter is not set, this algorithm is global.
|
||||||
# \n Otherwise, this algorithm defines a submesh based on \a geom subshape.
|
# \n Otherwise, this algorithm defines a submesh based on \a geom subshape.
|
||||||
# @param algo values are: smesh.NETGEN, smesh.GHS3D, smesh.FULL_NETGEN
|
# @param algo values are: smesh.NETGEN, smesh.GHS3D, smesh.GHS3DPRL, smesh.FULL_NETGEN
|
||||||
# @param geom If defined, the subshape to be meshed (GEOM_Object)
|
# @param geom If defined, the subshape to be meshed (GEOM_Object)
|
||||||
# @return an instance of Mesh_Tetrahedron algorithm
|
# @return an instance of Mesh_Tetrahedron algorithm
|
||||||
# @ingroup l3_algos_basic
|
# @ingroup l3_algos_basic
|
||||||
@ -3517,6 +3518,11 @@ class Mesh_Tetrahedron(Mesh_Algorithm):
|
|||||||
self.Create(mesh, geom, "GHS3D_3D" , "libGHS3DEngine.so")
|
self.Create(mesh, geom, "GHS3D_3D" , "libGHS3DEngine.so")
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
elif algoType == GHS3DPRL:
|
||||||
|
import GHS3DPRLPlugin
|
||||||
|
self.Create(mesh, geom, "GHS3DPRL_3D" , "libGHS3DPRLEngine.so")
|
||||||
|
pass
|
||||||
|
|
||||||
self.algoType = algoType
|
self.algoType = algoType
|
||||||
|
|
||||||
## Defines "MaxElementVolume" hypothesis to give the maximun volume of each tetrahedron
|
## Defines "MaxElementVolume" hypothesis to give the maximun volume of each tetrahedron
|
||||||
@ -3544,6 +3550,7 @@ class Mesh_Tetrahedron(Mesh_Algorithm):
|
|||||||
def Parameters(self, which=SOLE):
|
def Parameters(self, which=SOLE):
|
||||||
if self.params:
|
if self.params:
|
||||||
return self.params
|
return self.params
|
||||||
|
|
||||||
if self.algoType == FULL_NETGEN:
|
if self.algoType == FULL_NETGEN:
|
||||||
if which == SIMPLE:
|
if which == SIMPLE:
|
||||||
self.params = self.Hypothesis("NETGEN_SimpleParameters_3D", [],
|
self.params = self.Hypothesis("NETGEN_SimpleParameters_3D", [],
|
||||||
@ -3552,11 +3559,17 @@ class Mesh_Tetrahedron(Mesh_Algorithm):
|
|||||||
self.params = self.Hypothesis("NETGEN_Parameters", [],
|
self.params = self.Hypothesis("NETGEN_Parameters", [],
|
||||||
"libNETGENEngine.so", UseExisting=0)
|
"libNETGENEngine.so", UseExisting=0)
|
||||||
return self.params
|
return self.params
|
||||||
|
|
||||||
if self.algoType == GHS3D:
|
if self.algoType == GHS3D:
|
||||||
self.params = self.Hypothesis("GHS3D_Parameters", [],
|
self.params = self.Hypothesis("GHS3D_Parameters", [],
|
||||||
"libGHS3DEngine.so", UseExisting=0)
|
"libGHS3DEngine.so", UseExisting=0)
|
||||||
return self.params
|
return self.params
|
||||||
|
|
||||||
|
if self.algoType == GHS3DPRL:
|
||||||
|
self.params = self.Hypothesis("GHS3DPRL_Parameters", [],
|
||||||
|
"libGHS3DPRLEngine.so", UseExisting=0)
|
||||||
|
return self.params
|
||||||
|
|
||||||
print "Algo supports no multi-parameter hypothesis"
|
print "Algo supports no multi-parameter hypothesis"
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@ -3673,7 +3686,7 @@ class Mesh_Tetrahedron(Mesh_Algorithm):
|
|||||||
## To keep working files or remove them. Log file remains in case of errors anyway.
|
## To keep working files or remove them. Log file remains in case of errors anyway.
|
||||||
# @ingroup l3_hypos_ghs3dh
|
# @ingroup l3_hypos_ghs3dh
|
||||||
def SetKeepFiles(self, toKeep):
|
def SetKeepFiles(self, toKeep):
|
||||||
# Advanced parameter of GHS3D
|
# Advanced parameter of GHS3D and GHS3DPRL
|
||||||
self.Parameters().SetKeepFiles(toKeep)
|
self.Parameters().SetKeepFiles(toKeep)
|
||||||
|
|
||||||
## To set verbose level [0-10]. <ul>
|
## To set verbose level [0-10]. <ul>
|
||||||
@ -3708,6 +3721,18 @@ class Mesh_Tetrahedron(Mesh_Algorithm):
|
|||||||
# Advanced parameter of GHS3D
|
# Advanced parameter of GHS3D
|
||||||
self.Parameters().SetTextOption(option)
|
self.Parameters().SetTextOption(option)
|
||||||
|
|
||||||
|
## Sets MED files name and path.
|
||||||
|
def SetMEDName(self, value):
|
||||||
|
self.Parameters().SetMEDName(value)
|
||||||
|
|
||||||
|
## Sets the number of partition of the initial mesh
|
||||||
|
def SetNbPart(self, value):
|
||||||
|
self.Parameters().SetNbPart(value)
|
||||||
|
|
||||||
|
## When big mesh, start tepal in background
|
||||||
|
def SetBackground(self, value):
|
||||||
|
self.Parameters().SetBackground(value)
|
||||||
|
|
||||||
# Public class: Mesh_Hexahedron
|
# Public class: Mesh_Hexahedron
|
||||||
# ------------------------------
|
# ------------------------------
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user