AGX Dynamics 2.42.3.1
Loading...
Searching...
No Matches
agxModel::BeamModel Class Referenceabstract

Beam model interface requiring moment of inertia (area moment in x, y and polar moment in z), the cross section area, 2D (x and y) extents and geometry for the segments. More...

#include <BeamModel.h>

+ Inheritance diagram for agxModel::BeamModel:

Public Member Functions

virtual agx::Vec3 calculateMomentOfInertia () const =0
 Default moment of inertia of the beam model.
 
BeamStiffnessDamping calculateStiffnessDamping (agx::UInt numBeamSegments, agx::Real beamSegmentLength) const
 Calculates stiffness dependent on moment of inertia, cross section area, beam segment length and number of segments in the beam.
 
virtual agx::Real getCrossSectionArea () const =0
 The cross section area of the beam model affecting the stretch stiffness.
 
virtual agx::Vec2 getMaxHeightWidth () const =0
 The 2D extents along x (up/down) and y (right/left).
 
virtual agx::Vec3 getMomentOfInertia () const final
 Moment of inertia of the beam model, where: About x (up): Lateral About y (right): Vertical About z (forward): Torsional This is the moment of inertia used to calculate the stiffness in the constraints of the beam, and is scaled with the current moment of inertia scale (default scale: (1, 1, 1)).
 
agx::Vec3 getMomentOfInertiaScale () const
 
agx::Real getPolarMomentOfInertiaScale () const
 
BeamModelProperties * getProperties () const
 
virtual agxCollide::GeometryRef getSegmentGeometry (agx::Real segmentLength) const =0
 Generates a geometry to be cloned to each beam segment.
 
bool loadLibraryProperties (const agx::String &name)
 Load named BeamModelProperties from the Material Library for the current Beam.
 
void setMomentOfInertiaScale (agx::Vec3 momentOfInertiaScale)
 Scale of the calculated moment of inertia of this model, default scale (1, 1, 1).
 
void setPolarMomentOfInertiaScale (agx::Real polarMomentOfInertiaScale)
 Assign new polar moment of inertia scale.
 
void setProperties (BeamModelProperties *properties)
 Assign properties instance, a new default will be created if properties is nullptr.
 
virtual agx::String validate () const =0
 Validate inputs, verify all given sizes are > 0, e.g., hollow cylinder thickness < radius, or I-beam web thickness < width.
 
- Public Member Functions inherited from agx::Referenced
 Referenced ()
 Default constructor.
 
 Referenced (const Referenced &)
 
template<typename T >
T * as ()
 Subclass casting.
 
template<typename T >
const T * as () const
 
template<typename T >
T * asSafe ()
 Safe subclass casting, return nullptr if template type does not match.
 
template<typename T >
const T * asSafe () const
 
int getReferenceCount () const
 
template<typename T >
bool is () const
 Subclass test.
 
Referenced & operator= (const Referenced &)
 Assignment operator. Will increment the number of references to the referenced object.
 
void reference (void *ptr=nullptr) const
 Explicitly increment the reference count by one, indicating that this object has another pointer which is referencing it.
 
void unreference (void *ptr=nullptr) const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
void unreference_nodelete () const
 Decrement the reference count by one, indicating that a pointer to this object is referencing it.
 
- Public Member Functions inherited from agxStream::Serializable
virtual ~Serializable ()
 Destructor for normal C++ use but hidden from SWIG bindings.
 
virtual const char * getClassName () const
 
bool getEnableSerialization () const
 
bool getEnableUuidGeneration ()
 
agx::UInt32 getIndex () const
 This index is given at creation of this object.
 
virtual StorageAgent * getStorageAgent () const =0
 
agx::Uuid getUuid () const
 
bool isFinished () const
 
void setEnableSerialization (bool flag)
 Set to false to disable serialization of this object.
 
void setFinished ()
 Tells this class that it is restored correctly and should not be deleted during destruction of an Archive.
 
