16 #ifndef BT_PRECONDITIONER_H
17 #define BT_PRECONDITIONER_H
34 for (
int i = 0; i <
b.size(); ++i)
51 : m_softBodies(softBodies)
60 for (
int i = 0; i < m_softBodies.
size(); ++i)
73 for (
int i = 0; i < m_inv_mass.
size(); ++i)
75 b[i] =
x[i] * m_inv_mass[i];
77 for (
int i = m_inv_mass.
size(); i <
b.size(); ++i)
91 const bool& m_implicit;
95 : m_softBodies(softBodies), m_projections(projections), m_lf(lf), m_dt(dt), m_implicit(implicit)
104 for (
int i = 0; i < m_softBodies.
size(); ++i)
109 m_inv_A.
resize(num_nodes);
112 for (
int i = 0; i < m_inv_A.
size(); ++i)
115 for (
int d = 0; d < 3; ++d)
117 m_inv_A[i][d] = (m_inv_A[i][d] == 0) ? 0.0 : 1.0 / m_inv_A[i][d];
123 for (
int i = 0; i < m_inv_S.
size(); ++i)
126 for (
int d = 0; d < 3; ++d)
128 m_inv_S[i][d] = (m_inv_S[i][d] == 0) ? 0.0 : 1.0 / m_inv_S[i][d];
136 for (
int i = 0; i < m_softBodies.
size(); ++i)
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
183 for (
int i = 0; i < m_inv_A.
size(); ++i)
185 b[i] =
x[i] * m_inv_A[i];
188 for (
int i = 0; i < m_inv_S.
size(); ++i)
199 for (
int i = 0; i < m_inv_A.
size(); ++i)
201 b[i] =
x[i] * m_inv_A[i];
204 for (
int i = 0; i < m_inv_S.
size(); ++i)
222 for (
int i = 0; i < m_inv_S.
size(); ++i)
227 for (
int i = 0; i < m_inv_A.
size(); ++i)
245 for (
int i = 0; i < m_inv_A.
size(); ++i)
247 b[i] = (
x[i] -
b[i]) * m_inv_A[i];
252 for (
int i = 0; i < m_inv_S.
size(); ++i)
256 for (
int i = 0; i < m_inv_A.
size(); ++i)
272 for (
int i = 0; i < m_inv_A.
size(); ++i)
274 b[i] +=
t[i] * m_inv_A[i];
277 for (
int i = 0; i < m_inv_S.
size(); ++i)
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
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
virtual void reinitialize(bool nodeUpdated)
void buildDiagonalS(const TVStack &inv_A, TVStack &diagS)
virtual void operator()(const TVStack &x, TVStack &b)
virtual void reinitialize(bool nodeUpdated)
MassPreconditioner(const btAlignedObjectArray< btSoftBody * > &softBodies)
virtual void operator()(const TVStack &x, TVStack &b)
virtual void reinitialize(bool nodeUpdated)=0
btAlignedObjectArray< btVector3 > TVStack
virtual ~Preconditioner()
virtual void operator()(const TVStack &x, TVStack &b)=0
SIMD_FORCE_INLINE void clear()
clear the array, deallocated memory. Generally it is better to use array.resize(0),...
SIMD_FORCE_INLINE int size() const
return the number of elements in the array
SIMD_FORCE_INLINE void resize(int newsize, const T &fillData=T())
SIMD_FORCE_INLINE void push_back(const T &_Val)
ccl_gpu_kernel_postfix ccl_global int * counter
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
static const pxr::TfToken b("b", pxr::TfToken::Immortal)