Mod: parameters for netgen
This commit is contained in:
parent
f1312919e2
commit
b910979a90
@ -10,6 +10,7 @@ from salome.smesh import smeshBuilder
|
|||||||
smesh = smeshBuilder.New()
|
smesh = smeshBuilder.New()
|
||||||
|
|
||||||
import math
|
import math
|
||||||
|
import os
|
||||||
|
|
||||||
axes = [
|
axes = [
|
||||||
geompy.MakeVectorDXDYDZ(1, 0, 0),
|
geompy.MakeVectorDXDYDZ(1, 0, 0),
|
||||||
@ -65,8 +66,8 @@ geompy.addToStudy(Segment1_8, 'Segment1_8')
|
|||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
SegmentMesh = smesh.Mesh(Segment1_8)
|
mesh = smesh.Mesh(Pore)
|
||||||
netgen = SegmentMesh.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D)
|
netgen = mesh.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D)
|
||||||
|
|
||||||
param = netgen.Parameters()
|
param = netgen.Parameters()
|
||||||
param.SetSecondOrder( 0 )
|
param.SetSecondOrder( 0 )
|
||||||
@ -76,20 +77,29 @@ param.SetChordalErrorEnabled( 0 )
|
|||||||
param.SetUseSurfaceCurvature( 1 )
|
param.SetUseSurfaceCurvature( 1 )
|
||||||
param.SetFuseEdges( 1 )
|
param.SetFuseEdges( 1 )
|
||||||
param.SetCheckChartBoundary( 0 )
|
param.SetCheckChartBoundary( 0 )
|
||||||
param.SetMinSize( 0.05 )
|
param.SetMinSize( 0.01 )
|
||||||
param.SetMaxSize( 0.1 )
|
param.SetMaxSize( 0.05 )
|
||||||
param.SetFineness( 5 )
|
param.SetFineness( 5 )
|
||||||
param.SetGrowthRate( 0.1 )
|
param.SetGrowthRate( 0.1 )
|
||||||
param.SetNbSegPerEdge( 5 )
|
param.SetNbSegPerEdge( 5 )
|
||||||
param.SetNbSegPerRadius( 10 )
|
param.SetNbSegPerRadius( 10 )
|
||||||
param.SetQuadAllowed( 1 )
|
param.SetQuadAllowed( 1 )
|
||||||
|
|
||||||
vlayer = netgen.ViscousLayers(0.05, 3, 1.5, [15, 29, 54], 1, smeshBuilder.SURF_OFFSET_SMOOTH)
|
#vlayer = netgen.ViscousLayers(0.05, 3, 1.5, [15, 29, 54], 1, smeshBuilder.SURF_OFFSET_SMOOTH)
|
||||||
|
|
||||||
isDone = SegmentMesh.Compute()
|
isDone = mesh.Compute()
|
||||||
|
|
||||||
if not isDone:
|
if not isDone:
|
||||||
print("Mesh is not computed")
|
print("Mesh is not computed")
|
||||||
|
|
||||||
|
|
||||||
|
#try:
|
||||||
|
# dirname = os.path.dirname(__file__)
|
||||||
|
# filename = os.path.join(dirname, '../build/mesh.unv')
|
||||||
|
# mesh.ExportUNV( filename )
|
||||||
|
# pass
|
||||||
|
#except:
|
||||||
|
# print('ExportUNV() failed. Invalid file name?')
|
||||||
|
|
||||||
if salome.sg.hasDesktop():
|
if salome.sg.hasDesktop():
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
@ -38,16 +38,43 @@ spheres = geompy.MakeMultiTranslation1D(spheres, axes[2], 1, 2)
|
|||||||
spheres2 = geompy.MakeSpherePntR(vtx[3], math.sqrt(3) / 4 / (1 - alpha[0]))
|
spheres2 = geompy.MakeSpherePntR(vtx[3], math.sqrt(3) / 4 / (1 - alpha[0]))
|
||||||
spheres2 = geompy.MakeMultiTranslation2D(spheres2, axes[0], 1, 3, axes[1], 1, 3)
|
spheres2 = geompy.MakeMultiTranslation2D(spheres2, axes[0], 1, 3, axes[1], 1, 3)
|
||||||
|
|
||||||
Pore = geompy.MakeCutList(box, [spheres, spheres2], False)
|
PoreBC = geompy.MakeCutList(box, [spheres, spheres2], False)
|
||||||
|
|
||||||
geompy.addToStudy(Pore, 'Pore')
|
geompy.addToStudy(PoreBC, 'PoreBC')
|
||||||
|
|
||||||
box2 = geompy.MakeBoxTwoPnt(vtx[0], geompy.MakeVertex(0, 0, 0))
|
box2 = geompy.MakeBoxTwoPnt(vtx[0], geompy.MakeVertex(0, 0, 0))
|
||||||
box2 = geompy.MakeRotation(box2, axes[2], 45 * math.pi / 180.0)
|
box2 = geompy.MakeRotation(box2, axes[2], 45 * math.pi / 180.0)
|
||||||
Segment1_8 = geompy.MakeCommonList([Pore, box2], True)
|
Segment1_8 = geompy.MakeCommonList([PoreBC, box2], True)
|
||||||
|
|
||||||
geompy.addToStudy(Segment1_8, 'Segment1_8')
|
geompy.addToStudy(Segment1_8, 'Segment1_8')
|
||||||
|
|
||||||
|
mesh = smesh.Mesh(PoreBC)
|
||||||
|
netgen = mesh.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D)
|
||||||
|
|
||||||
|
param = netgen.Parameters()
|
||||||
|
param.SetSecondOrder( 0 )
|
||||||
|
param.SetOptimize( 1 )
|
||||||
|
param.SetChordalError( -1 )
|
||||||
|
param.SetChordalErrorEnabled( 0 )
|
||||||
|
param.SetUseSurfaceCurvature( 1 )
|
||||||
|
param.SetFuseEdges( 1 )
|
||||||
|
param.SetCheckChartBoundary( 0 )
|
||||||
|
param.SetMinSize( 0.01 )
|
||||||
|
param.SetMaxSize( 0.02 )
|
||||||
|
param.SetFineness( 5 )
|
||||||
|
param.SetGrowthRate( 0.1 )
|
||||||
|
param.SetNbSegPerEdge( 5 )
|
||||||
|
param.SetNbSegPerRadius( 10 )
|
||||||
|
param.SetQuadAllowed( 1 )
|
||||||
|
|
||||||
|
#vlayer = netgen.ViscousLayers(0.05, 3, 1.5, [15, 29, 54], 1, smeshBuilder.SURF_OFFSET_SMOOTH)
|
||||||
|
|
||||||
|
isDone = mesh.Compute()
|
||||||
|
|
||||||
|
if not isDone:
|
||||||
|
print("Mesh is not computed")
|
||||||
|
|
||||||
|
|
||||||
if salome.sg.hasDesktop():
|
if salome.sg.hasDesktop():
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
|
||||||
|
@ -39,15 +39,42 @@ spheres = geompy.MakeMultiTranslation1D(spheres, axes[2], 1, 2)
|
|||||||
|
|
||||||
sphere2 = geompy.MakeSpherePntR(vtx[2], math.sqrt(2) / 4 / (1 - alpha[0]))
|
sphere2 = geompy.MakeSpherePntR(vtx[2], math.sqrt(2) / 4 / (1 - alpha[0]))
|
||||||
|
|
||||||
Pore = geompy.MakeCutList(box, [spheres, sphere2], True)
|
PoreFC = geompy.MakeCutList(box, [spheres, sphere2], True)
|
||||||
|
|
||||||
geompy.addToStudy(Pore, 'Pore')
|
geompy.addToStudy(PoreFC, 'PoreFC')
|
||||||
|
|
||||||
box2 = geompy.MakeBoxTwoPnt(geompy.MakeVertex(0, 0, 0), vtx[3])
|
box2 = geompy.MakeBoxTwoPnt(geompy.MakeVertex(0, 0, 0), vtx[3])
|
||||||
box2 = geompy.MakeRotation(box2, axes[2], -45 * math.pi / 180.0)
|
box2 = geompy.MakeRotation(box2, axes[2], -45 * math.pi / 180.0)
|
||||||
Segment1_8 = geompy.MakeCommonList([Pore, box2], True)
|
Segment1_8 = geompy.MakeCommonList([PoreFC, box2], True)
|
||||||
|
|
||||||
geompy.addToStudy(Segment1_8, 'Segment1_8')
|
geompy.addToStudy(Segment1_8, 'Segment1_8')
|
||||||
|
|
||||||
|
mesh = smesh.Mesh(PoreFC)
|
||||||
|
netgen = mesh.Tetrahedron(algo=smeshBuilder.NETGEN_1D2D3D)
|
||||||
|
|
||||||
|
param = netgen.Parameters()
|
||||||
|
param.SetSecondOrder( 0 )
|
||||||
|
param.SetOptimize( 1 )
|
||||||
|
param.SetChordalError( -1 )
|
||||||
|
param.SetChordalErrorEnabled( 0 )
|
||||||
|
param.SetUseSurfaceCurvature( 1 )
|
||||||
|
param.SetFuseEdges( 1 )
|
||||||
|
param.SetCheckChartBoundary( 0 )
|
||||||
|
param.SetMinSize( 0.01 )
|
||||||
|
param.SetMaxSize( 0.02 )
|
||||||
|
param.SetFineness( 5 )
|
||||||
|
param.SetGrowthRate( 0.1 )
|
||||||
|
param.SetNbSegPerEdge( 5 )
|
||||||
|
param.SetNbSegPerRadius( 10 )
|
||||||
|
param.SetQuadAllowed( 1 )
|
||||||
|
|
||||||
|
#vlayer = netgen.ViscousLayers(0.05, 3, 1.5, [15, 29, 54], 1, smeshBuilder.SURF_OFFSET_SMOOTH)
|
||||||
|
|
||||||
|
isDone = mesh.Compute()
|
||||||
|
|
||||||
|
if not isDone:
|
||||||
|
print("Mesh is not computed")
|
||||||
|
|
||||||
|
|
||||||
if salome.sg.hasDesktop():
|
if salome.sg.hasDesktop():
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
Loading…
Reference in New Issue
Block a user