| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| |
|
| |
|
| | #include "FemConstraintContact.h" |
| |
|
| |
|
| | using namespace Fem; |
| |
|
| | PROPERTY_SOURCE(Fem::ConstraintContact, Fem::Constraint) |
| |
|
| | static const char* SurfaceBehaviors[] = {"Hard", "Linear", "Tied", nullptr}; |
| |
|
| | ConstraintContact::ConstraintContact() |
| | { |
| | |
| | ADD_PROPERTY_TYPE( |
| | Slope, |
| | (0.0), |
| | "ConstraintContact", |
| | App::PropertyType(App::Prop_None), |
| | "Contact stiffness" |
| | ); |
| | ADD_PROPERTY_TYPE( |
| | Adjust, |
| | (0.0), |
| | "ConstraintContact", |
| | App::PropertyType(App::Prop_None), |
| | "Node clearance adjustment limit" |
| | ); |
| | ADD_PROPERTY_TYPE( |
| | Friction, |
| | (false), |
| | "ConstraintContact", |
| | App::PropertyType(App::Prop_None), |
| | "Enable friction interaction" |
| | ); |
| | ADD_PROPERTY_TYPE( |
| | FrictionCoefficient, |
| | (0.0), |
| | "ConstraintContact", |
| | App::PropertyType(App::Prop_None), |
| | "Friction coefficient" |
| | ); |
| | ADD_PROPERTY_TYPE( |
| | StickSlope, |
| | (0.0), |
| | "ConstraintContact", |
| | App::PropertyType(App::Prop_None), |
| | "Stick slope" |
| | ); |
| | ADD_PROPERTY_TYPE( |
| | EnableThermalContact, |
| | (false), |
| | "ConstraintContact", |
| | App::PropertyType(App::Prop_None), |
| | "Enable thermal contact" |
| | ); |
| | ADD_PROPERTY_TYPE( |
| | ThermalContactConductance, |
| | (std::vector<std::string> {}), |
| | "ConstraintContact", |
| | App::PropertyType(App::Prop_None), |
| | "Thermal contact conductance" |
| | ); |
| | ADD_PROPERTY_TYPE(SurfaceBehavior, (1), "ConstraintContact", App::Prop_None, "Surface behavior type"); |
| | SurfaceBehavior.setEnums(SurfaceBehaviors); |
| | } |
| |
|
| | App::DocumentObjectExecReturn* ConstraintContact::execute() |
| | { |
| | return Constraint::execute(); |
| | } |
| |
|
| | const char* ConstraintContact::getViewProviderName() const |
| | { |
| | return "FemGui::ViewProviderFemConstraintContact"; |
| | } |
| |
|
| | void ConstraintContact::onChanged(const App::Property* prop) |
| | { |
| | Constraint::onChanged(prop); |
| | } |
| |
|
| | void ConstraintContact::handleChangedPropertyType( |
| | Base::XMLReader& reader, |
| | const char* typeName, |
| | App::Property* prop |
| | ) |
| | { |
| | if (prop == &Slope && strcmp(typeName, "App::PropertyFloat") == 0) { |
| | App::PropertyFloat oldSlope; |
| | oldSlope.Restore(reader); |
| | |
| | Slope.setValue(oldSlope.getValue() * 1000); |
| |
|
| | |
| | StickSlope.setValue(Slope.getValue() / 10); |
| | } |
| | else if (prop == &Friction && strcmp(typeName, "App::PropertyFloat") == 0) { |
| | App::PropertyFloat oldFriction; |
| | oldFriction.Restore(reader); |
| | FrictionCoefficient.setValue(oldFriction.getValue()); |
| |
|
| | Friction.setValue(oldFriction.getValue() > 0 ? true : false); |
| | } |
| | else { |
| | Constraint::handleChangedPropertyType(reader, typeName, prop); |
| | } |
| | } |
| |
|