Itasca C++ Interface
Loading...
Searching...
No Matches
irblock.h
1#pragma once
2#include "base/src/farray.h"
3
4namespace itasca {
5 class IThing;
6 class IGroup;
7 class IContainer;
8}
9
10namespace 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
21namespace 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;
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
105 virtual SymTensor getInertialMoiTensor() const = 0;
106 virtual SymTensor getMoiTensor() const = 0;
107#endif
109 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
172 virtual double getAngDisplacement() const=0;
174 virtual void setAngDisplacement(const double &v)=0;
175#endif
177 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
DMatrix is a Matrix that defaults to type double...
Definition matrix.h:758
An array class that attempts to minimize unnecessary heap access.
Definition farray.h:25
A symmetric 2nd order tensor.
Definition symtensor.h:22
Definition igroup.h:41
Base class for items that will be stored in containers.
Definition ithing.h:30
Definition ibody.h:20
Definition ibodymechanical.h:13
Definition ipiece.h:15
Definition irigidbodymechanical.h:7
Definition irblock.h:25
virtual bool scale(const double &)=0
Scale the rblock to have this area or volume.
virtual void getFacetGeometry(FArray< DVect > *vert) const =0
Get the vertices listed out in facet format.
virtual DVect getBallOffset() const =0
Returns the ball position containing the block.
virtual double getFacetArea(int fac) const =0
Get the area of a facet.
virtual int getNumberVertices() const =0
Return the number of vertices.
virtual void getContactList(FArray< IContact * > *ret, const TType &type=0, const IPiece *p2=0)=0
Return a list of IContacts.
virtual double getMoiComp(int) const =0
virtual DAVect getContactMoment() const =0
Return the resultant of all contact moments.
virtual DVect getVertex(int ver) const =0
Get the vertex.
virtual void setFragmentIndex(int ind)=0
Set the fragment index.
virtual DAVect getAngVelocity() const =0
Get the angular velocity.
virtual DVect getUnbalancedForce() const =0
Return the unbalanced force.
virtual DVect getFacetNormal(int fac) const =0
Get the facet normal.
virtual void setLocalDamping(const double &d)=0
Set the local damping coefficient.
virtual double getAspectRatio() const =0
Returns the aspect ratio of the block.
virtual DVect getFacetPosition(int fac) const =0
Get the facet position.
virtual DVect getClosestPointOnFacet(const DVect &, int fac) const =0
Get the closest point on a facet to a point in space.
virtual double getInertialMoiComp(int) const =0
virtual void setVelocity(const DVect &p)=0
Set the velocity.
virtual IThing * getIThing()=0
Return an IThing interface for this object.
virtual void getFacesAdjacentToVertex(quint16 v, FArray< quint16 > *ret) const =0
Return the facets adjacent to this vertex.
virtual DAVect getAppliedMoment() const =0
Return the applied moment.
virtual const IPiece * getIPiece() const =0
Return the IPiece pointer.
virtual DVect getContactForce() const =0
Return the resultant of all contact forces.
virtual void setAngVelocity(const DAVect &p)=0
Set the angular velocity.
virtual void getContactList(FArray< const IContact * > *ret, const TType &type=0, const IPiece *p2=0) const =0
Return a list of const IContacts.
virtual IRBlock * getNextIRBlock()=0
Return the next IRBlock object in the global list, or 0 if it is the last set.
virtual const IThing * getIThing() const =0
Return a const IThing interface for this object.
virtual void getSurfaceRotMatrix(DMatrix< dim, dim > *) const =0
Get the rotation matrix with reference to the principal axis system.
virtual const IRBlock * getNextIRBlock() const =0
Return the next IRBlock object in the global list, or 0 if it is the last set.
virtual QString getFaceGroupName(uint side, const ISlotID &slot=ISlotID()) const =0
Support for face groups.
virtual DAVect getMoi() const =0
Return the inertia tensor in principal axis form.
virtual DVect getVertexOfFacet(int fac, int ver) const =0
Get the vertex of a facet.
virtual void setAppliedForce(const DVect &v)=0
Set the applied force.
virtual double getVolume() const =0
Get the volume.
virtual quint64 getContactCount(bool active, const TType &type=0, bool domainToo=false) const =0
Return the number of contacts.
virtual double getRounding() const =0
Return the rounding.
virtual DVect getCentroid() const =0
Get the centroid.
virtual const IBodyMechanical * getIBodyMechanical() const =0
Return the IBodyMechanical pointer.
virtual void setContactMoment(const DAVect &v)=0
Set the contact moment.
virtual const IBody * getIBody() const =0
Return the IBody pointer.
virtual DVect getPosition() const =0
Return the rblock position. This is implementation dependent.
virtual double getLocalDamping() const =0
Return the local damping coefficient.
virtual DExtent3 getExtent() const =0
Return the DExtent3 extent.
virtual DAVect getUnbalancedMoment() const =0
Return the unbalanced moment.
virtual DVect getVelocity() const =0
Get the velocity.
static const TType type_
TType for type casting.
Definition irblock.h:28
virtual int getNumberFacets() const =0
Return the number of facets.
virtual DVect getDisplacement() const =0
Get the displacement.
virtual int getFacetClosestToPoint(const DVect &) const =0
virtual void setCentroid(const DVect &p)=0
Set the centroid.
virtual void setAppliedMoment(const DAVect &v)=0
Set the applied moment.
virtual double getInertialMass() const =0
Return the inertial mass.
virtual bool getFix(quint32 dof) const =0
Return a boolean indicating the fixity condition.
virtual DVect getAppliedForce() const =0
Return the applied force.
virtual DAVect getInertialMoi() const =0
Return the inertial (may be scaled) inertia tensor in principal axis form.
virtual DMatrix< DIM, DIM > getStress() const =0
Return the current stress computed for this rblock.
virtual double getDensity() const =0
Return the density.
virtual void setMoiFix(bool b)=0
When setting the MOI from FISH one needs make sure that it is not reset no matter what.
virtual void setDisplacement(const DVect &v)=0
Set the displacement.
virtual int getFragmentIndex() const =0
Return the fragment index.
virtual double getBallRadius() const =0
Returns the ball radius containing the block.
virtual const IRigidBodyMechanical * getIRigidBodyMechanical() const =0
Return the IRigidBodyMechanical pointer.
virtual bool getIsIn(const DVect &) const =0
Returns a boolean indicating whether a point in space is inside or outside of the rigid block.
virtual void getGeometry(FArray< DVect > *vert, FArray< int > *fac=0) const =0
Get the list of vertices and facets. Nothing is done with the second array in 2D.
virtual void setMoi(const DAVect &d)=0
Set the principal values of the inertia tensor directly.
virtual void setFix(quint32 dof, bool b)=0
Set the fixity condition.
virtual void setVolumeNoScale(const double &d)=0
Set the volume without scaling the rblock.
virtual double getMass() const =0
Return the mass.
virtual bool rotate(const DVect &rotp, const DVect &axis, const double &w, bool update=true, bool noThrow=false)=0
virtual void setDensity(const double &d)=0
Set the density.
virtual void setMoiComp(const double &, int)=0
Set a component of the inertia tensor. Admissible values are: 11,12,13,22,23,33 in 3D.
virtual void getEdgeInfo(FArray< IVect3 > *info) const =0
Returns the 2 face indices of the edge and the edge index of the edge in the first face.
virtual void setContactForce(const DVect &v)=0
Set the contact force.
An array class that attempts to minimize unnecessary heap access.
uint32 TType
class type indicator
Definition basedef.h:46
DExtent3 DExtent
A DExtent2 in 2D, a DExtent3 in 3D.
Definition dim.h:160
DVect3 DVect
Vector of doubles, either 2D or 3D.
Definition dim.h:154
DAVect3 DAVect
Angular vector of doubles, either 2D or 3D.
Definition dim.h:162
namespace Itasca
Definition basememory.cpp:14
Itasca Library standard namespace, specific to 2D or 3D.
Definition icontactmodule.h:4