72 const agx::Real* operator[](
size_t i )
const;
87 const agx::Real& at(
size_t i,
size_t j )
const;
95 void set(
size_t i,
size_t j,
agx::Real value );
339 rb1DiagonalBlock.
reset();
340 rb2DiagonalBlock.
reset();
341 offDiagonalBlock.
reset();
349 Transformed m_transformed;
370 return (*
this)[ i ][ j ];
377 (*this)[ i ][ j ] = value;
384 return (*
this)[ i ][ j ];
399 return m_offDiagonalBlock;
404 return m_offDiagonalBlock;
#define AGX_DECLARE_POINTER_TYPES(type)
#define AGXSTREAM_DECLARE_SERIALIZABLE(T)
Use this in a Serializable class to add the required methods Important: Use full namespace in the dec...
#define AGXPHYSICS_EXPORT
Class for writing serialized data in binary format to a stream.
6x6 matrix class with blockwise interface to get or set 3x3 matrices: [ M(0, 0) M(0,...
void block(size_t i, size_t j, const agx::Matrix3x3 &matrix)
const agx::Real * operator[](size_t i) const
agx::Matrix3x3 block(size_t i, size_t j) const
Matrix6x6(const Matrix6x6 &other)
Copy constructor.
void restore(agxStream::InputArchive &in)
Internal.
Matrix6x6 transform(const agx::Matrix3x3 &left, const agx::Matrix3x3 &right) const
Returns a transformed version of this matrix: [ left M(0, 0) right left M(0, 1) right ] [ left M(1,...
void store(agxStream::OutputArchive &out) const
Internal.
void reset()
Resets all values to zero.
const agx::Real & at(size_t i, size_t j) const
void multiply(const agx::Vec3 v1, const agx::Vec3 v2, agx::Real *result) const
Performs result += M * [v1] [v2].
Matrix6x6 & operator=(const Matrix6x6 &other)
Assignment operator.
Matrix6x6()
Default constructor, sets all elements to 0.
void set(size_t i, size_t j, agx::Real value)
Matrix6x6 transposed() const
Class containing a rigid body and the 6x6 matrix to be written in the diagonal of the system matrix.
void store(agxStream::OutputArchive &out) const
Internal.
agx::Bool getValid() const
agx::RigidBody * getRigidBody() const
const agx::AddedMassInteraction::Matrix6x6 & getBlock() const
agx::Physics::RigidBodyPtr getRigidBodyEntity() const
RigidBodyStorage(agx::RigidBody *rb)
Construct given rigid body.
void restore(agxStream::InputArchive &in)
Internal.
Interface to write added mass matrices for one or two rigid bodies.
const agx::AddedMassInteraction::RigidBodyStorage * getRigidBody1Storage() const
Storage of 'rb1' from construction containing the rigid body and a 6x6 matrix block.
AddedMassInteraction(agx::RigidBody *rb1, agx::RigidBody *rb2=nullptr)
Construct given either one or two rigid bodies.
void translateWorldDiagonalBlock(const agx::Vec3 cmOffset, agx::AddedMassInteraction::Matrix6x6 &matrix) const
Transform the mass matrix according to a translate of center of mass.
AddedMassInteraction()
Default constructor used by serialization.
agx::AddedMassInteraction::RigidBodyStorage * getRigidBody2Storage()
Storage of 'rb2' from construction containing the rigid body and a 6x6 matrix block.
const agx::AddedMassInteraction::Matrix6x6 & getOffDiagonalBlock() const
Off diagonal block (6x6 matrix).
virtual agx::RigidBody * getRigidBody1() const override
virtual agx::RigidBody * getRigidBody2() const override
virtual void writeMatrixData(agx::StrongInteraction::MatrixData rb1DiagonalBlock, agx::StrongInteraction::MatrixData rb2DiagonalBlock, agx::StrongInteraction::MatrixData offDiagonalBlock) override
Call from the direct solver with pointers where to write diagonal block(s) and the off diagonal block...
virtual void prepare() override
Checks if this interaction is valid for the solver.
virtual void writeRhs(agx::Physics::RigidBodyPtr rb1, agx::Real *rb1Rhs, agx::Physics::RigidBodyPtr rb2, agx::Real *rb2Rhs, agx::Bool isRestingSolve) override
Right hand side update.
agx::AddedMassInteraction::RigidBodyStorage * getRigidBody1Storage()
Storage of 'rb1' from construction containing the rigid body and a 6x6 matrix block.
void translateWorldDiagonalBlock(const agx::Vec3 cmOffsetRb1, const agx::Vec3 cmOffsetRb2, agx::AddedMassInteraction::Matrix6x6 &matrix) const
virtual ~AddedMassInteraction()
Reference counted object, protected destructor.
const agx::AddedMassInteraction::RigidBodyStorage * getRigidBody2Storage() const
Storage of 'rb2' from construction containing the rigid body and a 6x6 matrix block.
Pointer to a entity instance of type Physics.RigidBody.
The rigid body class, combining a geometric model and a frame of reference.
Base class for a strong interaction concept where there interaction is defined in the mass matrix par...
InputRef< T > in(const char *name, T &obj)
Create an object with a name and a reference to the object that should be restored (usually a pointer...
OutputRef< Serializable > out(const char *name, const Serializable *obj)
Return an object that contain the name and the object that should be serialized to an archive.
The agx namespace contains the dynamics/math part of the AGX Dynamics API.
AGXCORE_EXPORT const Real RealEpsilon
AGXPHYSICS_EXPORT agx::Bool equalsZero(const agx::AddedMassInteraction::Matrix6x6 &matrix, agx::Real eps=agx::RealEpsilon)
AGXPHYSICS_EXPORT agx::Bool equivalent(const agx::AddedMassInteraction::Matrix6x6 &lhs, const agx::AddedMassInteraction::Matrix6x6 &rhs, agx::Real eps=agx::RealEpsilon)