artisynth.core.mfreemodels
Class MFreeModel3d

java.lang.Object
  extended by artisynth.core.modelbase.ModelComponentBase
      extended by artisynth.core.modelbase.ComponentList<ModelComponent>
          extended by artisynth.core.modelbase.ModelBase
              extended by artisynth.core.modelbase.RenderableModelBase
                  extended by artisynth.core.mechmodels.MechSystemBase
                      extended by artisynth.core.femmodels.FemModel
                          extended by artisynth.core.mfreemodels.MFreeModel3d
All Implemented Interfaces:
Collidable, Constrainer, ForceEffector, HasSlaveObjects, MechSystem, MechSystemModel, ComponentChangeListener, ComponentListView<ModelComponent>, CompositeComponent, CopyableComponent, HasState, IndexedComponentList, Model, ModelComponent, MutableCompositeComponent<ModelComponent>, ParameterizedClass, RenderableComponent, PropertyChangeListener, ScalableUnits, TransformableGeometry, java.lang.Cloneable, java.lang.Iterable<ModelComponent>, java.util.Collection<ModelComponent>, HasProperties, HierarchyNode, GLRenderable, GLSelectable, HasRenderProps, Renderable, Disposable, ListView<ModelComponent>, Scannable
Direct Known Subclasses:
MFreeMuscleModel

public class MFreeModel3d
extends FemModel
implements TransformableGeometry, ScalableUnits, MechSystemModel, Collidable, CopyableComponent


Nested Class Summary
 
Nested classes/interfaces inherited from class artisynth.core.femmodels.FemModel
FemModel.ElementFilter, FemModel.IncompMethod, FemModel.Ranging, FemModel.SurfaceRender
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.ModelComponent
ModelComponent.NavpanelVisibility
 
Nested classes/interfaces inherited from interface artisynth.core.mechmodels.MechSystem
MechSystem.ConstraintInfo, MechSystem.FrictionInfo
 
Nested classes/interfaces inherited from interface artisynth.core.mechmodels.Collidable
Collidable.DefaultCollidable
 
Nested classes/interfaces inherited from interface artisynth.core.modelbase.CompositeComponent
CompositeComponent.NavpanelDisplay
 
Field Summary
static boolean abortOnInvertedElems
           
static boolean checkTangentStability
           
static FemModel.IncompMethod DEFAULT_HARD_INCOMP
           
static FemModel.IncompMethod DEFAULT_SOFT_INCOMP
           
static ColorMapBase defaultColorMap
           
static PropertyList myProps
           
 
Fields inherited from class artisynth.core.mechmodels.MechSystemBase
myParametricsInSystemMatrix
 
Fields inherited from class artisynth.core.modelbase.ComponentList
DEFAULT_NAVPANEL_DISPLAY
 
Fields inherited from class artisynth.core.modelbase.ModelComponentBase
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
 
Fields inherited from interface artisynth.core.util.TransformableGeometry
ARTICULATED, SIMULATING
 
Fields inherited from interface artisynth.core.mechmodels.MechSystem
COMPUTE_CONTACTS, UPDATE_CONTACTS
 
Fields inherited from interface artisynth.core.mechmodels.Collidable
Default, Deformable, RigidBody, Self
 
Fields inherited from interface artisynth.core.modelbase.CopyableComponent
COPY_REFERENCES
 
Fields inherited from interface maspack.render.GLRenderable
TRANSLUCENT, TWO_DIMENSIONAL
 
Constructor Summary
MFreeModel3d()
           
MFreeModel3d(java.lang.String name)
           
 
Method Summary
 int addBilateralConstraints(SparseBlockMatrix GT, VectorNd dg, int numb, IntHolder changeCnt)
           
