Itasca C++ Interface
Loading...
Searching...
No Matches
icontactmechanical.h
Go to the documentation of this file.
1#pragma once
2// icontactmechanical.h
3#include "base/src/mat.h"
4
5#include "base/src/to.h"
6#include "shared/interface/signal.h"
13namespace itasca {
14 class IThing;
15}
16
17namespace itascaxd {
18 using namespace itasca;
19
20 class IContact;
21 class IContactModel;
22 class IContactModelMechanical;
23 class IPiece;
24 class IPieceMechanical;
25
27
39 public:
41 inline static const TType type_ = 0x04c815ba9;
42
44 using fid_signal = shared::Signal<IContactModel *,const IContact *>;
45
47 virtual const IThing * getIThing() const=0;
48 virtual IThing * getIThing()=0;
50 virtual const IContact * getContact() const=0;
51 virtual IContact * getContact()=0;
53 virtual const IPiece * getEnd1() const=0;
54 virtual IPiece * getEnd1()=0;
56 virtual const IPieceMechanical * getEnd1Mechanical() const=0;
59 virtual const IPiece * getEnd2() const=0;
60 virtual IPiece * getEnd2()=0;
62 virtual const IPieceMechanical * getEnd2Mechanical() const=0;
64 // Return the curvature of end1
65 virtual DVect2 getEnd1Curvature() const=0;
66 // Return the curvature of end2
67 virtual DVect2 getEnd2Curvature() const=0;
68 // Return the curvature of end1
69 virtual DVect2 getEnd1Extent() const=0;
70 // Return the curvature of end2
71 virtual DVect2 getEnd2Extent() const=0;
73 virtual const IContactModel * getModel() const=0;
74 virtual IContactModel * getModel()=0;
76 virtual const IContactModelMechanical *getModelMechanical() const=0;
77 virtual IContactModelMechanical * getModelMechanical()=0;
79 virtual IContactModel * setModel(const IContactModel *toClone,bool validate=true)=0;
81 virtual void replaceContactModel(IContactModel*)=0;
83 virtual string getModelName() const=0;
85 virtual IContactModel * setModelName(const string &name)=0;
87 virtual base::Property getProperty(const string &name) const=0;
89 virtual bool setProperty(const base::Property &v,const string &name)=0;
91 virtual uint32 getPropertyIndex(const string &name) const=0;
93 virtual string getPropertyName(uint32 index) const=0;
95 virtual DVect getLocalForce() const=0;
97 virtual DAVect getLocalMomentOn1() const=0;
99 virtual DAVect getLocalMomentOn2() const=0;
101 virtual DVect getGlobalForce() const=0;
103 virtual double getNormalForce() const=0;
105 virtual double getShearForce() const=0;
107 virtual DAVect getGlobalMomentOn1() const=0;
109 virtual DAVect getGlobalMomentOn2() const=0;
111 virtual uint32 getFID() const=0;
113 virtual void setFID(uint32 i)=0;
115 virtual fid_signal * getFIDSignal() =0;
117 virtual void executeFIDSignal(IContactModel *)=0;
119 virtual void executeFIDSignal(IContactModel *) const=0;
121 virtual double getGap() const=0;
123 virtual double calculateOverlapVolume() const = 0;
127 virtual DVect getLength() const = 0;
129 virtual void updateResultingTorqueOn1Local(const DVect &forceOn2,DAVect *ret) const=0;
131 virtual void updateResultingTorqueOn2Local(const DVect &forceOn2,DAVect *ret) const=0;
133 virtual std::pair<DVect,DAVect> getRelativeVelocity() const=0;
135 virtual DVect inGlobal(const DVect &vin) const=0;
137 virtual DVect inLocal(const DVect &vin) const=0;
139 virtual DVect2 getEffectiveTranslationalStiffness() const =0;
140 virtual DAVect getEffectiveRotationalStiffness() const =0;
141
143 virtual bool getIsBonded() const = 0;
145 virtual void unbondMe()=0;
146
147 virtual void setFullUpdate(bool)=0;
148 virtual bool getFullUpdate() const=0;
149 virtual DVect localForceFromStress(const Mat &) const=0;
150 virtual void setForce(const DVect &vin) = 0;
152 virtual bool getJointGeometry(std::vector<DVect> *points,int whichProc=0) const=0;
154 virtual DVect getRelativeLocalVelocity(const DVect &pos) const = 0;
155 };
156
157 inline double calcRSum(const IContactMechanical *c) {
158 return safeDiv(1.0,c->getEnd1Curvature().y()) + safeDiv(1.0,c->getEnd2Curvature().y());
159 }
160
161 inline double calcRSQ(const IContactMechanical *c) {
162 return safeDiv(1.0,std::max(c->getEnd1Curvature().y(),c->getEnd2Curvature().y()));
163 }
164} // namespace itascaxd
165// EoF
Definition property.h:36
Base class for items that will be stored in containers.
Definition ithing.h:31
Definition mat.h:28
Contact class.
Definition icontact.h:33
ContactMechanical class.
Definition icontactmechanical.h:38
virtual std::pair< DVect, DAVect > getRelativeVelocity() const =0
Get the relative velocity and spin in global coordinates.
virtual DVect inGlobal(const DVect &vin) const =0
Convert a local quantity to the global system.
virtual double getNormalForce() const =0
Gets the normal force of this mechanical contact.
virtual void executeFIDSignal(IContactModel *) const =0
Execute the fid_signal with this IContactModel.
virtual DVect getGlobalForce() const =0
sets the force at this mechanical contact to v, expressed in the global coordinate system
virtual fid_signal * getFIDSignal()=0
Get the Signal2 for induction when a fid tag is active. This is used to set the contact model propert...
virtual void updateResultingTorqueOn1Local(const DVect &forceOn2, DAVect *ret) const =0
Given a force on end2 and the contact position calculate the torque on end1 - in local coordinates.
virtual const IPiece * getEnd2() const =0
returns a pointer to the mechanical contact second IPiece object (e.g. a ball)
virtual uint32 getPropertyIndex(const string &name) const =0
returns the index of the property with name name
virtual bool getJointGeometry(std::vector< DVect > *points, int whichProc=0) const =0
Return contact specific joint geometry. Returns true if triangles.
virtual DVect2 getEffectiveTranslationalStiffness() const =0
Get the contact model effective stiffness in translation (normal,shear) and rotation.
virtual void updateResultingTorqueOn2Local(const DVect &forceOn2, DAVect *ret) const =0
Given a force on end2 and the contact force and position calculate the torque on end2 - in local coor...
virtual string getModelName() const =0
returns the name of the contact model present at this mechanical contact
virtual double getGap() const =0
Return the gap of this mechanical contact. A negative gap corresponds to physical overlap.
virtual DAVect getGlobalMomentOn1() const =0
returns the moment applied to end1 in the global coordinate system
virtual DVect getLocalForce() const =0
returns the force at this mechanical contact, in the contact local coordinate system
virtual bool setProperty(const base::Property &v, const string &name)=0
sets the value of the property with name name
virtual DVect getLength() const =0
virtual const IPieceMechanical * getEnd2Mechanical() const =0
returns a pointer to the mechanical contact second IPieceMechanical object (e.g. a ball)
virtual DVect getRelativeLocalVelocity(const DVect &pos) const =0
Return the relative velocity at a point in local coordinate system.
virtual IContactModel * setModelName(const string &name)=0
assigns the contact model based on a name
virtual double getShearForce() const =0
Gets the shear force of this mechanical contact.
virtual string getPropertyName(uint32 index) const =0
returns the name of the property with index index
virtual uint32 getFID() const =0
Gets the FID ID number, an integer tag associated with each contact.
virtual void replaceContactModel(IContactModel *)=0
Replace the contact model with a new one. The old one is deleted.
virtual const IPiece * getEnd1() const =0
returns a pointer to the mechanical contact first IPiece object (e.g. a ball)
virtual const IThing * getIThing() const =0
returns a IThing pointer
virtual DAVect getLocalMomentOn1() const =0
returns the moment applied to end1 in the contact local coordinate system
virtual DVect inLocal(const DVect &vin) const =0
Convert a global quantity to the local system.
static const TType type_
The type identification number for this class, for use in convert_cast() and convert_getcast().
Definition icontactmechanical.h:41
virtual void setFID(uint32 i)=0
Sets the FID ID number, an integer tag associated with each contact.
shared::Signal< IContactModel *, const IContact * > fid_signal
Fracture ID signal.
Definition icontactmechanical.h:44
virtual bool getIsBonded() const =0
Return the bonding state.
virtual DAVect getGlobalMomentOn2() const =0
returns the moment applied to end2 in the global coordinate system
virtual const IContactModel * getModel() const =0
returns a pointer to the contact model present at this mechanical contact
virtual const IPieceMechanical * getEnd1Mechanical() const =0
returns a pointer to the mechanical contact first IPieceMechanical object (e.g. a ball)
virtual void unbondMe()=0
Unbond the contact.
virtual void executeFIDSignal(IContactModel *)=0
Execute the fid_signal with this IContactModel.
virtual IContactModel * setModel(const IContactModel *toClone, bool validate=true)=0
assigns a clone of the contact model passed in arguments, and copies its properties
virtual const IContact * getContact() const =0
returns a IContact pointer
virtual DAVect getLocalMomentOn2() const =0
returns the moment applied to end2 in the contact local coordinate system
virtual const IContactModelMechanical * getModelMechanical() const =0
returns a pointer to the mechanical contact model present at this mechanical contact
virtual base::Property getProperty(const string &name) const =0
returns the value of the property with name name
virtual double calculateOverlapVolume() const =0
Return the actual volume of the overlaping region between the contacting pieces - null if the overlap...
Definition ipiece.h:16
Definition ipiecemechanical.h:11
uint32 TType
class type indicator
Definition basedef.h:47
DVect3 DVect
Vector of doubles, either 2D or 3D.
Definition dim.h:156
DAVect3 DAVect
Angular vector of doubles, either 2D or 3D.
Definition dim.h:164
namespace Itasca
Definition basememory.cpp:14
Itasca Library standard namespace, specific to 2D or 3D.
Definition icontactmodule.h:6
A overflow checked shorthand for static_cast<T>().