25, m_maxNewtonIterations(5)
26, m_newtonTolerance(1e-4)
88 f2 = f0 - alpha * scale * inner_product;
159 if (inner_product < -tol)
163 std::cout <<
"Looking backwards!" << std::endl;
169 inner_product = -inner_product;
171 else if (std::abs(inner_product) < tol)
175 std::cout <<
"Gradient Descent!" << std::endl;
180 m_ddv[i] = scale * residual[i];
182 inner_product = scale * res_norm * res_norm;
184 return inner_product;
241 return maxSquaredResidual;
272 m_dv[counter].setZero();
static const int kMaxConjugateGradientIterations
const T & btMax(const T &a, const T &b)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
#define ATTRIBUTE_ALIGNED16(a)
int size() const
return the number of elements in the array
void copyFromArray(const btAlignedObjectArray &otherArray)
void resize(int newsize, const T &fillData=T())
btCollisionObject can be used to manage collision detection objects.
const btCollisionShape * getCollisionShape() const
virtual btScalar getMargin() const =0
btScalar dot(const TVStack &a, const TVStack &b)
int solve(MatrixX &A, TVStack &x, const TVStack &b, bool verbose=false)
virtual void updateSoftBodies()
Perform necessary per-step updates of soft bodies such as recomputing normals and bounding boxes.
virtual void solveDeformableConstraints(btScalar solverdt)
void updateEnergy(btScalar scale)
virtual ~btDeformableBodySolver()
btDeformableBackwardEulerObjective * m_objective
btAlignedObjectArray< btSoftBody * > m_softBodies
void splitImpulseSetup(const btContactSolverInfo &infoGlobal)
int m_maxNewtonIterations
btScalar computeDescentStep(TVStack &ddv, const TVStack &residual, bool verbose=false)
void predictDeformableMotion(btSoftBody *psb, btScalar dt)
btConjugateGradient< btDeformableBackwardEulerObjective > m_cg
btScalar solveContactConstraints(btCollisionObject **deformableBodies, int numDeformableBodies)
void reinitialize(const btAlignedObjectArray< btSoftBody * > &softBodies, btScalar dt)
void setupDeformableSolve(bool implicit)
void setLineSearch(bool lineSearch)
btScalar m_newtonTolerance
virtual void predictMotion(btScalar solverdt)
Predict motion of soft bodies into next timestep.
void setImplicit(bool implicit)
void computeStep(TVStack &ddv, const TVStack &residual)
void updateTempPosition()
btScalar solveSplitImpulse(const btContactSolverInfo &infoGlobal)
void updateDv(btScalar scale=1)
The btSoftBody is an class to simulate cloth and volumetric soft bodies.
btAlignedObjectArray< DeformableFaceNodeContact > m_faceNodeContacts
btScalar m_maxSpeedSquared
btAlignedObjectArray< DeformableFaceRigidContact > m_faceRigidContacts
btAlignedObjectArray< DeformableNodeRigidContact > m_nodeRigidContacts
void initializeFaceTree()
btVector3 can be used to represent 3D points and vectors.
btVector3 & safeNormalize()
btScalar norm() const
Return the norm (length) of the vector.
static btDbvtAabbMm FromPoints(const btVector3 *pts, int n)
void optimizeIncremental(int passes)
void update(btDbvtNode *leaf, int lookahead=-1)
@ SDF_RD
Cluster vs convex rigid vs soft.