static void addControls(ControlPanel controlPanel, FemModel femModel, ModelComponent topModel)
           
 void addElement(MFreeElement3d e)
           
 void addElements(java.util.List<MFreeElement3d> regionList)
           
 void addMaterialBundle(MFreeAuxMaterialBundle bundle)
           
 MeshComponent addMesh(MeshBase mesh)
           
 void addNode(MFreeNode3d p)
           
 void addNodes(java.util.List<MFreeNode3d> nodes)
           
 void addNumberedElement(MFreeElement3d e, int elemId)
           
 void addNumberedNode(MFreeNode3d p, int number)
           
 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 S)
          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.
 StepAdjustment advance(double t0, double t1, int flags)
          Advances this object from time t0 to time t1.
 void checkInversion()
           
 DynamicMechComponent checkVelocityStability()
          Checks the velocity stability of this system.
 void clearElements()
           
 void clearMaterialBundles()
           
 void clearMeshes()
           
 void componentChanged(ComponentChangeEvent e)
          Notifies this composite component that a change has occured within one or more of its descendants.
 SparseMatrixNd computeConsistentMassMatrix()
           
 double computeConsistentMassMatrixEntry(MFreeNode3d node1, MFreeNode3d node2)
           
 void computeShapeMatrix()
           
 CollisionData createCollisionData()
           
static ColorMapBase createDefaultColorMap()
           
 void dispose()
          Called when the model is discarded.
 PropertyList getAllPropertyInfo()
          Returns a list giving static information about all properties exported by this object.
 void getAuxStateComponents(java.util.List<HasAuxState> comps, int level)
           
 int getBilateralImpulses(VectorNd lam, int idx)
           
 int getBilateralInfo(MechSystem.ConstraintInfo[] ginfo, int idx)
           
 void getBilateralSizes(VectorNi sizes)
           
 MFreeNode3d getByNumber(int num)
          Get the component with the specified number, or null if there is no such component.
 void getCollidables(java.util.List<Collidable> list, int level)
           
 ColorMapBase getColorMap()
           
 PropertyMode getColorMapMode()
           
 boolean getCopyReferences(java.util.List<ModelComponent> refs, ModelComponent ancestor)
          Collects external references which must also be copied in order to duplicate this component.
 MFreeElement3d getElement(int idx)
           
 BVTree getElementBVTree()
           
 MFreeElement3d getElementByNumber(int num)
           
 RenderableComponentList<MFreeElement3d> getElements()
           
 double getElementWidgetSize()
           
 PropertyMode getElementWidgetSizeMode()
           
 double getEnergy()
           
 FemModel.IncompMethod getHardIncompMethod()
           
 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.
 RenderableComponentList<MFreeAuxMaterialBundle> getMaterialBundles()
           
 MeshBase getMesh(int idx)
           
 MeshComponent getMeshComponent(int idx)
           
 java.util.Collection<MeshComponent> getMeshes()
           
 MFreeNode3d getNode(int idx)
           
 BVTree getNodeBVTree()
           
 java.util.LinkedList<FemNodeNeighbor> getNodeNeighbors(FemNode3d node)
           
 PointList<MFreeNode3d> getNodes()
           
 void getSelection(java.util.LinkedList<java.lang.Object> list, int qid)
          Append to list the component (or components) associated with the qid-th selection query issued by this component's render method.
 FemModel.IncompMethod getSoftIncompMethod()
           
 void initialize(double t0)
          Causes this model to initialize itself at time t.
 double integrate(Function3x1 fun)
           
 double integrateMass()
           
 double integrateVolume()
           
 void invalidateRestData()
           
 void invalidateStressAndStiffness()
           
 void invalidateSurfaceMesh()
           
 boolean isCollidable()
           
 boolean isDuplicatable()
          Returns true if this component can be duplicated.
 int numSurfaceMeshes()
           
 void prerender(RenderList list)
          Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer.
 void recursivelyFinalizeAdvance(StepAdjustment stepAdjust, double t0, double t1, int flags, int level)
           
 void recursivelyInitialize(double t, int level)
           
 boolean removeElement(MFreeElement3d e)
           
 boolean removeMaterialBundle(MFreeAuxMaterialBundle bundle)
           
 boolean removeMesh(MeshBase mesh)
           
 boolean removeNode(MFreeNode3d p)
           
 void render(GLRenderer renderer, int flags)
          Render this object using Open GL via the JOGL.
 void resetRestPosition()
           
 void scaleDistance(double s)
          Scales all distance coordinates.
 int setBilateralImpulses(VectorNd lam, double h, int idx)
           
 void setColorMap(ColorMapBase colorMap)
           
 void setColorMapMode(PropertyMode mode)
           
 void setComputeNodalStrain(boolean enable)
           
 void setComputeNodalStress(boolean enable)
           
 void setElementWidgetSize(double size)
           
 void setElementWidgetSizeMode(PropertyMode mode)
           
 void setIncompressible(FemModel.IncompMethod method)
           
 void setMaterial(FemMaterial mat)
           
 void setSoftIncompMethod(FemModel.IncompMethod method)
           
 void setSurfaceRendering(FemModel.SurfaceRender mode)
           
 void transformGeometry(AffineTransform3dBase X)
          Applies an affine transformation to the geometry of this object.
 void transformGeometry(AffineTransform3dBase X, TransformableGeometry topObject, int flags)
          Applies an affine transformation to the geometry of this object.
 void updateAllRestVolumes()
           
 void updateAllVolumes()
           
 void updateBounds(Point3d pmin, Point3d pmax)
          Update the minimum and maximum points for this object.
 double updateConstraints(double t, int flags)
           
 void updateJacobians()
           
 void updateNodeMasses(double totalMass, VectorNd massMatrixDiag)
           
 void updateSlavePos()
          Called when the system's dynamic position state changes, to update the position state of the slave objects.
 void updateStressAndStiffness()
           
 double updateVolume()
           
 void zeroImpulses()
           
 
