Bug in the NETGEN2D Algo with a local refinement in SALOME 9.8

Hello,

There is a bug in SALOME 9.8 about the local refinement on a face with NETGEN2D. I prepared an HDF example to reproduce the bug but I’m not available to upload because i have a new account… So to reproduce the bug i put the script below. If you load the script in SALOME 9.7 you will see a nice refinement on the little pipe (on Group_1) whereas with SALOME 9.8 you will see that the refinement is not correct.

Thank you for your help,

Regards

Yohann EUDE

Here the script:

GEOM component

import GEOM
from salome.geom import geomBuilder
import math
import SALOMEDS

geompy = geomBuilder.New()

O = geompy.MakeVertex(0, 0, 0)
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
Cylinder_1 = geompy.MakeCylinderRH(100, 300)
Cylinder_1_vertex_8 = geompy.GetSubShape(Cylinder_1, [8])
Cylinder_2 = geompy.MakeCylinder(Cylinder_1_vertex_8, OX, 20, 300)
Translation_1 = geompy.MakeTranslation(Cylinder_2, -50, 50, 120)
Fuse_1 = geompy.MakeFuseList([Cylinder_1, Translation_1], True, True)
Group_1 = geompy.CreateGroup(Fuse_1, geompy.ShapeType[“FACE”])
geompy.UnionIDs(Group_1, [17])
[Group_1] = geompy.GetExistingSubObjects(Fuse_1, False)
geompy.addToStudy( O, ‘O’ )
geompy.addToStudy( OX, ‘OX’ )
geompy.addToStudy( OY, ‘OY’ )
geompy.addToStudy( OZ, ‘OZ’ )
geompy.addToStudy( Cylinder_1, ‘Cylinder_1’ )
geompy.addToStudyInFather( Cylinder_1, Cylinder_1_vertex_8, ‘Cylinder_1:vertex_8’ )
geompy.addToStudy( Cylinder_2, ‘Cylinder_2’ )
geompy.addToStudy( Translation_1, ‘Translation_1’ )
geompy.addToStudy( Fuse_1, ‘Fuse_1’ )
geompy.addToStudyInFather( Fuse_1, Group_1, ‘Group_1’ )

SMESH component

import SMESH, SALOMEDS
from salome.smesh import smeshBuilder

smesh = smeshBuilder.New()
#smesh.SetEnablePublish( False ) # Set to False to avoid publish in study if not needed or in some particular situations:
# multiples meshes built in parallel, complex and numerous mesh edition (performance)

Mesh_1 = smesh.Mesh(Fuse_1)
NETGEN_1D_2D = Mesh_1.Triangle(algo=smeshBuilder.NETGEN_1D2D)
NETGEN_2D_Parameters_1 = NETGEN_1D_2D.Parameters()
NETGEN_2D_Parameters_1.SetMaxSize( 25 )
NETGEN_2D_Parameters_1.SetMinSize( 2 )
NETGEN_2D_Parameters_1.SetSecondOrder( 0 )
NETGEN_2D_Parameters_1.SetOptimize( 1 )
NETGEN_2D_Parameters_1.SetFineness( 2 )
NETGEN_2D_Parameters_1.SetChordalError( -1 )
NETGEN_2D_Parameters_1.SetChordalErrorEnabled( 0 )
NETGEN_2D_Parameters_1.SetUseSurfaceCurvature( 1 )
NETGEN_2D_Parameters_1.SetFuseEdges( 1 )
NETGEN_2D_Parameters_1.SetUseDelauney( 0 )
NETGEN_2D_Parameters_1.SetQuadAllowed( 0 )
NETGEN_2D_Parameters_1.SetLocalSizeOnShape(Group_1, 2)
NETGEN_2D_Parameters_1.SetWorstElemMeasure( 21973 )
NETGEN_2D_Parameters_1.SetCheckChartBoundary( 3 )
Group_1_1 = Mesh_1.GroupOnGeom(Group_1,‘Group_1’,SMESH.FACE)
isDone = Mesh_1.Compute()
[ Group_1_1 ] = Mesh_1.GetGroups()

Set names of Mesh objects

smesh.SetName(NETGEN_1D_2D.GetAlgorithm(), ‘NETGEN 1D-2D’)
smesh.SetName(NETGEN_2D_Parameters_1, ‘NETGEN 2D Parameters_1’)
smesh.SetName(Group_1_1, ‘Group_1’)
smesh.SetName(Mesh_1.GetMesh(), ‘Mesh_1’)