artisynth.core.mechmodels
Interface ForceEffector

All Known Subinterfaces:
DynamicMechComponent, ForceComponent, MotionTargetComponent
All Known Implementing Classes:
AxialSpring, BeamBody, DeformableBody, DynamicMechComponentBase, Elaston, FemMarker, FemModel, FemModel3d, FemMuscleModel, FemNode, FemNode3d, Frame, FrameExciter, FrameMarker, FrameSpring, HydrostatModel, Marker, MFreeHermiteNode3d, MFreeModel3d, MFreeMuscleModel, MFreeNode3d, MultiPointMuscle, MultiPointMuscleVia, MultiPointSpring, Muscle, Particle, PlanarPoint, Point, PointExciter, PointForce, PointSpringBase, PointToPointMuscle, RigidBody, RigidCompositeBody, SoftPlaneCollider, SpongeModel, Spring, TargetFrame, TargetPoint

public interface ForceEffector

An object that exerts forces within a mechanical model.


Method Summary
 void addPosJacobian(SparseNumberedBlockMatrix M, double s)
          Scales the components of the position Jacobian associated with this force effector and adds it to the supplied solve matrix M.
 void addSolveBlocks(SparseNumberedBlockMatrix M)
          Adds any needed blocks to a solve matrix in order to accomodate the Jacobian terms associated with this force effector.
 void addVelJacobian(SparseNumberedBlockMatrix M, double s)
          Scales the components of the velocity Jacobian associated with this force effector and adds it to the supplied solve matrix M.
 void applyForces(double t)
          Adds forces to the components affected by this force effector at a particular time.
 int getJacobianType()
          Returns a code indicating the matrix type that results when the Jacobian terms of this force effector are added to the solve matrix.
 

Method Detail

applyForces

void applyForces(double t)
Adds forces to the components affected by this force effector at a particular time. Component forces should be added and not set, since other forces may be added to the same components by other force effectors.

Parameters:
t - time (seconds)

addSolveBlocks

void addSolveBlocks(SparseNumberedBlockMatrix M)
Adds any needed blocks to a solve matrix in order to accomodate the Jacobian terms associated with this force effector. In general, blocks will be need to be added at locations given by the block indices (bi, bj), where bi and bj correspond to the solve indices (as returned by getSolveIndex) for all dynamic or attached components affected by this force effector.

Parameters:
M - solve matrix to which blocks should be added

addPosJacobian

void addPosJacobian(SparseNumberedBlockMatrix M,
                    double s)
Scales the components of the position Jacobian associated with this force effector and adds it to the supplied solve matrix M.

M is guaranteed to be the same matrix supplied in the most recent call to addSolveBlocks, and so implementations may choose to cache the relevant matrix blocks from that call, instead of retrieving them directly from M.

Parameters:
M - solve matrix to which scaled position Jacobian is to be added
s - scaling factor for position Jacobian

addVelJacobian

void addVelJacobian(SparseNumberedBlockMatrix M,
                    double s)
Scales the components of the velocity Jacobian associated with this force effector and adds it to the supplied solve matrix M.

M is guaranteed to be the same matrix supplied in the most recent call to addSolveBlocks, and so implementations may choose to cache the relevant matrix blocks from that call, instead of retrieving them directly from M.

Parameters:
M - solve matrix to which scaled velocity Jacobian is to be added
s - scaling factor for velocity Jacobian

getJacobianType

int getJacobianType()
Returns a code indicating the matrix type that results when the Jacobian terms of this force effector are added to the solve matrix. This should be a logical or-ing of either Matrix.SYMMETRIC or Matrix.POSITIVE_DEFINITE. The former should be set if adding the Jacobian terms preserves symmetry, and the latter should be set if positive definiteness if preserved. Both should be set if there is no Jacobian for this effector (i.e., the Jacobian methods are not implemented). Matrix types from all the force effectors are logically and-ed together to determine the type for the entire solve matrix.

Returns:
solve matrix type resulting from adding Jacobian terms