Methods inherited from class artisynth.core.femmodels.FemModel
addFrictionConstraints, addMarker, addMarker, addUnilateralConstraints, applyForces, attachments, attachPoint, clear, copy, createDefaultMaterial, detachAllNodes, detachPoint, forcesNeedUpdating, getAttachments, getCharacteristicSize, getCollidables, getConstrainers, getDensity, getDensityMode, getDynamicComponents, getForceEffectors, getGravity, getGravityMode, getImplicitIterations, getImplicitPrecision, getIntegrator, getMass, getMaterial, getMatrixSolver, getNodeMass, getNumInverted, getParticleDamping, getRestVolume, getSlaveObjectComponents, getStiffnessDamping, getStressPlotRange, getStressPlotRangeMode, getStressPlotRanging, getStressPlotRangingMode, getSurfaceRendering, getSurfaceRenderingMode, getToleranceType, getUnilateralImpulses, getUnilateralInfo, getUnilateralSizes, getVolume, hasState, isProfile, markers, maxFrictionConstraintSets, numElements, numNodes, propertyChanged, removeMarker, resetStressPlotRange, scaleMass, setBounds, setDensity, setDensityMode, setGravity, setGravity, setGravityMode, setImplicitIterations, setImplicitPrecision, setIntegrator, setLinearMaterial, setMatrixSolver, setMaxStepSize, setParticleDamping, setProfile, setStiffnessDamping, setStressPlotRange, setStressPlotRangeMode, setStressPlotRanging, setStressPlotRangingMode, setSurfaceRenderingMode, setToleranceType, setUnilateralImpulses, updateRestVolume, updateSlaveVel, validateMatrixSolver, zeroExternalForces
 
