artisynth.core.mechmodels
Interface DynamicMechComponent

All Superinterfaces:
ForceEffector, HasProperties, HierarchyNode, ModelComponent, Scannable
All Known Subinterfaces:
MotionTargetComponent
All Known Implementing Classes:
BeamBody, DeformableBody, DynamicMechComponentBase, Elaston, FemMarker, FemNode, FemNode3d, Frame, FrameMarker, Marker, MFreeHermiteNode3d, MFreeNode3d, Particle, PlanarPoint, Point, RigidBody, RigidCompositeBody, TargetFrame, TargetPoint

public interface DynamicMechComponent
extends ModelComponent, ForceEffector


Nested Class Summary
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Method Summary
 void addMasterAttachment(DynamicAttachment a)
           
 void addPosImpulse(double[] xbuf, int xidx, double h, double[] vbuf, int vidx)
           
 void addSolveBlock(SparseNumberedBlockMatrix S)
           
 void applyGravity(Vector3d gacc)
          Applies a gravity force to this component, given a prescribed gravity acceleration vector.
 boolean checkFlag(int mask)
          Check if a flag is set
 void clearFlag(int mask)
          Clear a flag
 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()
           
 DynamicAttachment getAttachment()
          Returns the slave attachment associated with this component, if any.
 int getForce(double[] buf, int idx)
           
 void getInverseMass(Matrix Minv, Matrix M)
          Inverts a mass for this component.
 double getMass(double t)
          Returns the scalar mass of this component at time t.
 void getMass(Matrix M, double t)
          Gets the mass of this component at a particular time.
 int getMassForces(VectorNd f, double t, int idx)
          Gets the mass forces for this component at a particular time.
 java.util.LinkedList<DynamicAttachment> getMasterAttachments()
          Returns a list of the attachments for which this component is a master, or null if there are no such attachments.
 int getPosDerivative(double[] buf, int idx)
           
 int getPosState(double[] buf, int idx)
           
 int getPosStateSize()
           
 int getSolveIndex()
           
 int getVelState(double[] buf, int idx)
           
 int getVelStateSize()
           
 boolean isActive()
          Returns true if this component is active.
 boolean isAttached()
          Returns true if this component is attached.
 boolean isControllable()
          Returns true is this component is active, or it is attached to one or more other components which ultimately are attached to at least one active component.
 boolean isDynamic()
          Returns true if this component is dynamic.
 boolean isMassConstant()
           
 boolean isParametric()
          Returns true if the state of this component is determined parametrically; i.e., it is neither dynamic nor attached.
 void removeMasterAttachment(DynamicAttachment a)
           
 void setAttached(DynamicAttachment attachment)
          M Attach this component to another via a DynamicAttachment object.
 void setFlag(int mask)
          Set flag
 int setForce(double[] buf, int idx)
           
 void setForcesToExternal()
           
 int setPosState(double[] buf, int idx)
           
 void setSolveIndex(int idx)
           
 void setState(DynamicMechComponent c)
          Sets the state of this DynamicMechComponent from that of another.
 int setVelState(double[] buf, int idx)
           
 boolean velocityLimitExceeded(double tlimit, double rlimit)
          Checks if the current component velocity exceeds specified limits.
 void zeroExternalForces()
           
 void zeroForces()
           
 
Methods inherited from interface artisynth.core.modelbase.ModelComponent
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, postscan, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, updateReferences
 
Methods inherited from interface maspack.properties.HasProperties
getAllPropertyInfo, getProperty
 
Methods inherited from interface maspack.properties.HierarchyNode
getChildren, hasChildren
 
Methods inherited from interface maspack.util.Scannable
isWritable, write
 
Methods inherited from interface artisynth.core.mechmodels.ForceEffector
addPosJacobian, addSolveBlocks, addVelJacobian, applyForces, getJacobianType
 

Method Detail

getAttachment

DynamicAttachment getAttachment()
Returns the slave attachment associated with this component, if any.

