Hello,
I have a script to generate a 2D mesh from a 3D geometry, making a vertical cut of it.
I managed to create this geometry, but I’d like that in the mesh that on the domain AqueousHumor
, the refinement of the mesh is smaller than in the other regions.
So far, I can set the size of the mesh using SetMaxSize
, but it sets it globally.
Here is the part of the code I have done to make the mesh :
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New()
Eye_Mesh = smesh.Mesh(EyePlan)
NETGEN_2D_1 = Eye_Mesh.Triangle(algo=smeshBuilder.NETGEN_1D2D)
smesh.SetName(Eye_Mesh.GetMesh(), 'Eye_Mesh')
# Set markers
Vitreous_humor_1 = Eye_Mesh.GroupOnGeom(VitreousHumor, 'VitreousHumor', SMESH.FACE)
Retina_1 = Eye_Mesh.GroupOnGeom(Retina, 'Retina', SMESH.FACE)
Choroid_1 = Eye_Mesh.GroupOnGeom(Group_Choroid, 'Choroid', SMESH.FACE)
Lens_1 = Eye_Mesh.GroupOnGeom(Lens, 'Lens', SMESH.FACE)
Iris_1 = Eye_Mesh.GroupOnGeom(Group_Iris, 'Iris', SMESH.FACE)
AqueousHumor_1 = Eye_Mesh.GroupOnGeom(AqueousHumor, 'AqueousHumor', SMESH.FACE)
Lamina_1 = Eye_Mesh.GroupOnGeom(Group_Lamina, 'Lamina', SMESH.FACE)
OpticNerve_1 = Eye_Mesh.GroupOnGeom(OpticNerve, 'OpticNerve', SMESH.FACE)
Cornea_1 = Eye_Mesh.GroupOnGeom(Cornea, 'Cornea', SMESH.FACE)
Sclera_1 = Eye_Mesh.GroupOnGeom(Group_Sclera, 'Sclera', SMESH.FACE)
NETGEN_2D_Parameters = NETGEN_2D_1.Parameters()
NETGEN_2D_Parameters.SetMaxSize( 1 )
# NETGEN_2D_Parameters.SetLocalSizeOnShape(AqueousHumor_1, 0.1)
The full script is accessible here.
I tried to use SetLocalSizeOnShape
, but it results in an error : omniORB.CORBA._omni_sys_exc: CORBA.INV_OBJREF(omniORB.INV_OBJREF_InterfaceMisMatch, CORBA.COMPLETED_NO)
.
NB: I use here the NETGEN algorithm, if another algorithm permits to do it easily, I can gladly change !
Thanks !