18.08.2013 Views

Vega FEM Library (v1.1) User's Manual - University of Southern ...

Vega FEM Library (v1.1) User's Manual - University of Southern ...

Vega FEM Library (v1.1) User's Manual - University of Southern ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

virtual int SetState(double * q, double * qvel=NULL)<br />

Sets the position (and optionally the velocity) buffer based on the parameters, and calculates the appropriate<br />

acceleration buffer values using implicit Euler, assuming no external forces. Returns 0 if successful, 1<br />

otherwise.<br />

virtual int DoTimestep()<br />

Runs a timestep <strong>of</strong> implicit Euler, and updates the internal position, velocity, and acceleration buffers<br />

accordingly. Returns 0 if successful, 1 otherwise.<br />

class CentralDifferencesSparse : public IntegratorBaseSparse Implements the explicit central differences<br />

integrator.<br />

CentralDifferencesSparse(int numDOFs, double timestep,<br />

SparseMatrix * massMatrix,<br />

ForceModel * forceModel,<br />

int numConstrainedDOFs=0, int * constrainedDOFs=NULL,<br />

double dampingMassCoef=0.0, double dampingStiffnessCoef=0.0,<br />

int tangentialDampingMode=1, int numSolverThreads=0)<br />

Initializes the integrator settings via the IntegratorBaseSparse constructor, and selects the number <strong>of</strong><br />

threads to use for the sparse linear solver. Tangential damping mode controls how <strong>of</strong>ten the Rayleigh damping<br />

matrix is recomputed. This damping matrix depends on the tangent stiffness matrix, which changes in time.<br />

When 0, the damping matrix is never updated. The system matrix is then constant, so one can factor it<br />

only once. However, this is not recommended for large deformations as it leads to damping artifacts. When<br />

tangentialDampingMode > 0, the damping matrix is updated every “tangentialDampingMode”th timestep.<br />

Default is 1, i.e., update at every timestep.<br />

virtual int SetState(double * q, double * qvel=NULL)<br />

Sets the position (and optionally velocity) buffers. Always returns 0.<br />

virtual int DoTimestep()<br />

Runs a timestep <strong>of</strong> explicit central differences, and updates the internal position, velocity and acceleration<br />

buffers accordingly. Returns 0 if successful, 1 otherwise.<br />

class EulerSparse : public IntegratorBaseSparse Implements explicit Euler integration, with a flag<br />

to enable symplectic Euler integration. Because this class never forms the tangent stiffness matrix, damping<br />

is controlled via mass-based damping only.<br />

EulerSparse(int r, double timestep, SparseMatrix * massMatrix,<br />

ForceModel * forceModel,<br />

int symplectic=0, int numConstrainedDOFs=0,<br />

int * constrainedDOFs=NULL, double dampingMassCoef=0.0)<br />

Initializes the integrator settings via the IntegratorBaseSparse constructor, and sets whether to perform<br />

symplectic integration.<br />

virtual int SetState(double * q, double * qvel=NULL)<br />

Sets the position (and optionally velocity) buffers based on the parameters, and sets the acceleration<br />

buffer via explicit (or symplectic) Euler assuming no external forces. Returns 0 if successful, 1 otherwise.<br />

virtual int DoTimestep()<br />

Runs a timestep <strong>of</strong> explicit (or symplectic) Euler, and updates the internal position, velocity, and acceleration<br />

buffers accordingly. Returns 0 if successful, 1 otherwise.<br />

15

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!