FEM: Add support for CalculiX membrane elements (#22912)
* FEM: Update solver.py * FEM: Update write_femelement_geometry.py * FEM: Update write_mesh.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * FEM: Update solver_calculix.py --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@@ -320,5 +320,21 @@ class SolverCalculiX(base_fempythonobject.BaseFemPythonObject):
|
||||
value=["electrostatic"],
|
||||
)
|
||||
)
|
||||
|
||||
prop.append(
|
||||
_PropHelper(
|
||||
type="App::PropertyBool",
|
||||
name="ExcludeBendingStiffness",
|
||||
group="Solver",
|
||||
doc="Exclude bending stiffness to replace shells with membranes",
|
||||
value=False,
|
||||
)
|
||||
)
|
||||
return prop
|
||||
|
||||
def onDocumentRestored(self, obj):
|
||||
# update old project with new properties
|
||||
for prop in self._get_properties():
|
||||
try:
|
||||
obj.getPropertyByName(prop.name)
|
||||
except Base.PropertyError:
|
||||
prop.add_to_object(obj)
|
||||
|
||||
@@ -423,6 +423,16 @@ class _BaseSolverCalculix:
|
||||
)
|
||||
obj.BucklingAccuracy = 0.01
|
||||
|
||||
if not hasattr(obj, "ExcludeBendingStiffness"):
|
||||
obj.addProperty(
|
||||
"App::PropertyBool",
|
||||
"ExcludeBendingStiffness",
|
||||
"Fem",
|
||||
"Exclude bending stiffness to replace shells with membranes",
|
||||
locked=True,
|
||||
)
|
||||
obj.ExcludeBendingStiffness = False
|
||||
|
||||
|
||||
class Proxy(solverbase.Proxy, _BaseSolverCalculix):
|
||||
"""The Fem::FemSolver's Proxy python type, add solver specific properties"""
|
||||
|
||||
@@ -115,7 +115,14 @@ def write_femelement_geometry(f, ccxwriter):
|
||||
shellth_obj = matgeoset["shellthickness_obj"]
|
||||
if ccxwriter.solver_obj.ModelSpace == "3D":
|
||||
offset = shellth_obj.Offset
|
||||
section_def = f"*SHELL SECTION, {elsetdef}{material}, OFFSET={offset:.13G}\n"
|
||||
if ccxwriter.solver_obj.ExcludeBendingStiffness:
|
||||
section_def = (
|
||||
f"*MEMBRANE SECTION, {elsetdef}{material}, OFFSET={offset:.13G}\n"
|
||||
)
|
||||
else:
|
||||
section_def = (
|
||||
f"*SHELL SECTION, {elsetdef}{material}, OFFSET={offset:.13G}\n"
|
||||
)
|
||||
else:
|
||||
section_def = f"*SOLID SECTION, {elsetdef}{material}\n"
|
||||
thickness = shellth_obj.Thickness.getValueAs("mm").Value
|
||||
|
||||
@@ -48,7 +48,10 @@ def write_mesh(ccxwriter):
|
||||
|
||||
# Use 2D elements if model space is not set to 3D
|
||||
if ccxwriter.solver_obj.ModelSpace == "3D":
|
||||
face_variant = "shell"
|
||||
if ccxwriter.solver_obj.ExcludeBendingStiffness:
|
||||
face_variant = "membrane"
|
||||
else:
|
||||
face_variant = "shell"
|
||||
elif ccxwriter.solver_obj.ModelSpace == "plane stress":
|
||||
face_variant = "stress"
|
||||
elif ccxwriter.solver_obj.ModelSpace == "plane strain":
|
||||
|
||||
Reference in New Issue
Block a user