This commit is contained in:
L-Nafaryus 2021-04-08 00:13:27 +05:00
parent 2df2cd0b8f
commit efaaec30f7
No known key found for this signature in database
GPG Key ID: C76D8DCD2727DBB7
8 changed files with 31 additions and 21 deletions

11
run.py
View File

@ -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:

View File

@ -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)

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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))

View File

@ -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):
"""