72 const agx::Real* operator[](
size_t i )
const;
87 const agx::Real& at(
size_t i,
size_t j )
const;
94 agx::Real operator()(
size_t i,
size_t j)
const;
101 agx::Real& operator()(
size_t i,
size_t j);
110 void set(
size_t i,
size_t j,
agx::Real value );
357 rb1DiagonalBlock.
reset();
358 rb2DiagonalBlock.
reset();
359 offDiagonalBlock.
reset();
367 Transformed m_transformed;
392 return (*
this)[i][j];
398 return (*
this)[i][j];
404 return (*
this)[ i ][ j ];
411 (*this)[ i ][ j ] = value;
418 return (*
this)[ i ][ j ];
433 return m_offDiagonalBlock;
438 return m_offDiagonalBlock;
443 os <<
"{" << std::endl;
444 for (
size_t row = 0; row < 6; ++row) {
446 for (
size_t col = 0; col < 6; ++col)
447 os << m(row, col) <<
" ";
450 os <<
"}" << std::endl;
#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
Matrix6x6 & operator=(const Matrix6x6 &other)
Assignment operator.
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()
Default constructor, sets all elements to 0.
void set(size_t i, size_t j, agx::Real value)
agx::Real operator()(size_t i, size_t j) const
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
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.
agx::RigidBody * getRigidBody() const
Interface to write added mass matrices for one or two rigid bodies.
AddedMassInteraction(agx::RigidBody *rb1, agx::RigidBody *rb2=nullptr)
Construct given either one or two rigid bodies.
agx::AddedMassInteraction::RigidBodyStorage * getRigidBody1Storage()
Storage of 'rb1' from construction containing the rigid body and a 6x6 matrix block.
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.
const agx::AddedMassInteraction::RigidBodyStorage * getRigidBody1Storage() const
Storage of 'rb1' from construction containing the rigid body and a 6x6 matrix block.
virtual agx::RigidBody * getRigidBody2() const override
const agx::AddedMassInteraction::RigidBodyStorage * getRigidBody2Storage() const
Storage of 'rb2' from construction containing the rigid body and a 6x6 matrix block.
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 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 agx::RigidBody * getRigidBody1() const override
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.
void translateWorldDiagonalBlock(const agx::Vec3 cmOffsetRb1, const agx::Vec3 cmOffsetRb2, agx::AddedMassInteraction::Matrix6x6 &matrix) const
virtual ~AddedMassInteraction()
Reference counted object, protected destructor.
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...
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)
std::ostream & operator<<(std::ostream &os, const agx::AddedMassInteraction::Matrix6x6 &m)
AGXPHYSICS_EXPORT agx::Bool equivalent(const agx::AddedMassInteraction::Matrix6x6 &lhs, const agx::AddedMassInteraction::Matrix6x6 &rhs, agx::Real eps=agx::RealEpsilon)