Fem: Change ConstraintPressure::Force property to App::PropertyForce
This commit is contained in:
@@ -54,14 +54,15 @@ def write_meshdata_constraint(f, femobj, force_obj, ccxwriter):
|
||||
f.write("** {}\n".format(ref_shape[0]))
|
||||
for n in sorted(ref_shape[1]):
|
||||
node_load = ref_shape[1][n]
|
||||
# the loads in ref_shape[1][n] are without unit
|
||||
if abs(direction_vec.x) > dir_zero_tol:
|
||||
v1 = "{:.13E}".format(direction_vec.x * node_load)
|
||||
v1 = "{}".format(direction_vec.x * node_load)
|
||||
f.write("{},1,{}\n".format(n, v1))
|
||||
if abs(direction_vec.y) > dir_zero_tol:
|
||||
v2 = "{:.13E}".format(direction_vec.y * node_load)
|
||||
v2 = "{}".format(direction_vec.y * node_load)
|
||||
f.write("{},2,{}\n".format(n, v2))
|
||||
if abs(direction_vec.z) > dir_zero_tol:
|
||||
v3 = "{:.13E}".format(direction_vec.z * node_load)
|
||||
v3 = "{}".format(direction_vec.z * node_load)
|
||||
f.write("{},3,{}\n".format(n, v3))
|
||||
f.write("\n")
|
||||
f.write("\n")
|
||||
|
||||
@@ -97,7 +97,7 @@ class DeformationWriter:
|
||||
for obj in self.write.getMember("Fem::ConstraintForce"):
|
||||
if obj.References:
|
||||
for name in obj.References[0][1]:
|
||||
force = self.write.getFromUi(obj.Force, "N", "M*L*T^-2")
|
||||
force = float(obj.Force.getValueAs("N"))
|
||||
self.write.boundary(name, "Force 1", obj.DirectionVector.x * force)
|
||||
self.write.boundary(name, "Force 2", obj.DirectionVector.y * force)
|
||||
self.write.boundary(name, "Force 3", obj.DirectionVector.z * force)
|
||||
|
||||
@@ -313,7 +313,7 @@ class ElasticityWriter:
|
||||
for obj in self.write.getMember("Fem::ConstraintForce"):
|
||||
if obj.References:
|
||||
for name in obj.References[0][1]:
|
||||
force = self.write.getFromUi(obj.Force, "N", "M*L*T^-2")
|
||||
force = float(obj.Force.getValueAs("N"))
|
||||
self.write.boundary(name, "Force 1", obj.DirectionVector.x * force)
|
||||
self.write.boundary(name, "Force 2", obj.DirectionVector.y * force)
|
||||
self.write.boundary(name, "Force 3", obj.DirectionVector.z * force)
|
||||
|
||||
@@ -50,6 +50,7 @@ def add_con_force(f, model, mystran_writer):
|
||||
for ref_shape in femobj["NodeLoadTable"]:
|
||||
force_code += "# {}\n".format(ref_shape[0])
|
||||
for n in sorted(ref_shape[1]):
|
||||
# the loads in ref_shape[1][n] are without unit
|
||||
node_load = ref_shape[1][n]
|
||||
force_code += (
|
||||
"model.add_force(sid={}, node={}, mag={}, xyz=({}, {}, {}))\n"
|
||||
|
||||
@@ -157,6 +157,7 @@ class FemInputWriterZ88(writerbase.FemInputWriter):
|
||||
direction_vec = femobj["Object"].DirectionVector
|
||||
for ref_shape in femobj["NodeLoadTable"]:
|
||||
for n in sorted(ref_shape[1]):
|
||||
# the loads in ref_shape[1][n] are without unit
|
||||
node_load = ref_shape[1][n]
|
||||
if (direction_vec.x != 0.0):
|
||||
v1 = direction_vec.x * node_load
|
||||
|
||||
Reference in New Issue
Block a user