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