[FEM] activate spring constraint
- the spring constraint is currently unused but it can be used for Elmer mechanical analyses This PR does so and also overhaul the dialog UI. - use the spring constraint also in an example file
This commit is contained in:
@@ -130,6 +130,15 @@ class DeformationWriter:
|
||||
displacement = obj.zDisplacementFormula
|
||||
self.write.boundary(name, "Displacement 3", displacement)
|
||||
self.write.handled(obj)
|
||||
for obj in self.write.getMember("Fem::ConstraintSpring"):
|
||||
if obj.References:
|
||||
for name in obj.References[0][1]:
|
||||
if obj.ElmerStiffness == "Normal Stiffness":
|
||||
spring = float(obj.NormalStiffness.getValueAs("N/m"))
|
||||
else:
|
||||
spring = float(obj.TangentialStiffness.getValueAs("N/m"))
|
||||
self.write.boundary(name, "Spring", spring)
|
||||
self.write.handled(obj)
|
||||
|
||||
def handleDeformationInitial(self, bodies):
|
||||
pass
|
||||
|
||||
@@ -346,6 +346,15 @@ class ElasticityWriter:
|
||||
displacement = obj.zDisplacementFormula
|
||||
self.write.boundary(name, "Displacement 3", displacement)
|
||||
self.write.handled(obj)
|
||||
for obj in self.write.getMember("Fem::ConstraintSpring"):
|
||||
if obj.References:
|
||||
for name in obj.References[0][1]:
|
||||
if obj.ElmerStiffness == "Normal Stiffness":
|
||||
spring = float(obj.NormalStiffness.getValueAs("N/m"))
|
||||
else:
|
||||
spring = float(obj.TangentialStiffness.getValueAs("N/m"))
|
||||
self.write.boundary(name, "Spring", spring)
|
||||
self.write.handled(obj)
|
||||
|
||||
def handleElasticityInitial(self, bodies):
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user