Itasca C++ Interface
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
contactmodelmechanical.h
Go to the documentation of this file.
1 #pragma once
2 // contactmodelmechanical.h
9 #include "contactmodel.h"
10 #include "contactmodel/interface/icontactmodelmechanical.h"
11 
12 #pragma warning(push)
13 #pragma warning(disable:4251)
14 
15 namespace itascaxd
16 {
17  class IContactMechanical;
18  class IContactThermal;
19 }
20 
21 namespace cmodelsxd
22 {
23  using namespace itasca;
24  using namespace itascaxd;
25 
26  class ContactModelThermalState;
33  {
34  public:
36  ContactModelMechanicalState() : //force_(0.0)
37  //, momentOn1_(0.0)
38  //, momentOn2_(0.0)
39  /*,*/ relativeTranslationalIncrement_(0.0)
40  , relativeAngularIncrement_(0.0)
41  , end1Curvature_(0.0)
42  , end2Curvature_(0.0)
43  , inertialMass_(0.0)
44  , gap_(0.0)
45  , canFail_(true) { }
46 
47 
51  virtual const IContactMechanical *getMechanicalContact() const=0;
53  virtual const IContact * getContact() const=0;
54 
55  //DVect force_; ///< current total force at this contact (computed by the contact model)
56  //DAVect momentOn1_; ///< moment applied to end1
57  //DAVect momentOn2_; ///< moment applied to end2
60  DVect2 end1Curvature_;
61  DVect2 end2Curvature_;
62  double inertialMass_;
63  double gap_;
64  bool canFail_;
65  };
66 
72  class CONTACTMODEL_EXPORT ContactModelMechanical : public ContactModel
73  , public IContactModelMechanical {
74  public:
77 
79  virtual ~ContactModelMechanical();
80 
82  static const char * getPluginPrefix() { return "contactmodelmechanical"; }
83 
85  static const char * getPluginDirectory() { return "contactmodels/mechanical"; }
86 
87  // IContactModel overrides
88 
90  virtual bool isOKToDelete() const { return true; }
91 
92  // IContactModelMechanical functions.
93 
95  virtual ContactModel * getContactModel() {return this;}
96 
98  virtual const ContactModel * getContactModel() const {return this;}
99 
101  virtual bool checkActivity(const double &) {return false;}
102 
104  virtual bool isSliding() const { return false; }
105 
107  virtual bool isBonded() const { return false; }
108 
110  virtual void unbond() { }
111 
113  virtual bool hasNormal() const { return false; };
114 
116  virtual DVect3 getNormal() const { return DVect3(0.0); }
117 
119  virtual void propagateStateInformation(IContactModelMechanical *,const CAxes &n=CAxes(),const CAxes &l=CAxes()) {n; l;}
120 
123  virtual bool endPropertyUpdated(const QString &name,const IContactMechanical *c)=0;
124 
126  virtual bool validate(ContactModelMechanicalState *state,const double &timestep)=0;
127 
130  virtual bool forceDisplacementLaw(ContactModelMechanicalState *state,const double &timestep)=0;
131 
133  virtual bool thermalCoupling(ContactModelMechanicalState *,ContactModelThermalState * ,IContactThermal *,const double &) {return false;}
134 
137  virtual DVect2 getTimestepLimits(ContactModelMechanicalState *,const double &) const { return DVect2(0.0,limits<double>::max());}
138 
140  virtual DVect2 getEffectiveTranslationalStiffness() const {return DVect2(0.0,0.0);}
141 
143  virtual DAVect getEffectiveRotationalStiffness() const {return DAVect(0.0);}
144 
146  virtual void getSphereList(const IContact *con,std::vector<DVect> *pos,std::vector<double> *rad,std::vector<double> *val) { con; pos; rad; val; }
147 #ifdef THREED
148 
150  virtual void getDiskList(const IContact *con,std::vector<DVect> *pos,std::vector<DVect> *normal,std::vector<double> *radius,std::vector<double> *val) { con; pos; normal; radius; val; }
151 #endif
152 
154  virtual void getCylinderList(const IContact *con,std::vector<DVect> *bot,std::vector<DVect> *top,std::vector<double> *radlow,std::vector<double> *radhi,std::vector<double> *val) { con; bot; top; radlow; radhi; val; }
155 
157  virtual DVect getForce(const IContactMechanical *) const { return DVect(0.0); }
158 
160  virtual DAVect getMomentOn1(const IContactMechanical *) const { return DAVect(0.0); }
161 
163  virtual DAVect getMomentOn2(const IContactMechanical *c) const { return getMomentOn1(c); }
164 
165  virtual ContactModelMechanical *clone() const { throw Exception("Must be reimplemented."); }
166 
167  };
168 } // namespace cmodelxd
169 
170 #pragma warning(pop)
171 
172 
173 // EoF
virtual ~ContactModelMechanicalState()
Destructor.
Definition: contactmodelmechanical.h:49
Base exception class for all Itasca code.
Definition: baseqexception.h:9
virtual DAVect getMomentOn2(const IContactMechanical *c) const
Return the total moment on 2 that the contact model holds.
Definition: contactmodelmechanical.h:163
virtual ContactModelMechanical * clone() const
Make a clone of this contact model. Must be implemeted.
Definition: contactmodelmechanical.h:165
Class for specifying a particular 3D cartesian axes system, and converting to and from it.
Definition: caxes.h:103
ContactThermal class.
Definition: icontactthermal.h:37
virtual void unbond()
Default implementation - the contact model is not bonded.
Definition: contactmodelmechanical.h:110
virtual bool isOKToDelete() const
Generic implementation - by default it is always OK to delete a contact.
Definition: contactmodelmechanical.h:90
virtual void getSphereList(const IContact *con, std::vector< DVect > *pos, std::vector< double > *rad, std::vector< double > *val)
Default implementation so that no sphere list must be defined.
Definition: contactmodelmechanical.h:146
Contact model class.
virtual DVect getForce(const IContactMechanical *) const
Return the total force that the contact model holds.
Definition: contactmodelmechanical.h:157
bool canFail_
failure should be discarded
Definition: contactmodelmechanical.h:64
double inertialMass_
Effective inertial mass of the contact (required for viscous damping)
Definition: contactmodelmechanical.h:62
namespace Itasca
Definition: basememory.cpp:9
The ContactModelState class holds necessary information to communicate back and forth between the cod...
Definition: contactmodel.h:43
virtual DVect2 getTimestepLimits(ContactModelMechanicalState *, const double &) const
Definition: contactmodelmechanical.h:137
ContactModelMechanicalState()
Constructor.
Definition: contactmodelmechanical.h:36
double gap_
current contact gap
Definition: contactmodelmechanical.h:63
virtual DAVect getMomentOn1(const IContactMechanical *) const
Return the total moment on 1 that the contact model holds.
Definition: contactmodelmechanical.h:160
virtual ContactModel * getContactModel()
Return the IContactModel pointer.
Definition: contactmodelmechanical.h:95
virtual void propagateStateInformation(IContactModelMechanical *, const CAxes &n=CAxes(), const CAxes &l=CAxes())
Default implementation - state information is not propagated.
Definition: contactmodelmechanical.h:119
virtual bool thermalCoupling(ContactModelMechanicalState *, ContactModelThermalState *, IContactThermal *, const double &)
Used for explicit mechanical/thermal coupling. Returns true if anything changed.
Definition: contactmodelmechanical.h:133
virtual bool hasNormal() const
Default implementation - the contact model has no normal.
Definition: contactmodelmechanical.h:113
static const char * getPluginDirectory()
Directory for this type of plugin.
Definition: contactmodelmechanical.h:85
Mechanical contact model implementation.
Definition: contactmodelmechanical.h:72
static const char * getPluginPrefix()
Prefix for this type of plugin.
Definition: contactmodelmechanical.h:82
DVect relativeTranslationalIncrement_
current relative translational displacement increment
Definition: contactmodelmechanical.h:58
virtual bool isBonded() const
Default implementation - the contact model is not bonded.
Definition: contactmodelmechanical.h:107
CAxes3D CAxes
Compact axis system, either 2D or 3D.
Definition: dim.h:154
debug checked shorthand for std::numeric_limits<T>::
Definition: limit.h:25
ContactMechanical class.
Definition: icontactmechanical.h:37
The ContactModelMechnicalState class holds necessary information to communicate back and forth betwee...
Definition: contactmodelmechanical.h:32
DVect2 end2Curvature_
principal curvatures of end2 (min,max)
Definition: contactmodelmechanical.h:61
virtual bool checkActivity(const double &)
Default implementation - the contact is not active.
Definition: contactmodelmechanical.h:101
Itasca Library standard namespace, specific to 2D or 3D.
Definition: icontactmodule.h:4
DAVect3 DAVect
Angular vector of doubles, either 2D or 3D.
Definition: dim.h:151
virtual bool isSliding() const
Default implementation - the contact model is not sliding.
Definition: contactmodelmechanical.h:104
Definition: contactmodelthermal.h:21
DVect2 end1Curvature_
principal curvatures of end1 (min,max)
Definition: contactmodelmechanical.h:60
DVect3 DVect
Vector of doubles, either 2D or 3D.
Definition: dim.h:145
Contact class.
Definition: icontact.h:34
Contact model implementation.
Definition: contactmodel.h:74
DAVect relativeAngularIncrement_
current relative angular displacement increment
Definition: contactmodelmechanical.h:59
virtual DVect3 getNormal() const
Default implementation - the contact model normal is the 0 vector.
Definition: contactmodelmechanical.h:116
virtual const ContactModel * getContactModel() const
Return the const IContactModel pointer.
Definition: contactmodelmechanical.h:98
virtual DVect2 getEffectiveTranslationalStiffness() const
Return the effective translational stiffness - used for timestep calculation.
Definition: contactmodelmechanical.h:140
virtual void getCylinderList(const IContact *con, std::vector< DVect > *bot, std::vector< DVect > *top, std::vector< double > *radlow, std::vector< double > *radhi, std::vector< double > *val)
Default implementation so that no cylinder list must be defined.
Definition: contactmodelmechanical.h:154
virtual DAVect getEffectiveRotationalStiffness() const
Return the effective rotational stiffness - used for timestep calculation.
Definition: contactmodelmechanical.h:143