add profiling and code clean up

This commit is contained in:
Xuchen Han
2019-08-05 16:49:04 -07:00
parent 02d3a9469f
commit 73f5eb6a8f
8 changed files with 27 additions and 20 deletions

View File

@@ -13,7 +13,6 @@
#ifndef BT_BACKWARD_EULER_OBJECTIVE_H
#define BT_BACKWARD_EULER_OBJECTIVE_H
#include <functional>
#include "btConjugateGradient.h"
#include "btDeformableLagrangianForce.h"
#include "btDeformableMassSpringForce.h"
@@ -21,6 +20,7 @@
#include "btDeformableContactProjection.h"
#include "btPreconditioner.h"
#include "btDeformableRigidDynamicsWorld.h"
#include "LinearMath/btQuickprof.h"
class btDeformableRigidDynamicsWorld;
class btDeformableBackwardEulerObjective
@@ -36,7 +36,6 @@ public:
btDeformableContactProjection projection;
const TVStack& m_backupVelocity;
btAlignedObjectArray<btSoftBody::Node* > m_nodes;
btDeformableBackwardEulerObjective(btAlignedObjectArray<btSoftBody *>& softBodies, const TVStack& backup_v);
virtual ~btDeformableBackwardEulerObjective() {}
@@ -72,6 +71,7 @@ public:
// enforce constraints in CG solve
void enforceConstraint(TVStack& x)
{
BT_PROFILE("enforceConstraint");
projection.enforceConstraint(x);
updateVelocity(x);
}
@@ -85,6 +85,7 @@ public:
// update the projections and project the residual
void project(TVStack& r)
{
BT_PROFILE("project");
projection.update();
projection.project(r);
}