artisynth.core.mechmodels
Class DeformableBody

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.RenderableComponentBase
          extended by artisynth.core.mechmodels.DynamicMechComponentBase
              extended by artisynth.core.mechmodels.Frame
                  extended by artisynth.core.mechmodels.RigidBody
                      extended by artisynth.core.mechmodels.DeformableBody
All Implemented Interfaces:
Collidable, DynamicMechComponent, ForceEffector, MotionTargetComponent, CopyableComponent, HasCoordinateFrame, ModelComponent, RenderableComponent, Tracable, ScalableUnits, TransformableGeometry, PullController.Pullable, java.lang.Cloneable, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, Scannable
Direct Known Subclasses:
BeamBody

public abstract class DeformableBody
extends RigidBody


Nested Class Summary
 
Nested classes/interfaces inherited from class artisynth.core.mechmodels.RigidBody
RigidBody.InertiaMethod
 
Nested classes/interfaces inherited from interface artisynth.core.mechmodels.Collidable
Collidable.DefaultCollidable
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Field Summary
static PropertyList myProps
           
 
Fields inherited from class artisynth.core.mechmodels.Frame
dynamicVelInWorldCoords, myRenderFrame
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
 
Fields inherited from interface artisynth.core.modelbase.CopyableComponent
COPY_REFERENCES
 
Fields inherited from interface artisynth.core.mechmodels.Collidable
Default, Deformable, RigidBody, Self
 