Methods inherited from class artisynth.core.mechmodels.MechSystemBase
addActivePosImpulse, addAttachmentJacobian, addAttachmentSolveBlocks, addGeneralSolveBlocks, addPosJacobian, addVelJacobian, applyAttachmentForces, buildMassMatrix, buildSolveMatrix, createState, createVelocityJacobian, getActiveForces, getActivePosDerivative, getActivePosState, getActivePosStateSize, getActiveStiffness, getActiveVelState, getActiveVelState, getActiveVelStateSize, getAttachmentConstraints, getAttachmentDerivatives, getAuxState, getBilateralConstraints, getBilateralConstraintSizes, getBilateralImpulses, getBilateralInfo, getDefaultStabilization, getDynamicsEnabled, getFrictionConstraints, getInitialState, getInverseMassMatrix, getMassMatrix, getNumBilateralImpulses, getNumUnilateralImpulses, getParametricForces, getParametricPosState, getParametricPosStateSize, getParametricPosTarget, getParametricVelState, getParametricVelStateSize, getParametricVelTarget, getPenetrationLimit, getSolveMatrixType, getSolver, getStabilization, getState, getStructureVersion, getUnilateralConstraints, getUnilateralConstraintSizes, getUnilateralImpulses, getUnilateralInfo, getUpdateForcesAtStepEnd, hasParameterizedType, numActiveComponents, numAttachedComponents, numParametricComponents, preadvance, printActiveStiffness, reduceVelocityJacobian, setActiveForces, setActivePosState, setActiveVelState, setAuxState, setBilateralImpulses, setDefaultStabilization, setDynamicsEnabled, setParametricForces, setParametricPosState, setParametricVelState, setPenetrationLimit, setStabilization, setState, setUnilateralImpulses, setUpdateForcesAtStepEnd, updateAttachmentPos, updateAttachmentVel, updateConstraints, updateForces, updatePosState, updateVelState, writeBilateralConstraintMatrix, writeMassMatrix, writeStiffnessMatrix
 
Methods inherited from class artisynth.core.modelbase.RenderableModelBase
createRenderProps, getRenderHints, getRenderProps, isSelectable, numSelectionQueriesNeeded, setRenderProps
 
Methods inherited from class artisynth.core.modelbase.ModelBase
copy, getInitialState, getMaxStepSize, hierarchyContainsReferences, setInitialState
 
Methods inherited from class artisynth.core.modelbase.ComponentList
add, add, addAll, addComponents, addFixed, addNumbered, clone, contains, contains, containsAll, ensureCapacity, findComponent, get, get, getChildren, getNavpanelDisplay, getNumberLimit, getShortName, getTypeParameter, hasChildren, indexOf, isEmpty, iterator, nextComponentNumber, numComponents, postscan, remove, remove, removeAll, removeAll, removeComponents, retainAll, scan, setNavpanelDisplay, setNumberingStartAtOne, setShortName, size, toArray, toArray, updateNameMap
 
Methods inherited from class artisynth.core.modelbase.ModelComponentBase
checkFlag, checkName, checkNameUniqueness, clearFlag, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, isFixed, isMarked, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setSelected, updateReferences, write
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface artisynth.core.util.ScalableUnits
scaleMass
 
Methods inherited from interface artisynth.core.mechmodels.MechSystemModel
getAttachments, getConstrainers, getDynamicComponents, getForceEffectors, getSlaveObjectComponents
 
Methods inherited from interface artisynth.core.modelbase.Model
getMaxStepSize, preadvance
 
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
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.modelbase.HasState
createState, getInitialState, getState, setState
 
Methods inherited from interface artisynth.core.mechmodels.MechSystem
addActivePosImpulse, addPosJacobian, addVelJacobian, buildMassMatrix, buildSolveMatrix, getActiveForces, getActivePosDerivative, getActivePosState, getActivePosStateSize, getActiveVelState, getActiveVelStateSize, getBilateralConstraints, getBilateralImpulses, getBilateralInfo, getFrictionConstraints, getInverseMassMatrix, getMassMatrix, getParametricForces, getParametricPosState, getParametricPosStateSize, getParametricPosTarget, getParametricVelState, getParametricVelStateSize, getParametricVelTarget, getSolveMatrixType, getStructureVersion, getUnilateralConstraints, getUnilateralImpulses, getUnilateralInfo, maxFrictionConstraintSets, numActiveComponents, numParametricComponents, setActiveForces, setActivePosState, setActiveVelState, setBilateralImpulses, setParametricForces, setParametricPosState, setParametricVelState, setUnilateralImpulses, updateConstraints, updateForces
 
Methods inherited from interface artisynth.core.mechmodels.Collidable
getMass
 
Methods inherited from interface artisynth.core.modelbase.CopyableComponent
copy
 
Methods inherited from interface artisynth.core.modelbase.ComponentListView
getName
 
Methods inherited from interface java.util.Collection
equals, hashCode
 

Field Detail

checkTangentStability

public static boolean checkTangentStability

