diff --git a/src/Mod/Fem/App/FemConstraintContact.cpp b/src/Mod/Fem/App/FemConstraintContact.cpp index 3975c4339f..95f50e3c6c 100644 --- a/src/Mod/Fem/App/FemConstraintContact.cpp +++ b/src/Mod/Fem/App/FemConstraintContact.cpp @@ -30,6 +30,8 @@ using namespace Fem; PROPERTY_SOURCE(Fem::ConstraintContact, Fem::Constraint) +static const char* SurfaceBehaviors[] = {"Hard", "Linear", "Tied", nullptr}; + ConstraintContact::ConstraintContact() { /*Note: Initialise parameters here*/ @@ -68,11 +70,12 @@ ConstraintContact::ConstraintContact() "ConstraintContact", App::PropertyType(App::Prop_None), "Thermal contact conductance"); - ADD_PROPERTY_TYPE(HardContact, - (false), + ADD_PROPERTY_TYPE(SurfaceBehavior, + (1), "ConstraintContact", - App::PropertyType(App::Prop_None), - "Enable hard contact"); + App::Prop_None, + "Surface behavior type"); + SurfaceBehavior.setEnums(SurfaceBehaviors); } App::DocumentObjectExecReturn* ConstraintContact::execute() diff --git a/src/Mod/Fem/App/FemConstraintContact.h b/src/Mod/Fem/App/FemConstraintContact.h index 416c105954..f6a93cbdf3 100644 --- a/src/Mod/Fem/App/FemConstraintContact.h +++ b/src/Mod/Fem/App/FemConstraintContact.h @@ -53,7 +53,7 @@ public: App::PropertyStiffnessDensity StickSlope; App::PropertyBool EnableThermalContact; App::PropertyStringList ThermalContactConductance; - App::PropertyBool HardContact; + App::PropertyEnumeration SurfaceBehavior; // etc /* */ diff --git a/src/Mod/Fem/femsolver/calculix/write_constraint_contact.py b/src/Mod/Fem/femsolver/calculix/write_constraint_contact.py index c46873c351..e8d02d1e6d 100644 --- a/src/Mod/Fem/femsolver/calculix/write_constraint_contact.py +++ b/src/Mod/Fem/femsolver/calculix/write_constraint_contact.py @@ -92,12 +92,18 @@ def write_constraint(f, femobj, contact_obj, ccxwriter): dep_surf = "DEP" + contact_obj.Name f.write(f"{dep_surf}, {ind_surf}\n") f.write(f"*SURFACE INTERACTION, NAME=INT{contact_obj.Name}\n") - if contact_obj.HardContact: - f.write("*SURFACE BEHAVIOR, PRESSURE-OVERCLOSURE=HARD\n") - else: + if contact_obj.SurfaceBehavior == "Linear": f.write("*SURFACE BEHAVIOR, PRESSURE-OVERCLOSURE=LINEAR\n") slope = contact_obj.Slope.getValueAs("MPa/mm").Value f.write(f"{slope:.13G}\n") + elif contact_obj.SurfaceBehavior == "Hard": + f.write("*SURFACE BEHAVIOR, PRESSURE-OVERCLOSURE=HARD\n") + elif contact_obj.SurfaceBehavior == "Tied": + f.write("*SURFACE BEHAVIOR, PRESSURE-OVERCLOSURE=TIED\n") + slope = contact_obj.Slope.getValueAs("MPa/mm").Value + f.write(f"{slope:.13G}\n") + else: + return if contact_obj.Friction: f.write("*FRICTION\n") friction = contact_obj.FrictionCoefficient