Fix: ...
This commit is contained in:
parent
2df2cd0b8f
commit
efaaec30f7
11
run.py
11
run.py
@ -27,20 +27,23 @@ def createTasks():
|
|||||||
[0, 0, 1],
|
[0, 0, 1],
|
||||||
[1, 1, 1]
|
[1, 1, 1]
|
||||||
]
|
]
|
||||||
fillet = 0
|
fillet = 1
|
||||||
|
|
||||||
Task = namedtuple("Task", ["structure", "coeff", "fillet", "direction", "saveto"])
|
Task = namedtuple("Task", ["structure", "coeff", "fillet", "direction", "saveto"])
|
||||||
tasks = []
|
tasks = []
|
||||||
|
|
||||||
for structure in structures:
|
for structure in structures:
|
||||||
if structure == "simpleCubic":
|
if structure == "simpleCubic":
|
||||||
theta = [c * 0.01 for c in range(1, 28 + 1)]
|
#theta = [c * 0.01 for c in range(1, 28 + 1)]
|
||||||
|
theta = [ 0.01, 0.28 ]
|
||||||
|
|
||||||
elif structure == "faceCenteredCubic":
|
elif structure == "faceCenteredCubic":
|
||||||
theta = [c * 0.01 for c in range(1, 13 + 1)]
|
#theta = [c * 0.01 for c in range(1, 13 + 1)]
|
||||||
|
theta = [ 0.01, 0.13 ]
|
||||||
|
|
||||||
elif structure == "bodyCenteredCubic":
|
elif structure == "bodyCenteredCubic":
|
||||||
theta = [c * 0.01 for c in range(1, 18 + 1)]
|
#theta = [c * 0.01 for c in range(1, 18 + 1)]
|
||||||
|
theta = [ 0.01, 0.13, 0.14, 0.18 ]
|
||||||
|
|
||||||
for coeff in theta:
|
for coeff in theta:
|
||||||
for direction in directions:
|
for direction in directions:
|
||||||
|
@ -50,13 +50,17 @@ def genMesh(stype, theta, fillet, flowdirection, saveto):
|
|||||||
bcount = 4
|
bcount = 4
|
||||||
direction = [0, 0, 1]
|
direction = [0, 0, 1]
|
||||||
|
|
||||||
|
#
|
||||||
|
geometry = geometry_utils.geompy.RemoveExtraEdges(geometry, False)
|
||||||
|
|
||||||
|
#
|
||||||
boundary = geometry_utils.createBoundary(geometry, bcount, direction, normvec, grains)
|
boundary = geometry_utils.createBoundary(geometry, bcount, direction, normvec, grains)
|
||||||
|
|
||||||
fineness = 1
|
fineness = 1
|
||||||
viscousLayers = {
|
viscousLayers = {
|
||||||
"thickness": 0.001,
|
"thickness": 0.0001,
|
||||||
"number": 2,
|
"number": 3,
|
||||||
"stretch": 1
|
"stretch": 1.2
|
||||||
}
|
}
|
||||||
mesh = mesh_utils.meshCreate(geometry, boundary, fineness, viscousLayers)
|
mesh = mesh_utils.meshCreate(geometry, boundary, fineness, viscousLayers)
|
||||||
mesh_utils.meshCompute(mesh)
|
mesh_utils.meshCompute(mesh)
|
||||||
|
@ -155,7 +155,7 @@ def bodyCenteredCubic(alpha, fillet = False):
|
|||||||
if fillet:
|
if fillet:
|
||||||
R = r0 / (1 - alpha)
|
R = r0 / (1 - alpha)
|
||||||
C1 = 0.8
|
C1 = 0.8
|
||||||
C2 = 0.01
|
C2 = 0.05
|
||||||
alpha1 = 0.01
|
alpha1 = 0.01
|
||||||
alpha2 = 0.18
|
alpha2 = 0.18
|
||||||
|
|
||||||
|
@ -150,7 +150,7 @@ def faceCenteredCubic(alpha, fillet = False):
|
|||||||
if fillet:
|
if fillet:
|
||||||
R = r0 / (1 - alpha)
|
R = r0 / (1 - alpha)
|
||||||
C1 = 0.8
|
C1 = 0.8
|
||||||
C2 = 0.01
|
C2 = 0.05
|
||||||
alpha1 = 0.01
|
alpha1 = 0.01
|
||||||
alpha2 = 0.13
|
alpha2 = 0.13
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ def simpleCubic(alpha, fillet = False):
|
|||||||
if fillet:
|
if fillet:
|
||||||
R = r0 / (1 - alpha)
|
R = r0 / (1 - alpha)
|
||||||
C1 = 0.8
|
C1 = 0.8
|
||||||
C2 = 0.01
|
C2 = 0.05
|
||||||
alpha1 = 0.01
|
alpha1 = 0.01
|
||||||
alpha2 = 0.28
|
alpha2 = 0.28
|
||||||
|
|
||||||
|
@ -80,10 +80,10 @@ def createBoundary(gobj, bcount, dvec, norm, grains):
|
|||||||
planes = geompy.ExtractShapes(gobj, geompy.ShapeType["FACE"], False)
|
planes = geompy.ExtractShapes(gobj, geompy.ShapeType["FACE"], False)
|
||||||
#planes = geompy.MakeCompound(planes)
|
#planes = geompy.MakeCompound(planes)
|
||||||
planes = geompy.MakeShell(planes)
|
planes = geompy.MakeShell(planes)
|
||||||
planes = geompy.ProcessShape(planes,
|
#planes = geompy.ProcessShape(planes,
|
||||||
[ "FixShape", "FixFaceSize", "DropSmallEdges", "SameParameter" ],
|
# [ "FixShape", "FixFaceSize", "DropSmallEdges", "SameParameter" ],
|
||||||
[ "FixShape.Tolerance3d", "FixShape.MaxTolerance3d", "FixFaceSize.Tolerance", "DropSmallEdges.Tolerance3d", "SameParameter.Tolerance3d" ],
|
# [ "FixShape.Tolerance3d", "FixShape.MaxTolerance3d", "FixFaceSize.Tolerance", "DropSmallEdges.Tolerance3d", "SameParameter.Tolerance3d" ],
|
||||||
[ "1e-7", "1", "0.05", "0.05", "1e-7" ])
|
# [ "1e-7", "1", "0.05", "0.05", "1e-7" ])
|
||||||
planes = geompy.MakeCutList(planes, [grains], False)
|
planes = geompy.MakeCutList(planes, [grains], False)
|
||||||
planes = geompy.ExtractShapes(planes, geompy.ShapeType["FACE"], False)
|
planes = geompy.ExtractShapes(planes, geompy.ShapeType["FACE"], False)
|
||||||
#print("planes: ", len(planes))
|
#print("planes: ", len(planes))
|
||||||
|
@ -116,16 +116,16 @@ def meshCreate(gobj, boundary, fineness, viscousLayers=None):
|
|||||||
def meshCompute(mobj):
|
def meshCompute(mobj):
|
||||||
"""Compute the mesh."""
|
"""Compute the mesh."""
|
||||||
status = mobj.Compute()
|
status = mobj.Compute()
|
||||||
msg = ""
|
#msg = ""
|
||||||
|
|
||||||
if status:
|
#if status:
|
||||||
msg = "Computed"
|
# msg = "Computed"
|
||||||
|
|
||||||
else:
|
#else:
|
||||||
msg = "Not computed"
|
# msg = "Not computed"
|
||||||
|
|
||||||
logging.info("""meshCompute:
|
#logging.info("""meshCompute:
|
||||||
status:\t{}""".format(msg))
|
#status:\t{}""".format(msg))
|
||||||
|
|
||||||
if status:
|
if status:
|
||||||
omniinfo = mobj.GetMeshInfo()
|
omniinfo = mobj.GetMeshInfo()
|
||||||
@ -159,6 +159,9 @@ def meshCompute(mobj):
|
|||||||
Pyramid:\t{}""".format(
|
Pyramid:\t{}""".format(
|
||||||
elements, edges, faces, triangles, volumes, tetra, prism, pyramid))
|
elements, edges, faces, triangles, volumes, tetra, prism, pyramid))
|
||||||
|
|
||||||
|
else:
|
||||||
|
logging.warning("meshCompute: not computed")
|
||||||
|
|
||||||
|
|
||||||
def meshExport(mobj, path):
|
def meshExport(mobj, path):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user