abortOnInvertedElems

public static boolean abortOnInvertedElems

DEFAULT_HARD_INCOMP

public static FemModel.IncompMethod DEFAULT_HARD_INCOMP

DEFAULT_SOFT_INCOMP

public static FemModel.IncompMethod DEFAULT_SOFT_INCOMP

defaultColorMap

public static ColorMapBase defaultColorMap

myProps

public static PropertyList myProps
Constructor Detail

MFreeModel3d

public MFreeModel3d()

MFreeModel3d

public MFreeModel3d(java.lang.String name)
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 FemModel
Returns:
static information for all exported properties

setElementWidgetSize

public void setElementWidgetSize(double size)

getElementWidgetSize

public double getElementWidgetSize()

setElementWidgetSizeMode

public void setElementWidgetSizeMode(PropertyMode mode)

getElementWidgetSizeMode

public PropertyMode getElementWidgetSizeMode()

getCollidables

public void getCollidables(java.util.List<Collidable> list,
                           int level)
Specified by:
getCollidables in interface MechSystemModel

setComputeNodalStress

public void setComputeNodalStress(boolean enable)

setComputeNodalStrain

public void setComputeNodalStrain(boolean enable)

createDefaultColorMap

public static ColorMapBase createDefaultColorMap()

addMaterialBundle

public void addMaterialBundle(MFreeAuxMaterialBundle bundle)

removeMaterialBundle

public boolean removeMaterialBundle(MFreeAuxMaterialBundle bundle)

clearMaterialBundles

public void clearMaterialBundles()

getMaterialBundles

public RenderableComponentList<MFreeAuxMaterialBundle> getMaterialBundles()

getNodeBVTree

public BVTree getNodeBVTree()

getElementBVTree

public BVTree getElementBVTree()

getNodes

public PointList<MFreeNode3d> getNodes()
Specified by:
getNodes in class FemModel

getNode

public MFreeNode3d getNode(int idx)
Specified by:
getNode in class FemModel

getByNumber

public MFreeNode3d getByNumber(int num)
Description copied from class: ComponentList
Get the component with the specified number, or null if there is no such component.

Specified by:
getByNumber in interface ComponentListView<ModelComponent>
Specified by:
getByNumber in interface CompositeComponent
Overrides:
getByNumber in class ComponentList<ModelComponent>
Parameters:
num - number of the component
Returns:
component with specified number

getElementByNumber

public MFreeElement3d getElementByNumber(int num)

getElements

public RenderableComponentList<MFreeElement3d> getElements()
Specified by:
getElements in class FemModel

addNodes

public void addNodes(java.util.List<MFreeNode3d> nodes)

addNode

public void addNode(MFreeNode3d p)

addNumberedNode

public void addNumberedNode(MFreeNode3d p,
                            int number)

removeNode

public boolean removeNode(MFreeNode3d p)

addElements

public void addElements(java.util.List<MFreeElement3d> regionList)

getElement

public MFreeElement3d getElement(int idx)
Specified by:
getElement in class FemModel

addElement

public void addElement(MFreeElement3d e)

addNumberedElement

public void addNumberedElement(MFreeElement3d e,
                               int elemId)

removeElement

public boolean removeElement(MFreeElement3d e)

clearElements

public void clearElements()

getNodeNeighbors

public java.util.LinkedList<FemNodeNeighbor> getNodeNeighbors(FemNode3d node)

updateStressAndStiffness

public void updateStressAndStiffness()

getHardIncompMethod

public FemModel.IncompMethod getHardIncompMethod()

setIncompressible

public void setIncompressible(FemModel.IncompMethod method)

getSoftIncompMethod

public FemModel.IncompMethod getSoftIncompMethod()

setSoftIncompMethod

public void setSoftIncompMethod(FemModel.IncompMethod method)

setMaterial

public void setMaterial(FemMaterial mat)
Overrides:
setMaterial in class FemModel

updateJacobians

public void updateJacobians()

checkInversion

public void checkInversion()

numSurfaceMeshes

public int numSurfaceMeshes()

getMesh

public MeshBase getMesh(int idx)