void setUuid (const agx::Uuid &uuid)
 Explicitly set a Uuid on a serializable object.
 

Static Public Member Functions

static agx::StringVector getAvailableLibraryProperties ()
 Returns a vector with all the named BeamModelProperties that were found in the Material Library.
 
- Static Public Member Functions inherited from agx::Referenced
template<typename T >
static bool ValidateCast (const Referenced *object)
 
- Static Public Member Functions inherited from agxStream::Serializable
static void setEnableUuidGeneration (bool flag)
 Specify if there should be UUID:s generated for each new Serializable object. By default it is enabled.
 

Additional Inherited Members

- Protected Member Functions inherited from agx::Referenced
virtual ~Referenced ()
 Destructor.
 
void allocateObserverVector () const
 
void deleteUsingDeleteHandler () const
 
- Protected Member Functions inherited from agxStream::Serializable
 Serializable ()
 Default constructor.
 
 Serializable (const Serializable &other)
 Copy constructor.
 
void generateUuid ()
 
- Static Protected Member Functions inherited from agx::Referenced
static DeleteHandler * getDeleteHandler ()
 
static void setDeleteHandler (DeleteHandler *handler)
 Internal: Set a DeleteHandler to which deletion of all referenced counted objects will be delegated to.
 
- Protected Attributes inherited from agx::Referenced
Mutex m_mutex
 
ObserverContainer m_observers
 
AtomicValue m_refCount
 

Detailed Description

Beam model interface requiring moment of inertia (area moment in x, y and polar moment in z), the cross section area, 2D (x and y) extents and geometry for the segments.

The geometry is cloned to each created beam segment, i.e., called once when the beam is initialized.

The moment of inertia is area moment (x, y) and polar moment (z) is defined about the local frame of the beam segments. Beam segments has x up, y right and z forward/along the beam:

x
|  z
| /
|/____ y

I.e., lateral moment is x, vertical moment is y and polar moment is z. Note that resources normally has x right and y up.

The geometry must be centered in the local frame with extents segmentLength/2 forward and back. The height is along x, width along y and length along z. E.g., a rectangular model with given width and height should be created as:

agxCollide::GeometryRef geometry = new agxCollide::Geometry( new agxCollide::Box( 0.5 * height,
                                                                                  0.5 * width,
                                                                                  0.5 * segmentLength ) );

with moment of inertia:

(x: height * width^3 / 12,
 y: width * height^3 / 12,
 z: width * height * (width^2 + height^2) / 12)

Definition at line 64 of file BeamModel.h.

Member Function Documentation

◆ calculateMomentOfInertia()

virtual agx::Vec3 agxModel::BeamModel::calculateMomentOfInertia ( ) const
pure virtual

Default moment of inertia of the beam model.

This moment of inertia isn't scaled and is unique to the implementation. This method is normally only used by getMomentOfInertia. About x (up): Lateral About y (right): Vertical About z (forward): Torsional

Returns
the unscaled moment of inertia of the beam model

◆ calculateStiffnessDamping()

BeamStiffnessDamping agxModel::BeamModel::calculateStiffnessDamping ( agx::UInt  numBeamSegments,
agx::Real  beamSegmentLength 
) const

Calculates stiffness dependent on moment of inertia, cross section area, beam segment length and number of segments in the beam.

Note
The arguments aren't validated, what you give is what you get, i.e., assert that numBeamSegments > 0 and beamSegmentLength > 0.0.
Parameters
numBeamSegments- total number of beam segments in the beam this model belongs to
beamSegmentLength- length of a beam segment, i.e., total length of the beam is beamSegmentLength * numBeamSegments
Returns
the calculated translational and rotational stiffness and damping times

◆ getAvailableLibraryProperties()

static agx::StringVector agxModel::BeamModel::getAvailableLibraryProperties ( )
static

Returns a vector with all the named BeamModelProperties that were found in the Material Library.

Returns
A vector with the names of all BeamModelProperties found in the MaterialLibrary

◆ getCrossSectionArea()

