Fem: Add support for 2D geometries to Centrif constraint

This commit is contained in:
marioalexis
2025-09-01 15:32:35 -03:00
committed by Kacper Donat
parent eab485656f
commit 4d25baf1ee
3 changed files with 18 additions and 16 deletions

View File

@@ -467,16 +467,11 @@ class MeshSetsGetter:
# ********************************************************************************************
# element sets constraints
def get_constraints_centrif_elements(self):
# get element ids and write them into the femobj
if not self.member.cons_centrif:
return
if (
len(self.member.cons_centrif) == 1
and not self.member.cons_centrif[0]["Object"].References
):
self.member.cons_centrif[0]["FEMElements"] = self.ccx_evolumes
else:
self.get_solid_element_sets(self.member.cons_centrif)
for femobj in self.member.cons_centrif:
obj = femobj["Object"]
result = self._get_ccx_elements(obj)
femobj["CentrifElements"] = result
def get_constraints_bodyheatsource_elements(self):
for femobj in self.member.cons_bodyheatsource:

View File

@@ -60,12 +60,16 @@ def get_after_write_constraint():
def write_meshdata_constraint(f, femobj, centrif_obj, ccxwriter):
f.write(f"*ELSET,ELSET={centrif_obj.Name}\n")
if isinstance(femobj["FEMElements"], str):
f.write("{}\n".format(femobj["FEMElements"]))
else:
for e in femobj["FEMElements"]:
f.write(f"{e},\n")
for refs, elem, is_sub_el in femobj["CentrifElements"]:
if not is_sub_el:
for e in elem:
f.write(f"{e},\n")
# use all elements if there are no references
if not femobj["CentrifElements"]:
f.write(f"{ccxwriter.ccx_eall}\n")
def write_constraint(f, femobj, centrif_obj, ccxwriter):

View File

@@ -62,10 +62,13 @@ class _TaskPanel(base_femtaskpanel._BaseTaskPanel):
self.axis_selection_widget = selection_widgets.GeometryElementsSelection(
obj.RotationAxis, ["Edge"], False, False
)
self.axis_selection_widget.setWindowTitle(
self.axis_selection_widget.tr("Axis Reference Selector")
)
# loaded body selection widget
self.body_selection_widget = selection_widgets.GeometryElementsSelection(
obj.References, ["Solid"], False, False
obj.References, ["Solid", "Face"], False, False
)
# form made from param and selection widget