FEM: code formating
This commit is contained in:
@@ -60,7 +60,6 @@ def setup(doc=None, solvertype="ccxtools"):
|
||||
lower_tube = doc.addObject("Part::Feature", "Lower_tube")
|
||||
lower_tube.Shape = sh_lower_tube
|
||||
|
||||
|
||||
sh_upper_circle = Part.Wire(Part.makeCircle(tube_radius))
|
||||
sh_upper_tube = sh_upper_circle.extrude(FreeCAD.Vector(0, 0, tube_length))
|
||||
sh_upper_tube.reverse()
|
||||
@@ -81,14 +80,12 @@ def setup(doc=None, solvertype="ccxtools"):
|
||||
force_point.ViewObject.PointSize = 10.0
|
||||
force_point.ViewObject.PointColor = (1.0, 0.0, 0.0)
|
||||
|
||||
|
||||
BooleanFrag = BOPTools.SplitFeatures.makeBooleanFragments(name= 'BooleanFragments')
|
||||
BooleanFrag = BOPTools.SplitFeatures.makeBooleanFragments(name='BooleanFragments')
|
||||
BooleanFrag.Objects = [upper_tube, force_point]
|
||||
|
||||
|
||||
compound = doc.addObject("Part::Compound", "Compound")
|
||||
compound.Links = [BooleanFrag, lower_tube,]
|
||||
|
||||
|
||||
compound.Links = [BooleanFrag, lower_tube]
|
||||
|
||||
# line for load direction
|
||||
sh_load_line = Part.makeLine(v_force_pt, FreeCAD.Vector(0, 150, 475))
|
||||
load_line = doc.addObject("Part::Feature", "Load_direction_line")
|
||||
|
||||
@@ -608,7 +608,7 @@ class FemInputWriterCcx(writerbase.FemInputWriter):
|
||||
else:
|
||||
name = "IND" + str(obj)
|
||||
f.write("*SURFACE, NAME =" + name + "\n")
|
||||
|
||||
|
||||
v = self.mesh_object.FemMesh.getccxVolumesByFace(ref_shape)
|
||||
if len(v) > 0:
|
||||
# volume elements found
|
||||
@@ -616,7 +616,7 @@ class FemInputWriterCcx(writerbase.FemInputWriter):
|
||||
"{}, surface {}, {} touching volume elements found\n"
|
||||
.format(contact_obj.Label, name, len(v))
|
||||
)
|
||||
for i in v:
|
||||
for i in v:
|
||||
f.write("{},S{}\n".format(i[0], i[1]))
|
||||
else:
|
||||
# try shell elements
|
||||
@@ -630,7 +630,8 @@ class FemInputWriterCcx(writerbase.FemInputWriter):
|
||||
f.write("{},S2\n".format(i))
|
||||
else:
|
||||
FreeCAD.Console.PrintError(
|
||||
"{}, surface {}, Error: Neither volume nor shell elements found!\n"
|
||||
"{}, surface {}, Error: "
|
||||
"Neither volume nor shell elements found!\n"
|
||||
.format(contact_obj.Label, name)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user