Returns:
slave attachment, or null if the component is unattached

getMasterAttachments

java.util.LinkedList<DynamicAttachment> getMasterAttachments()
Returns a list of the attachments for which this component is a master, or null if there are no such attachments. The returned list must not be modified.

Returns:
list of master attachments

setAttached

void setAttached(DynamicAttachment attachment)
M Attach this component to another via a DynamicAttachment object.

Parameters:
attachment - Specifies the attachment relationship between this component and its master(s)

addMasterAttachment

void addMasterAttachment(DynamicAttachment a)

removeMasterAttachment

void removeMasterAttachment(DynamicAttachment a)

isDynamic

boolean isDynamic()
Returns true if this component is dynamic. If a component is unattached, then its state is determined by forces if it is dynamic, or parametrically if it is non-dynamic.

Returns:
true if this component is dynamic

isActive

boolean isActive()
Returns true if this component is active. A component is active if its position and velocity are determined by forces, which implies that it is dynamic and unattached.

Returns:
true if this component is active

isAttached

boolean isAttached()
Returns true if this component is attached. The state of an attached component is derived from the state of an attached master component.

Returns:
true if this component is attached

isParametric

boolean isParametric()
Returns true if the state of this component is determined parametrically; i.e., it is neither dynamic nor attached.

Returns:
true if this component's state is determined parametrically.

isControllable

boolean isControllable()
Returns true is this component is active, or it is attached to one or more other components which ultimately are attached to at least one active component.

Returns:
true if this component is controllable.

getSolveIndex

int getSolveIndex()

setSolveIndex

void setSolveIndex(int idx)

createMassBlock

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).


isMassConstant

boolean isMassConstant()

getMass

double getMass(double t)
Returns the scalar mass of this component at time t.


getMass

void getMass(Matrix M,
             double t)
Gets the mass of this component at a particular time.

Parameters:
M - matrix to return the mass in
t - current time

getMassForces

int getMassForces(VectorNd f,
                  double t,
                  int idx)
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.

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

void getInverseMass(Matrix Minv,
                    Matrix M)
Inverts a mass for this component.

Parameters:
Minv - matrix to return the inverse mass in
M - matrix containing the mass to be inverted

addSolveBlock

void addSolveBlock(SparseNumberedBlockMatrix S)

createSolveBlock

MatrixBlock createSolveBlock()

setState

void setState(DynamicMechComponent c)
Sets the state of this DynamicMechComponent from that of another.

Parameters:
c - component from which the state is to be copied.

addPosImpulse

void addPosImpulse(double[] xbuf,
                   int xidx,
                   double h,
                   double[] vbuf,
                   int vidx)

getPosDerivative

int getPosDerivative(double[] buf,
                     int idx)

getPosState

int getPosState(double[] buf,
                int idx)

setPosState

int setPosState(double[] buf,
                int idx)

getVelState

int getVelState(double[] buf,
                int idx)

setVelState

int setVelState(double[] buf,
                int idx)

setForce

int setForce(double[] buf,
             int idx)

getForce

int getForce(double[] buf,
             int idx)

getPosStateSize

int getPosStateSize()

getVelStateSize

int getVelStateSize()

zeroForces

void zeroForces()

zeroExternalForces

void zeroExternalForces()

setForcesToExternal

void setForcesToExternal()

velocityLimitExceeded

boolean velocityLimitExceeded(double tlimit,
                              double rlimit)
Checks if the current component velocity exceeds specified limits. Used to check solution stability.

Parameters:
tlimit - translational velocity limit
rlimit - rotational velocity limit
Returns:
true if velocity exceeds specified limits

applyGravity

void applyGravity(Vector3d gacc)
Applies a gravity force to this component, given a prescribed gravity acceleration vector.


setFlag

void setFlag(int mask)
Set flag


checkFlag

boolean checkFlag(int mask)
Check if a flag is set


clearFlag

void clearFlag(int mask)
Clear a flag