Itasca C++ Interface
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
irblock.h
1 #pragma once
2 #include "base/src/farray.h"
3 
4 namespace itasca {
5  class IThing;
6  class IGroup;
7  class IContainer;
8 }
9 
10 namespace itascaxd {
11  class IPiece;
12  class IPieceMechanical;
13  class IBodyMechanical;
14  class IRigidBodyMechanical;
15  class IBody;
16  class IContact;
17  class IHalfFacet;
18  class IHalfVertex;
19 }
20 
21 namespace rblock {
22  using namespace itasca;
23  using namespace itascaxd;
24 
25  class IRBlock {
26  public:
28  inline static const TType type_ = 0x5595cd9e;
30  virtual IThing * getIThing()=0;
32  virtual const IThing * getIThing() const=0;
34  virtual IRBlock * getNextIRBlock()=0;
36  virtual const IRBlock * getNextIRBlock() const=0;
38  virtual DExtent3 getExtent() const=0;
39  // Return the cell extent
40  virtual const DExtent &getCellExtent() const=0;
41 
42 
44  virtual void getGeometry(FArray<DVect> *vert,FArray<int> *fac=0) const=0;
46  virtual DVect getBallOffset() const=0;
48  virtual double getBallRadius() const=0;
50  virtual double getAspectRatio() const=0;
52  virtual void getFacetGeometry(FArray<DVect> *vert) const=0;
54  virtual void getEdgeInfo(FArray<IVect3> *info) const=0;
56  virtual DVect getVertexOfFacet(int fac,int ver) const=0;
58  virtual double getFacetArea(int fac) const = 0;
60  virtual DVect getVertex(int ver) const=0;
62  virtual DVect getClosestPointOnFacet(const DVect &,int fac) const =0;
65  virtual int getFacetClosestToPoint(const DVect &) const =0;
67  virtual DVect getFacetNormal(int fac) const=0;
69  virtual DVect getFacetPosition(int fac) const=0;
71  virtual bool getIsIn(const DVect &) const = 0;
72 
73 
75  virtual int getNumberFacets() const=0;
77  virtual int getNumberVertices() const=0;
79  virtual void getFacesAdjacentToVertex(quint16 v,FArray<quint16> *ret) const=0;
81  virtual const IPiece * getIPiece() const = 0;
82  virtual IPiece * getIPiece() = 0;
84  virtual const IBody * getIBody() const = 0;
85  virtual IBody * getIBody() = 0;
87  virtual const IBodyMechanical * getIBodyMechanical() const = 0;
88  virtual IBodyMechanical * getIBodyMechanical() = 0;
90  virtual const IRigidBodyMechanical * getIRigidBodyMechanical() const = 0;
91  virtual IRigidBodyMechanical * getIRigidBodyMechanical() = 0;
93  virtual DAVect getMoi() const=0;
95  virtual DAVect getInertialMoi() const=0;
98  virtual double getMoiComp(int) const = 0;
101  virtual double getInertialMoiComp(int) const = 0;
102 
103 #ifdef THREED
104  virtual SymTensor getInertialMoiTensor() const = 0;
106  virtual SymTensor getMoiTensor() const = 0;
107 #endif
108  virtual void setMoiComp(const double &,int) = 0;
110 
112  virtual void setMoi(const DAVect &d)=0;
113 
115  virtual void setMoiFix(bool b)=0;
116  virtual bool isMoiFix()=0;
117  virtual bool isMoiFix() const=0;
118 
120  virtual void setVolumeNoScale(const double &d)=0;
121 
123  virtual void getContactList(FArray<IContact *> *ret,const TType &type=0,const IPiece *p2=0)=0;
125  virtual void getContactList(FArray<const IContact *> *ret,const TType &type=0,const IPiece *p2=0) const=0;
127  virtual quint64 getContactCount(bool active,const TType &type=0,bool domainToo = false) const=0;
128 
130  virtual DMatrix<DIM,DIM> getStress() const=0;
131 
134  virtual bool rotate(const DVect &rotp,const DVect &axis,const double &w,bool update=true,bool noThrow = false) = 0;
136  virtual bool scale(const double &)=0;
138  virtual void getSurfaceRotMatrix(DMatrix<dim,dim> *) const=0;
139 
141  virtual bool getFix(quint32 dof) const=0;
143  virtual void setFix(quint32 dof,bool b)=0;
145  virtual double getVolume() const=0;
147  virtual double getLocalDamping() const=0;
149  virtual void setLocalDamping(const double &d)=0;
151  virtual double getDensity() const=0;
153  virtual void setDensity(const double &d)=0;
155  virtual double getInertialMass() const=0;
157  virtual double getMass() const=0;
159  virtual int getFragmentIndex() const=0;
161  virtual void setFragmentIndex(int ind)=0;
163  virtual DVect getCentroid() const=0;
165  virtual void setCentroid(const DVect &p)=0;
167  virtual DVect getDisplacement() const=0;
169  virtual void setDisplacement(const DVect &v)=0;
170 #ifdef TWOD
171  virtual double getAngDisplacement() const=0;
174  virtual void setAngDisplacement(const double &v)=0;
175 #endif
176  virtual DVect getVelocity() const=0;
179  virtual void setVelocity(const DVect &p)=0;
181  virtual DAVect getAngVelocity() const=0;
183  virtual void setAngVelocity(const DAVect &p)=0;
185  virtual DVect getAppliedForce() const=0;
187  virtual void setAppliedForce(const DVect &v)=0;
189  virtual DAVect getAppliedMoment() const=0;
191  virtual void setAppliedMoment(const DAVect &v)=0;
193  virtual DVect getContactForce() const=0;
195  virtual void setContactForce(const DVect &v)=0;
197  virtual DVect getUnbalancedForce() const=0;
199  virtual DAVect getUnbalancedMoment() const=0;
201  virtual DAVect getContactMoment() const=0;
203  virtual void setContactMoment(const DAVect &v)=0;
204 
206  virtual DVect getPosition() const = 0;
208  virtual double getRounding() const = 0;
209 #ifdef THREED
210  virtual DVect getEulerFromOrient() const=0;
211  virtual void setOrientFromEuler(const DVect3 &d)=0;
212 #endif
213 
215  virtual QString getFaceGroupName(uint side,const ISlotID &slot=ISlotID()) const=0;
216 
217  };
218 } // namespace rblock
219 // EoF
220 
namespace Itasca
Definition: basememory.cpp:9
DMatrix is a Matrix that defaults to type double...
Definition: matrix.h:719
Base class for items that will be stored in containers.
Definition: ithing.h:31
An array class that attempts to minimize unnecessary heap access.
Definition: ipiece.h:15
Definition: irigidbodymechanical.h:7
unsigned int TType
class type indicator
Definition: basedef.h:41
A symmetric 2nd order tensor.
Definition: symtensor.h:19
DExtent3 DExtent
A DExtent2 in 2D, a DExtent3 in 3D.
Definition: dim.h:149
Definition: ibodymechanical.h:13
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
Definition: irblock.h:25
DVect3 DVect
Vector of doubles, either 2D or 3D.
Definition: dim.h:145
Definition: igroup.h:51
Definition: ibody.h:20