Itasca C++ Interface
Loading...
Searching...
No Matches
iclump.h
Go to the documentation of this file.
1#pragma once
7#include "base/src/farray.h"
8
9namespace itasca {
10 class IThing;
11 class IGroup;
12 class IContainer;
13}
14namespace itascaxd {
15 class IPiece;
16 class IPieceMechanical;
17 class IContact;
18 class IBody;
19 class IBodyMechanical;
20 class IRigidBodyMechanical;
21}
22
23namespace pfc {
24 using namespace itasca;
25 using namespace itascaxd;
26 class IPebble;
27 class ITriPoly;
28 class IClumpTemplate;
29
37 class IClump {
38 public:
40 inline static const TType type_ = 0x4e665ed6;
41
43 virtual IThing * getIThing() = 0;
45 virtual const IThing * getIThing() const = 0;
47 virtual IClump * getNext() = 0;
49 virtual const IClump * getNext() const = 0;
51 virtual IPiece * getFirstIPiece() = 0;
53 virtual const IPiece * getFirstIPiece() const = 0;
55 virtual IPebble * getFirstPebble() = 0;
57 virtual const IPebble * getFirstPebble() const = 0;
61 virtual const IPieceMechanical * getFirstIPieceMechanical() const = 0;
63 virtual IBody * getIBody() = 0;
65 virtual const IBody * getIBody() const = 0;
69 virtual const IBodyMechanical * getIBodyMechanical() const = 0;
74
76 virtual uint32 getNumberPebbles() const=0;
80 virtual void getPebbleList(FArray<const IPebble *> *) const=0;
82 virtual double getSurfaceScaleFactor() const = 0;
85 virtual double getMoiComp(int) const = 0;
88 virtual double getInertialMoiComp(int) const = 0;
89#ifdef THREED
91 virtual SymTensor getInertialMoiTensor() const = 0;
92 virtual SymTensor getMoiTensor() const = 0;
93#endif
95 virtual DAVect getMoi() const=0;
97 virtual DAVect getInertialMoi() const=0;
98
100 virtual void setMoiComp(const double &,int) = 0;
102 virtual void setMoi(const DAVect &)=0;
103
106 virtual bool rotate(const DVect &rotp,const DVect &axis,const double &w,bool update=true,bool noThrow = false) = 0;
108 virtual bool scale(const double &)=0;
109
111 virtual void getContactList(FArray<IContact *> *ret,const TType &type=0,const IPiece *p2=0)=0;
113 virtual void getContactList(FArray<const IContact *> *ret,const TType &type=0,const IPiece *p2=0) const=0;
115 virtual uint64 getContactCount(bool active,const TType &type=0,bool domainToo = false) const=0;
116
120 virtual const IContainer *getClumpAsPebbleContainer() const=0;
121
123 virtual const ITriPoly * getSurfaceDescription() const=0;
124
125#ifdef THREED
127 virtual const Quat & getSurfaceOrientation() const=0;
128 virtual DVect getSurfaceEuler() const=0;
129#else
131 virtual double getSurfaceOrientation() const=0;
132#endif
133
135 virtual void getSurfaceRotMatrix(DMatrix<dim,dim> *) const=0;
136
138 virtual void removeIPebble(IPebble *,IContainer *)=0;
140 virtual IPebble *createAndAddPebble(const double &rad,const DVect &pos,IContainer *,uint64 id=0)=0;
141
145 virtual const IClumpTemplate * getMyClumpTemplate() const =0;
147 virtual void resetClumpTemplate()=0;
149 virtual bool getIsClumpTemplate() const=0;
150
153 virtual void calcAndSetInertialAttributes(const double &per=0.01)=0;
154
156 virtual void setMoiFix(bool b)=0;
157 virtual bool isMoiFix()=0;
158 virtual bool isMoiFix() const=0;
159
161 virtual void setVolumeNoScale(const double &d)=0;
162
164 virtual double getEnclosingDiameter() const=0;
165
166 virtual int getFragmentIndex() const=0;
167
168
171 virtual bool getFix(uint32 dof) const=0;
173 virtual QString getFixLabel() const=0;
175 virtual QVariant getPieceProperty(const QString &name,const IPiece *p=0) const=0;
177 virtual double getDensity() const=0;
179 virtual double getInertialMass() const=0;
181 virtual double getMass() const=0;
183 virtual DVect getContactForce() const=0;
185 virtual DAVect getContactMoment() const=0;
187 virtual DVect getAppliedForce() const=0;
189 virtual DAVect getAppliedMoment() const=0;
191 virtual DVect getUnbalancedForce() const=0;
193 virtual DAVect getUnbalancedMoment() const=0;
195 virtual double getLocalDamping() const=0;
197 virtual void setFix(uint32 dof,bool b)=0;
199 virtual bool setPieceProperty(const QString &name,const QVariant &v,IPiece *p=0) =0;
201 virtual void setDensity(const double &d)=0;
203 virtual void setContactForce(const DVect &v)=0;
205 virtual void setContactMoment(const DAVect &v)=0;
207 virtual void setAppliedForce(const DVect &v)=0;
209 virtual void setAppliedMoment(const DAVect &v)=0;
211 virtual void setLocalDamping(const double &d)=0;
213 virtual void scaleVolumePreserveMass(const double &d,bool checkState=true,bool lock=false)=0;
214 virtual void setFragmentIndex(int ind)=0;
216 virtual bool getIsIn(const DVect &) const = 0;
217
218
220#ifdef TWOD
221 virtual double getAngDisplacement() const=0;
222#endif
223 virtual DVect getCentroid() const=0;
224 virtual DVect getVelocity() const=0;
225 virtual DAVect getAngVelocity() const=0;
226 virtual DVect getDisplacement() const=0;
227 virtual double getVolume() const=0;
228 virtual Quat getOrient() const=0;
229
230#ifdef TWOD
231 virtual void setAngDisplacement(const double &v)=0;
232#endif
233 virtual void setCentroid(const DVect &p)=0;
234 virtual void setVelocity(const DVect &p)=0;
235 virtual void setAngVelocity(const DAVect &p)=0;
236 virtual void setDisplacement(const DVect &v)=0;
237 virtual void setOrient(const Quat &q)=0;
238#ifdef THREED
239 virtual DVect getEulerFromOrient() const=0;
240 virtual void setOrientFromEuler(const DVect3 &d)=0;
241#endif
242
243
244 };
245} // namespace pfc
246// EoF
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
3D quaternion utility class.
Definition quat.h:108
A symmetric 2nd order tensor.
Definition symtensor.h:22
Interface for containers of IThings.
Definition icontainer.h:21
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 ipiecemechanical.h:11
Definition irigidbodymechanical.h:7
Interface for a clump. This is the interface for a clump. A clump is a collection of pebbles that def...
Definition iclump.h:37
virtual uint32 getNumberPebbles() const =0
Return the number of pebbles.
virtual bool getIsClumpTemplate() const =0
Return true if part of a clump template.
virtual DAVect getAppliedMoment() const =0
Return the applied moment.
virtual void calcAndSetInertialAttributes(const double &per=0.01)=0
virtual DVect getUnbalancedForce() const =0
Return the unbalanced force.
virtual IPieceMechanical * getFirstIPieceMechanical()=0
Return the first IPieceMechanical in this clump.
virtual const IBody * getIBody() const =0
Return a const IBody pointer.
virtual const IThing * getIThing() const =0
Return a const IThing interface for this object.
virtual bool getFix(uint32 dof) const =0
virtual void getContactList(FArray< const IContact * > *ret, const TType &type=0, const IPiece *p2=0) const =0
Return a list of const IContacts.
virtual void getSurfaceRotMatrix(DMatrix< dim, dim > *) const =0
Get the rotation matrix with reference to the clump template.
static const TType type_
TType for type casting.
Definition iclump.h:40
virtual void setDensity(const double &d)=0
Set the density.
virtual double getInertialMass() const =0
Return the inertial mass.
virtual IPebble * getFirstPebble()=0
Return the first IPebble in this clump.
virtual IClump * getNext()=0
Return the next IClump object in the global list, or 0 if it is the last set.
virtual DAVect getMoi() const =0
Return the inertia tensor in principal axis form.
virtual IThing * getIThing()=0
Return an IThing interface for this object.
virtual double getMass() const =0
Return the mass.
virtual void setVolumeNoScale(const double &d)=0
Set the volume without scaling the clump.
virtual void getPebbleList(FArray< const IPebble * > *) const =0
Return a list of pebbles.
virtual IContainer * getClumpAsPebbleContainer()=0
Return the IContainer pointer of the ChildContainer corresponding to this clump.
virtual void removeIPebble(IPebble *, IContainer *)=0
Remove the pebble from the clump.
virtual const IClump * getNext() const =0
Return the next const IClump object in the global list, or 0 if it is the last set.
virtual QVariant getPieceProperty(const QString &name, const IPiece *p=0) const =0
Return the property of the piece.
virtual IPebble * createAndAddPebble(const double &rad, const DVect &pos, IContainer *, uint64 id=0)=0
Add a pebble to this clump.
virtual double getDensity() const =0
Return 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 IBody * getIBody()=0
Return an IBody pointer.
virtual DVect getAppliedForce() const =0
Return the applied force.
virtual bool getIsIn(const DVect &) const =0
Returns a boolean indicating whether a point in space is inside or outside of the ball.
virtual double getLocalDamping() const =0
Return the local damping coefficient.
virtual const IPiece * getFirstIPiece() const =0
Return the first const IPiece in this clump.
virtual const IClumpTemplate * getMyClumpTemplate() const =0
Return the const IClumpTemplate pointer.
virtual DVect getCentroid() const =0
IRigidBodyMechanical interface.
virtual DVect getContactForce() const =0
Return the resultant of all contact forces.
virtual double getMoiComp(int) const =0
virtual double getSurfaceScaleFactor() const =0
Return the scale factor going from the clump to the surface representation.
virtual void setContactForce(const DVect &v)=0
Set the contact force.
virtual uint64 getContactCount(bool active, const TType &type=0, bool domainToo=false) const =0
Return the number of contacts.
virtual IClumpTemplate * getMyClumpTemplate()=0
Return the IClumpTemplate pointer.
virtual void scaleVolumePreserveMass(const double &d, bool checkState=true, bool lock=false)=0
Scale the volume to the specified value while preserving the mass.
virtual void getPebbleList(FArray< IPebble * > *)=0
Return a list of pebbles.
virtual void setAppliedMoment(const DAVect &v)=0
Set the applied moment.
virtual double getEnclosingDiameter() const =0
Calculate the diameter of the sphere enclosing the clump.
virtual const IBodyMechanical * getIBodyMechanical() const =0
Return a const IBodyMechanical pointer.
virtual void setAppliedForce(const DVect &v)=0
Set the applied force.
virtual void resetClumpTemplate()=0
Reset the clump template pointer.
virtual void setFix(uint32 dof, bool b)=0
Set the fixity condition.
virtual void setMoi(const DAVect &)=0
Set the principal values of the inertia tensor directly.
virtual bool scale(const double &)=0
Scale the clump to have this area or volume.
virtual bool setPieceProperty(const QString &name, const QVariant &v, IPiece *p=0)=0
Set the property name.
virtual void setLocalDamping(const double &d)=0
Set the local damping coefficient.
virtual DAVect getUnbalancedMoment() const =0
Return the unbalanced moment.
virtual const IContainer * getClumpAsPebbleContainer() const =0
Return the const IContainer pointer of the ChildContainer corresponding to this clump.
virtual const IPebble * getFirstPebble() const =0
Return the first const IPebble in this clump.
virtual IRigidBodyMechanical * getIRigidBodyMechanical()=0
Return an IRigidBodyMechanical pointer.
virtual const ITriPoly * getSurfaceDescription() const =0
Return the ITriPoly surface description of the clump.
virtual double getInertialMoiComp(int) const =0
virtual void setContactMoment(const DAVect &v)=0
Set the contact moment.
virtual IPiece * getFirstIPiece()=0
Return the first IPiece in this clump.
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 DAVect getContactMoment() const =0
Return the resultant of all contact moments.
virtual double getSurfaceOrientation() const =0
Get the double corresponding to the orientation relative to the clump template orientation.
virtual QString getFixLabel() const =0
Return a fixity label.
virtual bool rotate(const DVect &rotp, const DVect &axis, const double &w, bool update=true, bool noThrow=false)=0
virtual const IRigidBodyMechanical * getIRigidBodyMechanical() const =0
Return a const IRigidBodyMechanical pointer.
virtual IBodyMechanical * getIBodyMechanical()=0
Return an IBodyMechanical pointer.
virtual DAVect getInertialMoi() const =0
Return the inertial (may be scaled) inertia tensor in principal axis form.
virtual const IPieceMechanical * getFirstIPieceMechanical() const =0
Return the first const IPieceMechanical in this clump.
virtual void getContactList(FArray< IContact * > *ret, const TType &type=0, const IPiece *p2=0)=0
Return a list of IContacts.
Interface for a clump template. This is the interface for a clump template. A clump template is compo...
Definition iclumptemplate.h:25
Definition ipebble.h:25
Interface for a TriPoly.
Definition itripoly.h:39
An array class that attempts to minimize unnecessary heap access.
uint32 TType
class type indicator
Definition basedef.h:46
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:10
Itasca Library standard namespace, specific to 2D or 3D.
Definition icontactmodule.h:4
PFC namespace.
Definition iballfluid.h:15