16#ifndef BT_PRECONDITIONER_H
17#define BT_PRECONDITIONER_H
34 for (
int i = 0; i < b.
size(); ++i)
115 for (
int d = 0; d < 3; ++d)
126 for (
int d = 0; d < 3; ++d)
148 printf(
"implicit not implemented\n");
151 for (
int i = 0; i <
m_lf.
size(); ++i)
154 m_lf[i]->buildDampingForceDifferentialDiagonal(-
m_dt, diagA);
170 for (
int d = 0; d < 3; ++d)
179#ifndef USE_FULL_PRECONDITIONER
190 b[i + offset] = x[i + offset] *
m_inv_S[i];
206 b[i + offset].setZero();
224 b[i + offset] = b[i + offset] *
m_inv_S[i];
247 b[i] = (x[i] - b[i]) *
m_inv_A[i];
254 t[i + offset] = x[i + offset] *
m_inv_S[i];
279 b[i + offset] -= x[i + offset] *
m_inv_S[i];
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
virtual void operator()(const TVStack &x, TVStack &b)
virtual void reinitialize(bool nodeUpdated)
virtual ~DefaultPreconditioner()
KKTPreconditioner(const btAlignedObjectArray< btSoftBody * > &softBodies, const btDeformableContactProjection &projections, const btAlignedObjectArray< btDeformableLagrangianForce * > &lf, const btScalar &dt, const bool &implicit)
void buildDiagonalA(TVStack &diagA) const
const btAlignedObjectArray< btSoftBody * > & m_softBodies
const btDeformableContactProjection & m_projections
virtual void reinitialize(bool nodeUpdated)
void buildDiagonalS(const TVStack &inv_A, TVStack &diagS)
const btAlignedObjectArray< btDeformableLagrangianForce * > & m_lf
virtual void operator()(const TVStack &x, TVStack &b)
const btAlignedObjectArray< btSoftBody * > & m_softBodies
virtual void reinitialize(bool nodeUpdated)
MassPreconditioner(const btAlignedObjectArray< btSoftBody * > &softBodies)
virtual void operator()(const TVStack &x, TVStack &b)
btAlignedObjectArray< btScalar > m_inv_mass
virtual void reinitialize(bool nodeUpdated)=0
btAlignedObjectArray< btVector3 > TVStack
virtual ~Preconditioner()
virtual void operator()(const TVStack &x, TVStack &b)=0
int size() const
return the number of elements in the array
void resize(int newsize, const T &fillData=T())
void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0),...
void push_back(const T &_Val)
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
btVector3 can be used to represent 3D points and vectors.