Fields inherited from interface artisynth.core.util.TransformableGeometry
ARTICULATED, SIMULATING
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Method Summary
 void addPointForce(Vector3d f, Point3d loc)
          Adds the effect of a force applied at a specific postion with respect to this frame.
 void addPosImpulse(double[] xbuf, int xidx, double h, double[] vbuf, int vidx)
           
 void addPosJacobian(SparseNumberedBlockMatrix S, double s)
          Scales the components of the position Jacobian associated with this force effector and adds it to the supplied solve matrix M.
 void addSolveBlock(SparseNumberedBlockMatrix S)
           
 void addVelJacobian(SparseNumberedBlockMatrix S, 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.
 void computeDeformationGradient(Matrix3d F, Vector3d x0)
           
 void computeDeformedFrame(RigidTransform3d A, PolarDecomposition3d polarDecomp, RigidTransform3d A0)
           
 void computeDeformedFrame(RigidTransform3d A, RigidTransform3d A0)
           
 void computeDeformedFrameVel(Twist vel, PolarDecomposition3d polarDecomp, RigidTransform3d A0)
          Computes the spatial velocity of an attached frame A, as represented in the coordinates of A.
 void computeDeformedFrameVel(Twist vel, RigidTransform3d A, RigidTransform3d A0)
          Computes the spatial velocity of an attached frame A, as represented in the coordinates of A.
 void computeDeformedPos(Vector3d pos, Vector3d pos0)
          Computes the deformed position in body coordinates
 void computeDeformedVel(Vector3d vel, Vector3d pos0)
          Computes the deformed velocity in body coordinates
 void computeElasticJacobian(MatrixNd Pi, PolarDecomposition3d polarDecomp, RigidTransform3d A0)
          Compute the transform that maps elastic velocities onto the spatial velocity of an attached frame A, as represented in the coordinates of A.
 void computeElasticJacobian(MatrixNd Pi, RigidTransform3d A, RigidTransform3d A0)
          Compute the transform that maps elastic velocities onto the spatial velocity of an attached frame A, as represented in the coordinates of A.
 void computePointPosition(Vector3d pos, Point3d loc)
          Computes the position, in world coordinates, of a point attached to this frame.
 void computePointVelocity(Vector3d vel, Point3d loc, Twist frameVel)
          Computes the velocity, in world coordinates, of a point attached to this frame.
 void computeUndeformedFrame(RigidTransform3d A0, PolarDecomposition3d polarDecomp, RigidTransform3d A)
           
 double computeUndeformedPos(Vector3d pos0, Vector3d pos, double tol)
          Computes the undeformed position of a given position in body coordinates
static FemMaterial createDefaultMaterial()
           
 MatrixBlock createMassBlock()
          Create a matrix block for representing the mass of this component, initialized to the component's effective mass (instrinsic mass plus the mass due to all attachmented components).
 MatrixBlock createSolveBlock()
           
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
abstract  void getDShape(Matrix3d Dshp, int i, Vector3d pos0)
           
 VectorNd getElasticForce()
           
 VectorNd getElasticPos()
           
 double getElasticPos(int idx)
           
 void getElasticPos(VectorNd pos)
           
 VectorNd getElasticVel()
           
 double getElasticVel(int idx)
           
 void getElasticVel(VectorNd vel)
           
 int getForce(double[] f, int idx)
           
 void getInverseMass(Matrix Minv, Matrix M)
          Inverts a mass for this component.
 void getMass(Matrix M, double t)
          Gets the mass of this component at a particular time.
 double getMassDamping()
           
 int getMassForces(VectorNd f, double t, int idx)
          Gets the mass forces for this component at a particular time.
 FemMaterial getMaterial()
           
 int getPosDerivative(double[] dxdt, int idx)
           
 int getPosState(double[] buf, int idx)
           
 int getPosStateSize()
           
abstract  void getShape(Vector3d shp, int i, Vector3d pos0)
           
 double getStiffnessDamping()
           
 int getVelState(double[] buf, int idx)
           
 int getVelStateSize()
           
abstract  int numElasticCoords()
           
 void setElasticPos(int idx, double value)
           
 void setElasticPos(VectorNd pos)
           
 void setElasticVel(int idx, double value)
           
 void setElasticVel(VectorNd vel)
           
 int setForce(double[] f, int idx)
           
 void setForcesToExternal()
           
 void setMassDamping(double d)
           
 void setMaterial(FemMaterial mat)
           
 int setPosState(double[] buf, int idx)
           
 void setState(DynamicMechComponent c)
          Sets the state of this DynamicMechComponent from that of another.
 void setStiffnessDamping(double d)
           
 int setVelState(double[] buf, int idx)
           
abstract  void updateStiffnessMatrix()
           
 void zeroExternalForces()
           
 void zeroForces()
           
 
Methods inherited from class artisynth.core.mechmodels.RigidBody
addScaledVelocity, addVelocity, applyForce, applyGravity, applyPosImpulse, computeVolume, copy, createBox, createCollisionData, createCylinder, createEllipsoid, createFromMesh, createFromMesh, createFromMesh, createFromMesh, createRenderProps, createSphere, extrapolatePose, findFreeAttachedBodies, getCenterOfMass, getCenterOfMass, getCopyReferences, getDensity, getDensityRange, getFrameMarkers, getInertia, getInertiaMethod, getMass, getMass, getMassRange, getMesh, getMeshFileName, getMeshFileTransform, getOriginData, getOriginPoint, getPointRenderRadius, getRelativePoses, getRotationalInertia, getRotationalInertia, getSurfaceMesh, isCollidable, isDuplicatable, isMassConstant, isPullable, prerender, render, scaleDistance, scaleMass, scaleMesh, scan, setBodyVelocity, setCenterOfMass, setDensity, setDynamic, setInertia, setInertia, setInertia, setInertia, setInertiaFromDensity, setInertiaFromMass, setInertiaMethod, setMass, setMesh, setMesh, setMeshFileName, setMeshFileTransform, setPose, setPose, setPosition, setRelativePoses, setRotation, setRotationalInertia, setState, setState, setSurfaceMesh, setSurfaceMesh, setVelocity, transformGeometry, transformGeometry, updateAttachmentPosStates, updateBounds, updatePose, write
 
Methods inherited from class artisynth.core.mechmodels.Frame
addExternalForce, addForce, addScaledExternalForce, addSolveBlocks, addTargetJacobian, computeAppliedWrench, computeAppliedWrench, computePointVelocity, drawAxes, getAxisLength, getBodyForce, getBodyVelocity, getBodyVelState, getExternalForce, getForce, getForce, getFrameDamping, getFrameDampingMode, getJacobianType, getMoment, getOrientation, getPose, getPose, getPosition, getRotaryDamping, getRotaryDampingMode, getRotation, getSelection, getState, getState, getTargetActivity, getTargetOrientation, getTargetPos, getTargetPose, getTargetPosition, getTargetVel, getTargetVelocity, getTracables, getTracingProbe, getTransForce, getVelocity, getVelocity, getWorldVelState, resetTargets, setAxisLength, setExternalForce, setForce, setFrameDamping, setFrameDampingMode, setOrientation, setRotaryDamping, setRotaryDampingMode, setTargetActivity, setTargetOrientation, setTargetPos, setTargetPose, setTargetPosition, setTargetVel, setTargetVelocity, setVelocity, velocityLimitExceeded
 
Methods inherited from class artisynth.core.mechmodels.DynamicMechComponentBase
addMasterAttachment, getAttachment, getMasterAttachments, getSolveIndex, hasState, isActive, isAttached, isControllable, isDynamic, isParametric, removeMasterAttachment, setAttached, setSolveIndex
 
Methods inherited from class artisynth.core.modelbase.RenderableComponentBase
getRenderHints, getRenderProps, isSelectable, numSelectionQueriesNeeded, setRenderProps, updateRenderProps
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface artisynth.core.modelbase.ModelComponent
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from interface maspack.properties.HasProperties
getProperty
 
Methods inherited from interface maspack.properties.HierarchyNode
getChildren, hasChildren
 
Methods inherited from interface maspack.util.Scannable
isWritable
 
Methods inherited from interface artisynth.core.mechmodels.DynamicMechComponent
addMasterAttachment, checkFlag, clearFlag, getAttachment, getMasterAttachments, getSolveIndex, isActive, isAttached, isControllable, isDynamic, isParametric, removeMasterAttachment, setAttached, setFlag, setSolveIndex
 

Field Detail

myProps

public static PropertyList myProps
Method Detail

getAllPropertyInfo

public PropertyList getAllPropertyInfo()
Description copied from interface: HasProperties
Returns a list giving static information about all properties exported by this object.

Specified by:
getAllPropertyInfo in interface HasProperties
Overrides:
getAllPropertyInfo in class RigidBody
Returns:
static information for all exported properties

numElasticCoords

public abstract int numElasticCoords()

setMassDamping

public void setMassDamping(double d)

getMassDamping

public double getMassDamping()

setStiffnessDamping

public void setStiffnessDamping(double d)

getStiffnessDamping

public double getStiffnessDamping()

createDefaultMaterial

public static FemMaterial createDefaultMaterial()

getMaterial

public FemMaterial getMaterial()

setMaterial

public void setMaterial(FemMaterial mat)

getElasticPos

public VectorNd getElasticPos()

getElasticVel

public VectorNd getElasticVel()

getElasticPos

public void getElasticPos(VectorNd pos)

getElasticVel

public void getElasticVel(VectorNd vel)

getElasticForce

public VectorNd getElasticForce()

setElasticPos

public void setElasticPos(VectorNd pos)

setElasticVel

public void setElasticVel(VectorNd vel)

createMassBlock

public MatrixBlock createMassBlock()
Description copied from interface: DynamicMechComponent
Create a matrix block for representing the mass of this component, initialized to the component's effective mass (instrinsic mass plus the mass due to all attachmented components).

Specified by:
createMassBlock in interface DynamicMechComponent
Overrides:
createMassBlock in class Frame

getMass

public void getMass(Matrix M,
                    double t)
Description copied from interface: DynamicMechComponent
Gets the mass of this component at a particular time.

Specified by:
getMass in interface DynamicMechComponent
Overrides:
getMass in class RigidBody
Parameters:
M - matrix to return the mass in
t - current time

getMassForces

public int getMassForces(VectorNd f,
                         double t,
                         int idx)
Description copied from interface: DynamicMechComponent
Gets the mass forces for this component at a particular time. The forces should be stored in f, starting at the location specified by idx. Upon return, this method should return the value of idx incremented by the dimension of the mass forces.

Specified by:
getMassForces in interface DynamicMechComponent
Overrides:
getMassForces in class RigidBody
Parameters:
f - vector to return the forces in
t - current time
idx - starting location within f where forces should be stored
Returns:
updated value for idx

getInverseMass

public void getInverseMass(Matrix Minv,
                           Matrix M)
Description copied from interface: DynamicMechComponent
Inverts a mass for this component.

Specified by:
getInverseMass in interface DynamicMechComponent
Overrides:
getInverseMass in class RigidBody
Parameters:
Minv - matrix to return the inverse mass in
M - matrix containing the mass to be inverted

addSolveBlock

public void addSolveBlock(SparseNumberedBlockMatrix S)
Specified by:
addSolveBlock in interface DynamicMechComponent
Overrides:
addSolveBlock in class Frame

createSolveBlock

public MatrixBlock createSolveBlock()
Specified by:
createSolveBlock in interface DynamicMechComponent
Overrides:
createSolveBlock in class Frame

setState

public void setState(DynamicMechComponent c)
Description copied from interface: DynamicMechComponent
Sets the state of this DynamicMechComponent from that of another.

Specified by:
setState in interface DynamicMechComponent
Overrides:
setState in class Frame
Parameters:
c - component from which the state is to be copied.

addPosImpulse

public void addPosImpulse(double[] xbuf,
                          int xidx,
                          double h,
                          double[] vbuf,
                          int vidx)
Specified by:
addPosImpulse in interface DynamicMechComponent
Overrides:
addPosImpulse in class Frame

getPosDerivative

public int getPosDerivative(double[] dxdt,
                            int idx)
Specified by:
getPosDerivative in interface DynamicMechComponent
Overrides:
getPosDerivative in class Frame

getPosState

public int getPosState(double[] buf,
                       int idx)
Specified by:
getPosState in interface DynamicMechComponent
Overrides:
getPosState in class Frame

setPosState

public int setPosState(double[] buf,
                       int idx)
Specified by:
setPosState in interface DynamicMechComponent
Overrides:
setPosState in class RigidBody

getVelState

public int getVelState(double[] buf,
                       int idx)
Specified by:
getVelState in interface DynamicMechComponent
Overrides:
getVelState in class Frame

setVelState

public int setVelState(double[] buf,
                       int idx)
Specified by:
setVelState in interface DynamicMechComponent
Overrides:
setVelState in class RigidBody

setForce

public int setForce(double[] f,
                    int idx)
Specified by:
setForce in interface DynamicMechComponent
Overrides:
setForce in class Frame

getForce

public int getForce(double[] f,
                    int idx)
Specified by:
getForce in interface DynamicMechComponent
Overrides:
getForce in class Frame

getPosStateSize

public int getPosStateSize()
Specified by:
getPosStateSize in interface DynamicMechComponent
Specified by:
getPosStateSize in interface MotionTargetComponent
Overrides:
getPosStateSize in class Frame

getVelStateSize

public int getVelStateSize()
Specified by:
getVelStateSize in interface DynamicMechComponent
Specified by:
getVelStateSize in interface MotionTargetComponent
Overrides:
getVelStateSize in class Frame

zeroForces

public void zeroForces()
Specified by:
zeroForces in interface DynamicMechComponent
Overrides:
zeroForces in class Frame

zeroExternalForces

public void zeroExternalForces()
Specified by:
zeroExternalForces in interface DynamicMechComponent
Overrides:
zeroExternalForces in class Frame

setForcesToExternal

public void setForcesToExternal()
Specified by:
setForcesToExternal in interface DynamicMechComponent
Overrides:
setForcesToExternal in class Frame

updateStiffnessMatrix

public abstract void updateStiffnessMatrix()

applyForces

public void applyForces(double t)
Description copied from interface: ForceEffector
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.

Specified by:
applyForces in interface ForceEffector
Overrides:
applyForces in class Frame
Parameters:
t - time (seconds)

addVelJacobian

public void addVelJacobian(SparseNumberedBlockMatrix S,
                           double s)
Description copied from interface: ForceEffector
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.

Specified by:
addVelJacobian in interface ForceEffector
Overrides:
addVelJacobian in class Frame
Parameters:
S - solve matrix to which scaled velocity Jacobian is to be added
s - scaling factor for velocity Jacobian

addPosJacobian

public void addPosJacobian(SparseNumberedBlockMatrix S,
                           double s)
Description copied from interface: ForceEffector
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.

Specified by:
addPosJacobian in interface ForceEffector
Overrides:
addPosJacobian in class Frame
Parameters:
S - solve matrix to which scaled position Jacobian is to be added
s - scaling factor for position Jacobian

getShape

public abstract void getShape(Vector3d shp,
                              int i,
                              Vector3d pos0)

getDShape

public abstract void getDShape(Matrix3d Dshp,
                               int i,
                               Vector3d pos0)

computePointPosition

public void computePointPosition(Vector3d pos,
                                 Point3d loc)
Description copied from class: Frame
Computes the position, in world coordinates, of a point attached to this frame.

Overrides:
computePointPosition in class Frame
Parameters:
pos - returns the point position
loc - position of the point, in body coordinates

computePointVelocity

public void computePointVelocity(Vector3d vel,
                                 Point3d loc,
                                 Twist frameVel)
Description copied from class: Frame
Computes the velocity, in world coordinates, of a point attached to this frame.

Overrides:
computePointVelocity in class Frame
Parameters:
vel - returns the point velocity
loc - position of the point, in body coordinates
frameVel - velocity of the frame, in rotated world coordinates

computeDeformedPos

public void computeDeformedPos(Vector3d pos,
                               Vector3d pos0)
Computes the deformed position in body coordinates


computeUndeformedPos

public double computeUndeformedPos(Vector3d pos0,
                                   Vector3d pos,
                                   double tol)
Computes the undeformed position of a given position in body coordinates


computeDeformedVel

public void computeDeformedVel(Vector3d vel,
                               Vector3d pos0)
Computes the deformed velocity in body coordinates


computeDeformationGradient

public void computeDeformationGradient(Matrix3d F,
                                       Vector3d x0)

computeDeformedFrame

public void computeDeformedFrame(RigidTransform3d A,
                                 PolarDecomposition3d polarDecomp,
                                 RigidTransform3d A0)

computeUndeformedFrame

public void computeUndeformedFrame(RigidTransform3d A0,
                                   PolarDecomposition3d polarDecomp,
                                   RigidTransform3d A)

computeDeformedFrame

public void computeDeformedFrame(RigidTransform3d A,
                                 RigidTransform3d A0)

computeDeformedFrameVel

public void computeDeformedFrameVel(Twist vel,
                                    RigidTransform3d A,
                                    RigidTransform3d A0)
Computes the spatial velocity of an attached frame A, as represented in the coordinates of A.


computeElasticJacobian

public void computeElasticJacobian(MatrixNd Pi,
                                   RigidTransform3d A,
                                   RigidTransform3d A0)
Compute the transform that maps elastic velocities onto the spatial velocity of an attached frame A, as represented in the coordinates of A.


computeDeformedFrameVel

public void computeDeformedFrameVel(Twist vel,
                                    PolarDecomposition3d polarDecomp,
                                    RigidTransform3d A0)
Computes the spatial velocity of an attached frame A, as represented in the coordinates of A.


computeElasticJacobian

public void computeElasticJacobian(MatrixNd Pi,
                                   PolarDecomposition3d polarDecomp,
                                   RigidTransform3d A0)
Compute the transform that maps elastic velocities onto the spatial velocity of an attached frame A, as represented in the coordinates of A.


addPointForce

public void addPointForce(Vector3d f,
                          Point3d loc)
Adds the effect of a force applied at a specific postion with respect to this frame. The force is in world coordinates and the position in frame coordinates.

Overrides:
addPointForce in class Frame

setElasticPos

public void setElasticPos(int idx,
                          double value)

getElasticPos

public double getElasticPos(int idx)

setElasticVel

public void setElasticVel(int idx,
                          double value)

getElasticVel

public double getElasticVel(int idx)