isCollidable

public boolean isCollidable()
Specified by:
isCollidable in interface Collidable

getMeshes

public java.util.Collection<MeshComponent> getMeshes()

getMeshComponent

public MeshComponent getMeshComponent(int idx)

removeMesh

public boolean removeMesh(MeshBase mesh)

addMesh

public MeshComponent addMesh(MeshBase mesh)

clearMeshes

public void clearMeshes()

getJacobianType

public int getJacobianType()
Description copied from interface: ForceEffector
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.

Specified by:
getJacobianType in interface ForceEffector
Overrides:
getJacobianType in class FemModel
Returns:
solve matrix type resulting from adding Jacobian terms

addVelJacobian

public void addVelJacobian(SparseNumberedBlockMatrix M,
                           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
Parameters:
M - solve matrix to which scaled velocity Jacobian is to be added
s - scaling factor for velocity Jacobian

addPosJacobian

public void addPosJacobian(SparseNumberedBlockMatrix M,
                           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
Parameters:
M - solve matrix to which scaled position Jacobian is to be added
s - scaling factor for position Jacobian

addSolveBlocks

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

Specified by:
addSolveBlocks in interface ForceEffector
Specified by:
addSolveBlocks in class FemModel
Parameters:
S - solve matrix to which blocks should be added

recursivelyInitialize

public void recursivelyInitialize(double t,
                                  int level)
Specified by:
recursivelyInitialize in interface MechSystemModel
Overrides:
recursivelyInitialize in class FemModel

integrate

public double integrate(Function3x1 fun)

integrateVolume

public double integrateVolume()

updateAllRestVolumes

public void updateAllRestVolumes()

updateAllVolumes

public void updateAllVolumes()

integrateMass

public double integrateMass()

computeConsistentMassMatrixEntry

public double computeConsistentMassMatrixEntry(MFreeNode3d node1,
                                               MFreeNode3d node2)

computeConsistentMassMatrix

public SparseMatrixNd computeConsistentMassMatrix()

updateNodeMasses

public void updateNodeMasses(double totalMass,
                             VectorNd massMatrixDiag)

initialize

public void initialize(double t0)
Description copied from class: ModelBase
Causes this model to initialize itself at time t. This method will be called at the very beginning of the simulation (with t = 0), or immediately after the model's state has been reset using HasState.setState(artisynth.core.modelbase.ComponentState), in which case t may have an arbitrary value.

Specified by:
initialize in interface Model
Overrides:
initialize in class MechSystemBase
Parameters:
t0 - initialization time (seconds)

advance

public StepAdjustment advance(double t0,
                              double t1,
                              int flags)
Description copied from class: ModelBase
Advances this object from time t0 to time t1.

If the method determines that the step size should be reduced, it can return a StepAdjustment object indicating the recommended reduction. Otherwise, the method may return null

Specified by:
advance in interface Model
Specified by:
advance in class ModelBase
Parameters:
t0 - current time (seconds)
t1 - new time to advance to (seconds)
flags - reserved for future use
Returns:
null, or a step adjustment recommendation

checkVelocityStability

public DynamicMechComponent checkVelocityStability()
Checks the velocity stability of this system. If the velocity of any component appears to be unstable, return that component. Otherwise, return null.

Specified by:
checkVelocityStability in interface MechSystemModel
Overrides:
checkVelocityStability in class FemModel

getEnergy

public double getEnergy()
Overrides:
getEnergy in class FemModel

setSurfaceRendering

public void setSurfaceRendering(FemModel.SurfaceRender mode)
Overrides:
setSurfaceRendering in class FemModel

render

public void render(GLRenderer renderer,
                   int flags)
Description copied from interface: GLRenderable
Render this object using Open GL via the JOGL.

Specified by:
render in interface GLRenderable
Overrides:
render in class FemModel
Parameters:
renderer - renderer object which is used to perform the rendering. Provides pointers to GL and GLU, along with helper functions.
flags - supplies flags that may be used to control different aspects of the rendering. Flags are defined in GLRenderer and currently include GLRenderer.SELECTED, GLRenderer.VERTEX_COLORING, GLRenderer.HSV_COLOR_INTERPOLATION, GLRenderer.SORT_FACES, and GLRenderer.CLEAR_MESH_DISPLAY_LISTS.

prerender

public void prerender(RenderList list)
Description copied from interface: GLRenderable
Prepare for rendering, and potentially add itself to a list to be drawn by a GLRenderer.

Specified by:
prerender in interface GLRenderable
Overrides:
prerender in class RenderableModelBase

getSelection

public void getSelection(java.util.LinkedList<java.lang.Object> list,
                         int qid)
Description copied from interface: GLSelectable
Append to list the component (or components) associated with the qid-th selection query issued by this component's render method. This will only be called if this component manages its own selection (i.e., the number nums returned by GLSelectable.numSelectionQueriesNeeded() is positive), and qid will in turn be a number between 0 and nums-1.

Specified by:
getSelection in interface GLSelectable
Overrides:
getSelection in class RenderableModelBase
Parameters:
list - selected objects are appended to the end of this list
qid - index of the selection query

invalidateSurfaceMesh

public void invalidateSurfaceMesh()

componentChanged

public void componentChanged(ComponentChangeEvent e)
Description copied from class: ComponentList
Notifies this composite component that a change has occured within one or more of its descendants. When this occurs, the composite may need to invalidate cached information that depends on the descendants.

This method should propagate the notification up the component hierarchy by calling notifyParentOfChange.

Specified by:
componentChanged in interface ComponentChangeListener
Specified by:
componentChanged in interface CompositeComponent
Overrides:
componentChanged in class ComponentList<ModelComponent>
Parameters:
e - optional argument giving specific information about the change

updateSlavePos

public void updateSlavePos()
Description copied from interface: HasSlaveObjects
Called when the system's dynamic position state changes, to update the position state of the slave objects.

Specified by:
updateSlavePos in interface HasSlaveObjects
Overrides:
updateSlavePos in class FemModel

recursivelyFinalizeAdvance

public void recursivelyFinalizeAdvance(StepAdjustment stepAdjust,
                                       double t0,
                                       double t1,
                                       int flags,
                                       int level)
Specified by:
recursivelyFinalizeAdvance in interface MechSystemModel
Overrides:
recursivelyFinalizeAdvance in class MechSystemBase

updateVolume

public double updateVolume()
Overrides:
updateVolume in class FemModel

invalidateStressAndStiffness

public void invalidateStressAndStiffness()
Overrides:
invalidateStressAndStiffness in class FemModel

invalidateRestData

public void invalidateRestData()
Overrides:
invalidateRestData in class FemModel

resetRestPosition

public void resetRestPosition()

updateConstraints

public double updateConstraints(double t,
                                int flags)
Specified by:
updateConstraints in interface Constrainer
Overrides:
updateConstraints in class FemModel

setBilateralImpulses

public int setBilateralImpulses(VectorNd lam,
                                double h,
                                int idx)
Specified by:
setBilateralImpulses in interface Constrainer
Overrides:
setBilateralImpulses in class FemModel

zeroImpulses

public void zeroImpulses()
Specified by:
zeroImpulses in interface Constrainer
Overrides:
zeroImpulses in class FemModel

getBilateralImpulses

public int getBilateralImpulses(VectorNd lam,
                                int idx)
Specified by:
getBilateralImpulses in interface Constrainer
Overrides:
getBilateralImpulses in class FemModel

getBilateralSizes

public void getBilateralSizes(VectorNi sizes)
Specified by:
getBilateralSizes in interface Constrainer
Overrides:
getBilateralSizes in class FemModel

addBilateralConstraints

public int addBilateralConstraints(SparseBlockMatrix GT,
                                   VectorNd dg,
                                   int numb,
                                   IntHolder changeCnt)
Specified by:
addBilateralConstraints in interface Constrainer
Overrides:
addBilateralConstraints in class FemModel

getBilateralInfo

public int getBilateralInfo(MechSystem.ConstraintInfo[] ginfo,
                            int idx)
Specified by:
getBilateralInfo in interface Constrainer
Overrides:
getBilateralInfo in class FemModel

addControls

public static void addControls(ControlPanel controlPanel,
                               FemModel femModel,
                               ModelComponent topModel)

dispose

public void dispose()
Description copied from class: ModelBase
Called when the model is discarded. Disposes of any resources used.

Specified by:
dispose in interface Model
Specified by:
dispose in interface Disposable
Overrides:
dispose in class ModelBase

scaleDistance

public void scaleDistance(double s)
Description copied from interface: ScalableUnits
Scales all distance coordinates.

Specified by:
scaleDistance in interface ScalableUnits
Overrides:
scaleDistance in class FemModel
Parameters:
s - scaling factor

isDuplicatable

public boolean isDuplicatable()
Returns true if this component can be duplicated. Duplication means that we can expect to be able to make a complete copy of the component along with all it's external references. This method should return true if and only if CopyableComponent.getCopyReferences(java.util.List, artisynth.core.modelbase.ModelComponent) returns true.

This method is not currently used. It is intended to provide a faster way of determining if a component can be duplicated, without having to use CopyableComponent.getCopyReferences(java.util.List, artisynth.core.modelbase.ModelComponent) to build the list of copy references.

Specified by:
isDuplicatable in interface CopyableComponent
Returns:
true if this component can be duplicated.

transformGeometry

public void transformGeometry(AffineTransform3dBase X)
Description copied from interface: TransformableGeometry
Applies an affine transformation to the geometry of this object. This method should be equivalent to
 transformGeometry (X, this, 0);
 

Specified by:
transformGeometry in interface TransformableGeometry
Parameters:
X - affine transformation

transformGeometry

public void transformGeometry(AffineTransform3dBase X,
                              TransformableGeometry topObject,
                              int flags)
Description copied from interface: TransformableGeometry
Applies an affine transformation to the geometry of this object. If recursively invoked within a component hierarchy, then topComponent should be the component for which the method was initially invoked. The variable flags provides information about the context in which the transformation is being applied. At present, the available flags are TransformableGeometry.SIMULATING and TransformableGeometry.ARTICULATED.

Specified by:
transformGeometry in interface TransformableGeometry
Parameters:
X - affine transformation
topObject - component on which the method was initially invoked
flags - provides information about the context in which the transformation is being applied.

getCopyReferences

public boolean getCopyReferences(java.util.List<ModelComponent> refs,
                                 ModelComponent ancestor)
Description copied from interface: CopyableComponent
Collects external references which must also be copied in order to duplicate this component. These references should exclude those which are contained within a specified component hierarchy. This method should return true if and only if CopyableComponent.isDuplicatable() returns true.

Specified by:
getCopyReferences in interface CopyableComponent
Parameters:
refs - list to which references are appended
ancestor - root node of the hierarchy from which references are to be excluded
Returns:
false if it is discovered that the component cannot be duplicated

getAuxStateComponents

public void getAuxStateComponents(java.util.List<HasAuxState> comps,
                                  int level)
Specified by:
getAuxStateComponents in interface MechSystemModel

computeShapeMatrix

public void computeShapeMatrix()

updateBounds

public void updateBounds(Point3d pmin,
                         Point3d pmax)
Description copied from interface: GLRenderable
Update the minimum and maximum points for this object. In an x-y-z coordinate system with x directed to the right and y directed upwards, the minimum and maximum points can be thought of as defining the left-lower-far and right-upper-near corners of a bounding cube. This method should only reduce the elements of the minimum point and increase the elements of the maximum point, since it may be used as part of an iteration to determine the bounding cube for several different objects.

Specified by:
updateBounds in interface GLRenderable
Overrides:
updateBounds in class FemModel
Parameters:
pmin - minimum point
pmax - maximum point

getColorMap

public ColorMapBase getColorMap()

setColorMap

public void setColorMap(ColorMapBase colorMap)

getColorMapMode

public PropertyMode getColorMapMode()

setColorMapMode

public void setColorMapMode(PropertyMode mode)

createCollisionData

public CollisionData createCollisionData()
Specified by:
createCollisionData in interface Collidable