virtual agx::Real agxModel::BeamModel::getCrossSectionArea ( ) const
pure virtual

The cross section area of the beam model affecting the stretch stiffness.

Returns
the cross section area of the beam model

◆ getMaxHeightWidth()

virtual agx::Vec2 agxModel::BeamModel::getMaxHeightWidth ( ) const
pure virtual

The 2D extents along x (up/down) and y (right/left).

Returns
the 2D extents of the beam model

◆ getMomentOfInertia()

virtual agx::Vec3 agxModel::BeamModel::getMomentOfInertia ( ) const
finalvirtual

Moment of inertia of the beam model, where: About x (up): Lateral About y (right): Vertical About z (forward): Torsional This is the moment of inertia used to calculate the stiffness in the constraints of the beam, and is scaled with the current moment of inertia scale (default scale: (1, 1, 1)).

Returns
the scaled moment of inertia (x and y) and polar (z) of the beam model

◆ getMomentOfInertiaScale()

agx::Vec3 agxModel::BeamModel::getMomentOfInertiaScale ( ) const
Returns
the currently used moment of inertia scale (default scale: (1, 1, 1))

◆ getPolarMomentOfInertiaScale()

agx::Real agxModel::BeamModel::getPolarMomentOfInertiaScale ( ) const
Returns
the current polar moment of inertia

◆ getProperties()

BeamModelProperties * agxModel::BeamModel::getProperties ( ) const
Returns
properties of the model

◆ getSegmentGeometry()

virtual agxCollide::GeometryRef agxModel::BeamModel::getSegmentGeometry ( agx::Real  segmentLength) const
pure virtual

Generates a geometry to be cloned to each beam segment.

This geometry must be centered in the local segment frame with x up, y right and z forward. The geometry is cloned for each segment and translated 0.5 * segmentLength forward.

Parameters
segmentLength- the total length of the segment, depending on the total length and resolution of the beam which are unknown to the beam model.
Returns
geometry instance to be cloned to each beam segment

◆ loadLibraryProperties()

bool agxModel::BeamModel::loadLibraryProperties ( const agx::String &  name)

Load named BeamModelProperties from the Material Library for the current Beam.

Returns
true if properties could be read successfully.

◆ setMomentOfInertiaScale()

void agxModel::BeamModel::setMomentOfInertiaScale ( agx::Vec3  momentOfInertiaScale)

Scale of the calculated moment of inertia of this model, default scale (1, 1, 1).

The moment of inertia, specifically the polar moment, is not accurate and not possible to calculate analytically for beam models that hasn't a circular cross section. This scale enables modifications of the moment of inertia for specific dimensions of this beam model. E.g., alternate the scale until the resulting twist angle, under given constant torque, matches the angle given in some resource for an identical beam model.

x: About up/down, lateral. y: About right/left, horizontal. z: About forward/backward, torsional/polar.

Parameters
momentOfInertiaScale- scale of this model specific moment of inertia (default scale: (1, 1, 1))

◆ setPolarMomentOfInertiaScale()

void agxModel::BeamModel::setPolarMomentOfInertiaScale ( agx::Real  polarMomentOfInertiaScale)

Assign new polar moment of inertia scale.

See also
setMomentOfInertiaScale
Parameters
polarMomentOfInertiaScale- new polar moment of inertia (default: 1)

◆ setProperties()

void agxModel::BeamModel::setProperties ( BeamModelProperties *  properties)

Assign properties instance, a new default will be created if properties is nullptr.

The properties instance may be shared between an arbitrary number of beam models.

Parameters
properties- new beam properties instance

◆ validate()

virtual agx::String agxModel::BeamModel::validate ( ) const
pure virtual

Validate inputs, verify all given sizes are > 0, e.g., hollow cylinder thickness < radius, or I-beam web thickness < width.

Return the error, if any, or an empty string if the beam can be initialized given this model.

Returns
empty string if valid, otherwise error

The documentation for this class was generated from the following file: