public abstract class FemModel extends MechSystemBase implements TransformableGeometry, ScalableUnits, Constrainer, ForceEffector, PropertyChangeListener, HasSlaveObjects
Modifier and Type | Class and Description |
---|---|
static interface |
FemModel.ElementFilter
Interface that determines if an element is valid
|
static class |
FemModel.IncompMethod |
static class |
FemModel.Ranging |
static class |
FemModel.StressStrainMeasure
Specifies a scalar stress/strain measure.
|
static class |
FemModel.SurfaceRender
Specifies how FEM surface meshes should be rendered.
|
MechSystemBase.ConstraintForceStateSaver
ModelComponent.NavpanelVisibility
MechSystem.ConstraintInfo
CompositeComponent.NavpanelDisplay
Modifier and Type | Field and Description |
---|---|
static PropertyList |
myProps |
DEFAULT_STABILIZATION, DEFAULT_USE_IMPLICIT_FRICTION, myParametricsInSystemMatrix, mySaveForcesAsState, useAllDynamicComps
DEFAULT_MAX_STEP_SIZE
DEFAULT_NAVPANEL_DISPLAY
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames
TG_ARTICULATED, TG_DRAGGER, TG_PRESERVE_ORIENTATION, TG_SIMULATING
STATE_IS_VOLATILE
COMPUTE_CONTACTS, UPDATE_CONTACTS
TRANSPARENT, TWO_DIMENSIONAL
Constructor and Description |
---|
FemModel(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
int |
addBilateralConstraints(SparseBlockMatrix GT,
VectorNd dg,
int numb)
Appends the current bilateral force constraint matrix
Gc^T to the
matrix GT , by appending block columns to it. |
int |
addFrictionConstraints(SparseBlockMatrix DT,
java.util.ArrayList<FrictionInfo> finfo,
boolean prune,
int numf)
Appends the friction force constraint matrix
Dc^T to the matrix
DT , by appending block columns to it. |
void |
addMarker(FemMarker mkr) |
boolean |
addMarker(FemMarker mkr,
java.util.Collection<? extends FemNode> nodes) |
void |
addMarker(FemMarker mkr,
java.util.Collection<? extends FemNode> nodes,
VectorNd weights) |
void |
addMarker(FemMarker mkr,
FemElement elem) |
void |
addMarker(FemMarker mkr,
FemElement elem,
int markerId) |
boolean |
addMarker(FemMarker mkr,
FemNode[] nodes) |
void |
addMarker(FemMarker mkr,
FemNode[] nodes,
double[] weights) |
abstract void |
addSolveBlocks(SparseNumberedBlockMatrix M)
Adds any needed blocks to a solve matrix in order to accomodate the
Jacobian terms associated with this force effector.
|
int |
addUnilateralConstraints(SparseBlockMatrix NT,
VectorNd dn,
int numu)
Appends the current unilateral force constraint matrix
Nc^T to the
matrix NT , by appending block columns to it. |
void |
applyForces(double t)
Adds forces to the components affected by this force effector at a
particular time.
|
ComponentList<DynamicAttachmentComp> |
attachments() |
void |
attachPoint(Point p,
FemNode[] nodes,
double[] coords) |
DynamicComponent |
checkVelocityStability()
Checks the velocity stability of this system.
|
void |
clear() |
void |
clearComputeNodalStressStrain()
Cancels the computation of nodal stress, strain and energy density values
for this model.
|
void |
componentChanged(ComponentChangeEvent e)
Notifies this composite component that a change has occured within one or
more of its descendants.
|
FemModel |
copy(int flags,
java.util.Map<ModelComponent,ModelComponent> copyMap) |
static FemMaterial |
createDefaultMaterial() |
void |
detachAllNodes() |
boolean |
detachPoint(Point p) |
boolean |
forcesNeedUpdating() |
abstract java.util.ArrayList<? extends FemElement> |
getAllElements() |
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
void |
getAttachments(java.util.List<DynamicAttachment> list,
int level) |
int |
getBilateralForces(VectorNd lam,
int idx)
Returns the bilateral forces that were most recently set for this
constrainer using
Constrainer.setBilateralForces(maspack.matrix.VectorNd, double, int) . |
int |
getBilateralInfo(MechSystem.ConstraintInfo[] ginfo,
int idx)
Returns constraint information for each row of the bilateral
constraint system
|
void |
getBilateralSizes(VectorNi sizes)
Returns the sizes of each block column in the bilateral force constraint
matrix.
|
double |
getCharacteristicSize() |
void |
getCollidables(java.util.List<Collidable> list) |
boolean |
getComputeNodalEnergyDensity()
Queries whether nodal strain energy densities are computed for this
model.
|
boolean |
getComputeNodalStrain()
Queries whether nodal strains are computed for this model.
|
boolean |
getComputeNodalStress()
Queries whether nodal stresses are computed for this model.
|
boolean |
getComputeStrainEnergy()
Queries whether strain energy is computed for this model.
|
void |
getConstrainedComponents(java.util.List<DynamicComponent> list)
Collected all the dynamic components constrained by this constrainer.
|
void |
getConstrainers(java.util.List<Constrainer> constrainers,
int level) |
double |
getDensity() |
PropertyMode |
getDensityMode() |
void |
getDynamicComponents(java.util.List<DynamicComponent> comps) |
void |
getDynamicComponents(java.util.List<DynamicComponent> active,
java.util.List<DynamicComponent> attached,
java.util.List<DynamicComponent> parametric) |
double |
getEnergy()
Deprecated.
Use
getKineticEnergy() instead. |
void |
getForceEffectors(java.util.List<ForceEffector> forceEffectors,
int level) |
int |
getFrictionForces(VectorNd phi,
int idx)
Returns the friction forces that were most recently set for this
constrainer using
Constrainer.setFrictionForces(maspack.matrix.VectorNd, double, int) . |
int |
getFrictionState(VectorNi state,
int idx) |
Vector3d |
getGravity() |
PropertyMode |
getGravityMode() |
int |
getImplicitIterations() |
double |
getImplicitPrecision() |
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.
|
double |
getKineticEnergy()
Queries the current kinetic energy in this FEM model, assuming lumped
nodal masses.
|
double |
getMass() |
double |
getMassDamping()
Gets the Rayleigh damping coefficient associated with the FEM's mass
|
FemMaterial |
getMaterial() |
abstract FemNode |
getNode(int idx) |
abstract FemNode |
getNodeByNumber(int num) |
double |
getNodeMass() |
abstract PointList<? extends FemNode> |
getNodes() |
int |
getNumInverted() |
double |
getParticleDamping() |
double |
getRestVolume() |
void |
getSlaveObjectComponents(java.util.List<HasSlaveObjects> comps,
int level)
Should be overridden in subclasses to return all the HasSlaveObjects
components within this model.
|
void |
getState(DataBuffer data) |
double |
getStiffnessDamping()
Gets the Rayleigh damping coefficient associated with the FEM's stiffness
|
double |
getStrainEnergy()
Returns the strain energy for this model.
|
DoubleInterval |
getStressPlotRange() |
PropertyMode |
getStressPlotRangeMode() |
FemModel.Ranging |
getStressPlotRanging() |
PropertyMode |
getStressPlotRangingMode() |
FemModel.SurfaceRender |
getSurfaceRendering() |
PropertyMode |
getSurfaceRenderingMode() |
IterativeSolver.ToleranceType |
getToleranceType() |
int |
getUnilateralForces(VectorNd the,
int idx)
Returns the unilateral forces that were most recently set for this
constrainer using
Constrainer.setUnilateralForces(maspack.matrix.VectorNd, double, int) . |
int |
getUnilateralInfo(MechSystem.ConstraintInfo[] ninfo,
int idx)
Returns constraint information for each row of the unilateral
constraint system
|
void |
getUnilateralSizes(VectorNi sizes)
Returns the sizes of each block column in the unilateral force constraint
matrix.
|
int |
getUnilateralState(VectorNi state,
int idx) |
double |
getVolume() |
boolean |
hasState()
Queries if this component has state.
|
void |
invalidateRestData() |
void |
invalidateStressAndStiffness() |
RenderableComponentList<FemMarker> |
markers() |
int |
maxFrictionConstraintSets()
Returns that maximum number of friction constraint set that may be added by
the method
getFrictionConstraints() . |
boolean |
needsNodalStress()
Internal method indicating whether nodal stresses need to be computed
because of either an explicit application request or for mesh rendering.
|
abstract int |
numAllElements() |
int |
numNodes() |
void |
printNodeMasses(int num) |
void |
propertyChanged(PropertyChangeEvent e) |
void |
recursivelyInitialize(double t,
int level) |
boolean |
removeMarker(FemMarker mkr) |
void |
render(Renderer renderer,
int flags)
Render this object using the functionality of the supplied
Renderer . |
void |
resetAutoStressPlotRange() |
void |
scaleDistance(double s)
Scales all distance coordinates.
|
void |
scaleMass(double s)
Scales all mass units.
|
int |
setBilateralForces(VectorNd lam,
double s,
int idx)
Sets the bilateral forces that were computed to enforce this
constraint.
|
void |
setBounds(Point3d pmin,
Point3d pmax) |
void |
setComputeNodalEnergyDensity(boolean enable)
Sets whether nodal strain energy densities are computed for this
model.
|
void |
setComputeNodalStrain(boolean enable)
Sets whether nodal strains are computed for this model.
|
void |
setComputeNodalStress(boolean enable)
Sets whether nodal stresses are computed for this model.
|
void |
setComputeNodalStressStrain(FemModel.StressStrainMeasure m)
Explicitly enables the collection of nodal stress, strain or energy
density values for this model, as required for the specified
stress/strain measure.
|
void |
setComputeStrainEnergy(boolean enable)
Sets whether strain energy is computed for this model.
|
void |
setDensity(double p) |
void |
setDensityMode(PropertyMode mode) |
int |
setFrictionForces(VectorNd phi,
double s,
int idx)
Sets the friction forces that were computed to enforce this
constraint.
|
int |
setFrictionState(VectorNi state,
int idx) |
void |
setGravity(double gx,
double gy,
double gz) |
void |
setGravity(Vector3d g) |
void |
setGravityMode(PropertyMode mode) |
void |
setImplicitIterations(int max) |
void |
setImplicitPrecision(double prec) |
void |
setLinearMaterial(double E,
double nu,
boolean corotated) |
void |
setMassDamping(double d)
Sets the Rayleigh damping coefficient associated with the FEM's mass
|
<T extends FemMaterial> |
setMaterial(T mat) |
void |
setMaxStepSize(double sec)
Sets the maximum step size by which this model should be advanced within a
simulation loop.
|
void |
setParticleDamping(double d) |
void |
setState(DataBuffer data) |
void |
setStiffnessDamping(double d)
Sets the Rayleigh damping coefficient associated with the FEM's stiffness
|
void |
setStressPlotRange(DoubleInterval range) |
void |
setStressPlotRangeMode(PropertyMode mode) |
void |
setStressPlotRanging(FemModel.Ranging ranging) |
void |
setStressPlotRangingMode(PropertyMode mode) |
void |
setSurfaceRendering(FemModel.SurfaceRender rendering) |
void |
setSurfaceRenderingMode(PropertyMode mode) |
void |
setToleranceType(IterativeSolver.ToleranceType type) |
int |
setUnilateralForces(VectorNd the,
double s,
int idx)
Sets the unilateral forces that were computed to enforce this
constraint.
|
int |
setUnilateralState(VectorNi state,
int idx) |
void |
updateBounds(Vector3d pmin,
Vector3d pmax)
Update the minimum and maximum points for this object.
|
double |
updateConstraints(double t,
int flags)
Updates the current set of constraints, and returns the maximum
penetration
> 0 associated with all of them. |
double |
updateRestVolume() |
void |
updateSlavePos()
Called when the system's dynamic position state changes, to update the
position state of the slave objects.
|
void |
updateSlaveVel()
Called when the system's dynamic velocity state changes, to update the
velocity state of the slave objects.
|
double |
updateVolume() |
void |
zeroExternalForces() |
void |
zeroForces()
Zeros all bilateral and unilateral constraint forces in this constraint.
|
addActivePosImpulse, addAttachmentJacobian, addAttachmentSolveBlocks, addGeneralMassBlocks, addGeneralSolveBlocks, addPosJacobian, addVelJacobian, advance, advanceAuxState, applyAttachmentForces, buildMassMatrix, buildSolveMatrix, closePrintStateFile, collectInitialForces, createState, createVelocityJacobian, getActiveDampingMatrix, getActiveDynamicComponents, getActiveForces, getActiveMass, getActiveMassMatrix, getActivePosDerivative, getActivePosState, getActivePosStateSize, getActiveStiffnessMatrix, getActiveVelState, getActiveVelState, getActiveVelStateSize, getAttachmentConstraints, getAttachmentDerivatives, getAuxAdvanceState, getAuxVarDerivative, getAuxVarState, getAuxVarStateSize, getBilateralConstraints, getBilateralConstraintSizes, getBilateralForces, getBilateralInfo, getDefaultMatrixSolver, getDefaultStabilization, getDefaultUseImplicitFriction, getDynamicComponents, getDynamicDOFs, getDynamicsEnabled, getForces, getFrictionConstraints, getFrictionForces, getFrictionState, getInitialState, getIntegrator, getInverseMassMatrix, getMassMatrix, getMatrixSolver, getMatrixSolverRange, getNumBilateralForces, getNumUnilateralForces, getParametricForces, getParametricPosState, getParametricPosStateSize, getParametricPosTarget, getParametricVelState, getParametricVelStateSize, getParametricVelTarget, getPenetrationLimit, getPrintState, getProfiling, getSolveMatrixType, getSolver, getStabilization, getState, getStructureVersion, getUnilateralConstraints, getUnilateralConstraintSizes, getUnilateralForces, getUnilateralInfo, getUnilateralState, getUpdateForcesAtStepEnd, getUpdateForcesAtStepEndMode, getUseImplicitFriction, initialize, isBilateralStructureConstant, numActiveComponents, numAttachedComponents, numParametricComponents, openPrintStateFile, placeDynamicComponent, preadvance, printActiveMass, printActiveMass, printActiveStiffness, printActiveStiffness, recursivelyFinalizeAdvance, recursivelyPrepareAdvance, reduceVelocityJacobian, reopenPrintStateFile, setActiveForces, setActivePosState, setActiveVelState, setAuxAdvanceState, setAuxVarState, setBilateralForces, setDefaultMatrixSolver, setDefaultStabilization, setDefaultUseImplicitFriction, setDynamicsEnabled, setForces, setFrictionForces, setFrictionState, setIntegrator, setMatrixSolver, setParametricForces, setParametricPosState, setParametricVelState, setPenetrationLimit, setPrintState, setPrintState, setProfiling, setStabilization, setState, setUnilateralForces, setUnilateralState, setUpdateForcesAtStepEnd, setUpdateForcesAtStepEndMode, setUseImplicitFriction, topMechSystem, updateAttachmentPos, updateAttachmentVel, updateConstraints, updateForces, updatePosState, updateVelState, writeBilateralConstraintMatrix, writeBilateralConstraintMatrix, writeMassMatrix, writeMassMatrix, writePrintStateHeader, writeStiffnessMatrix, writeStiffnessMatrix
createRenderProps, getRenderHints, getRenderProps, getSelection, isSelectable, numSelectionQueriesNeeded, prerender, setRenderProps
actionPerformed, copy, dispose, getDefaultMaxStepSize, getMaxStepSize, getMenuItems, hasParameterizedType, hierarchyContainsReferences, setDefaultMaxStepSize
add, add, addAll, addComponents, addFixed, addNumbered, clone, contains, contains, containsAll, ensureCapacity, findComponent, get, get, getByNumber, getChildren, getNavpanelDisplay, getNumberLimit, getOneBasedNumbering, getParameterType, getShortName, hasChildren, indexOf, invalidateNumbers, isEditable, isEmpty, iterator, nextComponentNumber, numComponents, postscan, remove, remove, removeAll, removeAll, removeComponents, resetNumbersToIndices, retainAll, scan, set, setEditable, setNavpanelDisplay, setNumbered, setOneBasedNumbering, setShortName, size, toArray, toArray, updateNameMap
checkFlag, checkName, checkNameUniqueness, clearFlag, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addTransformableDependencies, transformGeometry, transformGeometry, transformPriority
addPosJacobian, addVelJacobian
getAuxStateComponents, getCollidables, getMassMatrixValues, mulInverseMass
dispose, getMaxStepSize
connectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, getSoftReferences, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritable, updateReferences
getProperty
getChildren, hasChildren
postscan
isWritable, write
getName
public static PropertyList myProps
public PropertyList getAllPropertyInfo()
HasProperties
getAllPropertyInfo
in interface HasProperties
getAllPropertyInfo
in class RenderableModelBase
public static FemMaterial createDefaultMaterial()
public FemMaterial getMaterial()
public <T extends FemMaterial> void setMaterial(T mat)
public void setLinearMaterial(double E, double nu, boolean corotated)
public void setSurfaceRendering(FemModel.SurfaceRender rendering)
public FemModel.SurfaceRender getSurfaceRendering()
public void setSurfaceRenderingMode(PropertyMode mode)
public PropertyMode getSurfaceRenderingMode()
public void setStressPlotRanging(FemModel.Ranging ranging)
public FemModel.Ranging getStressPlotRanging()
public void setStressPlotRangingMode(PropertyMode mode)
public PropertyMode getStressPlotRangingMode()
public void setStressPlotRange(DoubleInterval range)
public void resetAutoStressPlotRange()
public DoubleInterval getStressPlotRange()
public void setStressPlotRangeMode(PropertyMode mode)
public PropertyMode getStressPlotRangeMode()
public void invalidateStressAndStiffness()
public void invalidateRestData()
public Vector3d getGravity()
public void setGravity(Vector3d g)
public void setGravity(double gx, double gy, double gz)
public PropertyMode getGravityMode()
public void setGravityMode(PropertyMode mode)
public void setParticleDamping(double d)
public double getParticleDamping()
public void setMassDamping(double d)
d
- new mass dampingpublic double getMassDamping()
public void setStiffnessDamping(double d)
d
- new stiffness dampingpublic double getStiffnessDamping()
public void setDensity(double p)
public double getDensity()
public void setDensityMode(PropertyMode mode)
public PropertyMode getDensityMode()
public int numNodes()
public abstract FemNode getNode(int idx)
public abstract FemNode getNodeByNumber(int num)
public abstract java.util.ArrayList<? extends FemElement> getAllElements()
public abstract int numAllElements()
public void addMarker(FemMarker mkr)
public void addMarker(FemMarker mkr, FemElement elem)
public void addMarker(FemMarker mkr, FemElement elem, int markerId)
public void addMarker(FemMarker mkr, java.util.Collection<? extends FemNode> nodes, VectorNd weights)
public boolean removeMarker(FemMarker mkr)
public RenderableComponentList<FemMarker> markers()
public ComponentList<DynamicAttachmentComp> attachments()
public boolean detachPoint(Point p)
public void detachAllNodes()
public void clear()
clear
in interface java.util.Collection<ModelComponent>
clear
in class ComponentList<ModelComponent>
public void componentChanged(ComponentChangeEvent e)
ComponentList
This method should propagate the notification up the component hierarchy
by calling notifyParentOfChange
.
componentChanged
in interface ComponentChangeListener
componentChanged
in interface CompositeComponent
componentChanged
in class ComponentList<ModelComponent>
e
- optional argument giving specific information about the changepublic void getState(DataBuffer data)
public void setState(DataBuffer data)
public void zeroExternalForces()
public boolean forcesNeedUpdating()
public void applyForces(double t)
ForceEffector
applyForces
in interface ForceEffector
t
- time (seconds)public void updateBounds(Vector3d pmin, Vector3d pmax)
IsRenderable
updateBounds
in interface IsRenderable
updateBounds
in class RenderableModelBase
pmin
- minimum pointpmax
- maximum pointpublic void render(Renderer renderer, int flags)
IsRenderable
Renderer
.render
in interface IsRenderable
render
in class RenderableModelBase
renderer
- provides the functionality used to perform the rendering.flags
- flags that may be used to control different
aspects of the rendering. Flags are defined in Renderer
and currently include
Renderer.HIGHLIGHT
and
Renderer.SORT_FACES
.public void getAttachments(java.util.List<DynamicAttachment> list, int level)
getAttachments
in interface MechSystemModel
public boolean hasState()
hasState
in interface ModelComponent
hasState
in class ModelComponentBase
true
if this component has statepublic int getImplicitIterations()
public void setImplicitIterations(int max)
public IterativeSolver.ToleranceType getToleranceType()
public void setToleranceType(IterativeSolver.ToleranceType type)
public void scaleDistance(double s)
ScalableUnits
scaleDistance
in interface ScalableUnits
s
- scaling factorpublic double getMass()
public double getNodeMass()
public void printNodeMasses(int num)
public double getEnergy()
getKineticEnergy()
instead.public double getKineticEnergy()
public double getStrainEnergy()
getComputeStrainEnergy()
returns true
; otherwise,
zero is returned.public boolean getComputeNodalStress()
true
if nodal stresses are computedpublic void setComputeNodalStress(boolean enable)
false
to avoid unnecessary computation.enable
- if true
, enables nodal stress computationpublic boolean getComputeNodalStrain()
true
if nodal strains are computedpublic void setComputeNodalStrain(boolean enable)
false
to avoid unnecessary computation.enable
- if true
, enables nodal strain computationpublic boolean getComputeNodalEnergyDensity()
true
if nodal energy densities are computedpublic void setComputeNodalEnergyDensity(boolean enable)
false
to avoid unnecessary
computation.enable
- if true
, enables nodal energy density computationpublic boolean needsNodalStress()
public void setComputeNodalStressStrain(FemModel.StressStrainMeasure m)
m
- measure indicating whether stress, strain or energy density
values are neededpublic void clearComputeNodalStressStrain()
public boolean getComputeStrainEnergy()
true
if strain energy is computedpublic void setComputeStrainEnergy(boolean enable)
false
to avoid unnecessary computation.enable
- if true
, enables strain energy computationpublic void scaleMass(double s)
ScalableUnits
scaleMass
in interface ScalableUnits
s
- scaling factorpublic void getCollidables(java.util.List<Collidable> list)
public void getDynamicComponents(java.util.List<DynamicComponent> active, java.util.List<DynamicComponent> attached, java.util.List<DynamicComponent> parametric)
getDynamicComponents
in interface MechSystemModel
public void getDynamicComponents(java.util.List<DynamicComponent> comps)
getDynamicComponents
in interface MechSystemModel
public void getConstrainers(java.util.List<Constrainer> constrainers, int level)
getConstrainers
in interface MechSystemModel
public void getForceEffectors(java.util.List<ForceEffector> forceEffectors, int level)
getForceEffectors
in interface MechSystemModel
public void getSlaveObjectComponents(java.util.List<HasSlaveObjects> comps, int level)
getSlaveObjectComponents
in interface MechSystemModel
getSlaveObjectComponents
in class MechSystemBase
comps
- HasSlaveObjects components should be added to this listpublic void updateSlavePos()
HasSlaveObjects
updateSlavePos
in interface HasSlaveObjects
public void updateSlaveVel()
HasSlaveObjects
updateSlaveVel
in interface HasSlaveObjects
public void setMaxStepSize(double sec)
setMaxStepSize
in class ModelBase
sec
- maximum step size (seconds)public double updateVolume()
public double getRestVolume()
public double updateRestVolume()
public double getVolume()
public int getNumInverted()
public double getImplicitPrecision()
public void setImplicitPrecision(double prec)
public void getBilateralSizes(VectorNi sizes)
Constrainer
sizes
.getBilateralSizes
in interface Constrainer
sizes
- vector to which the block column sizes are appendedpublic int addBilateralConstraints(SparseBlockMatrix GT, VectorNd dg, int numb)
Constrainer
Gc^T
to the
matrix GT
, by appending block columns to it. If the argument
dg
is non-null
, it should be used to return the
velocity constraint time derivative, defined by
\dot Gc velstarting at the location
numb
. In all cases, the method must
return an updated value of numb
, incremented by the total row
size of Gc
.addBilateralConstraints
in interface Constrainer
GT
- matrix to which the bilateral force contraint matrix
is appended.dg
- if non-null
, returns the velocity constraint time
derivativenumb
- starting index for time derivative in dg
numb
public int getBilateralInfo(MechSystem.ConstraintInfo[] ginfo, int idx)
Constrainer
Gc vel = 0.This information is placed in pre-allocated
MechSystem.ConstraintInfo
structures in ginfo
, starting at idx
. The method must
return an updated value of idx
, incremented by the number of
rows of Gc
.
The constraint information to be set in ConstraintInfo
includes:
dist // distance to the constraint surface. compliance // if > 0, gives constraint compliance value damping // damping; only used if compliance > 0 force // used for computing non-linear compliance
getBilateralInfo
in interface Constrainer
ginfo
- returns the constraint informationidx
- starting location in ginfo
for returning constraint
infoidx
public void getUnilateralSizes(VectorNi sizes)
Constrainer
sizes
.getUnilateralSizes
in interface Constrainer
sizes
- vector to which the block column sizes are appendedpublic int addUnilateralConstraints(SparseBlockMatrix NT, VectorNd dn, int numu)
Constrainer
Nc^T
to the
matrix NT
, by appending block columns to it. If the argument
dn
is non-null
, it should be used to return the
velocity constraint time derivative, defined by
\dot Nc velstarting at the location
numu
. In all cases, the method must
return an updated value of numu
, incremented by the total row
size of Nc
.addUnilateralConstraints
in interface Constrainer
NT
- matrix to which the unilateral force contraint matrix
is appended.dn
- if non-null
, returns the velocity constraint time
derivativenumu
- starting index for time derivative in dn
numu
public int getUnilateralInfo(MechSystem.ConstraintInfo[] ninfo, int idx)
Constrainer
Nc vel > 0.This information is placed in pre-allocated
MechSystem.ConstraintInfo
structures in ninfo
, starting at idx
. The method must
return an updated value of idx
, incremented by the number of
rows of Nc
.
The constraint information to be set in ConstraintInfo
includes:
dist // distance to the constraint surface. compliance // if > 0, gives constraint compliance value damping // damping; only used if compliance > 0 force // used for computing non-linear compliance
getUnilateralInfo
in interface Constrainer
ninfo
- returns the constraint informationidx
- starting location in ninfo
for returning constraint
infoidx
public int maxFrictionConstraintSets()
MechSystem
getFrictionConstraints()
.
This is used to size the finfo
array supplied to that
method.maxFrictionConstraintSets
in interface Constrainer
maxFrictionConstraintSets
in interface MechSystem
maxFrictionConstraintSets
in class MechSystemBase
public int addFrictionConstraints(SparseBlockMatrix DT, java.util.ArrayList<FrictionInfo> finfo, boolean prune, int numf)
Constrainer
Dc^T
to the matrix
DT
, by appending block columns to it. Each block column in Dc^T
corresponds to a friction constraint set, for which
information should be supplied in the pre-allocated FrictionInfo
structures in finfo
, starting at idx
. The method must
return an updated value of idx
, incremented by the number of
friction constraint sets.addFrictionConstraints
in interface Constrainer
DT
- matrix to which the friction force contraint matrix
is appended.finfo
- returns friction constraint information for each
block column in Dc^T
prune
- restrict entries of DT to friction constraints
for which the contact force is > 0
.numf
- starting index for friction information in finfo
idx
public int setBilateralForces(VectorNd lam, double s, int idx)
Constrainer
lam
, starting at the index idx
, and should be
scaled by s
. (In practice, s
is used to convert from
impulses to forces.) The method must return an updated value of idx
, incremented by the number of forces associated with this constraint.setBilateralForces
in interface Constrainer
setBilateralForces
in class MechSystemBase
lam
- supplies the force impulses, which should be scaled by s
s
- scaling factor for the force valuesidx
- starting index of forces in lam
idx
public void zeroForces()
Constrainer
zeroForces
in interface Constrainer
public int getBilateralForces(VectorNd lam, int idx)
Constrainer
Constrainer.setBilateralForces(maspack.matrix.VectorNd, double, int)
. The forces are returned in
lam
, starting at the index idx
. The method must return
an updated value of idx
, incremented by the number of forces
associated with this constraint.getBilateralForces
in interface Constrainer
getBilateralForces
in class MechSystemBase
lam
- returns the forcesidx
- starting index for forces in lam
idx
public int setUnilateralForces(VectorNd the, double s, int idx)
Constrainer
the
, starting at the index idx
, and should be
scaled by s
. (In practice, s
is used to convert from
impulses to forces.) The method must return an updated value of idx
, incremented by the number of forces associated with this constraint.setUnilateralForces
in interface Constrainer
setUnilateralForces
in class MechSystemBase
the
- supplies the force impulses, which should be scaled by s
s
- scaling factor for the force valuesidx
- starting index of forces in the
idx
public int getUnilateralForces(VectorNd the, int idx)
Constrainer
Constrainer.setUnilateralForces(maspack.matrix.VectorNd, double, int)
. The forces are returned in
the
, starting at the index idx
. The method must return
an updated value of idx
, incremented by the number of forces
associated with this constraint.getUnilateralForces
in interface Constrainer
getUnilateralForces
in class MechSystemBase
the
- returns the forcesidx
- starting index for forces in the
idx
public int setUnilateralState(VectorNi state, int idx)
setUnilateralState
in interface Constrainer
setUnilateralState
in interface MechSystem
setUnilateralState
in class MechSystemBase
public int getUnilateralState(VectorNi state, int idx)
getUnilateralState
in interface Constrainer
getUnilateralState
in interface MechSystem
getUnilateralState
in class MechSystemBase
public int setFrictionForces(VectorNd phi, double s, int idx)
phi
, starting at the index idx
, and should be
scaled by s
. (In practice, s
is used to convert from
impulses to forces.) The method must return an updated value of idx
, incremented by the number of forces associated with this constraint.setFrictionForces
in interface Constrainer
setFrictionForces
in class MechSystemBase
phi
- supplies the force impulses, which should be scaled by s
s
- scaling factor for the force valuesidx
- starting index of forces in phi
idx
public int getFrictionForces(VectorNd phi, int idx)
Constrainer.setFrictionForces(maspack.matrix.VectorNd, double, int)
. The forces are returned in
phi
, starting at the index idx
. The method must return
an updated value of idx
, incremented by the number of forces
associated with this constraint.getFrictionForces
in interface Constrainer
getFrictionForces
in class MechSystemBase
phi
- returns the forcesidx
- starting index for forces in phi
idx
public int setFrictionState(VectorNi state, int idx)
setFrictionState
in interface Constrainer
setFrictionState
in interface MechSystem
setFrictionState
in class MechSystemBase
public int getFrictionState(VectorNi state, int idx)
getFrictionState
in interface Constrainer
getFrictionState
in interface MechSystem
getFrictionState
in class MechSystemBase
public void recursivelyInitialize(double t, int level)
recursivelyInitialize
in interface MechSystemModel
recursivelyInitialize
in class MechSystemBase
public double getCharacteristicSize()
public DynamicComponent checkVelocityStability()
checkVelocityStability
in interface MechSystemModel
null
if there is no instabilitypublic FemModel copy(int flags, java.util.Map<ModelComponent,ModelComponent> copyMap)
copy
in class MechSystemBase
public void propertyChanged(PropertyChangeEvent e)
propertyChanged
in interface PropertyChangeListener
public double updateConstraints(double t, int flags)
Constrainer
>
0 associated with all of them. If no constraints are
presently active, returns -1.updateConstraints
in interface Constrainer
public void getConstrainedComponents(java.util.List<DynamicComponent> list)
Constrainer
getConstrainedComponents
in interface Constrainer
list
- list to which constrained components should be appendedpublic int getJacobianType()
ForceEffector
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.getJacobianType
in interface ForceEffector
public abstract void addSolveBlocks(SparseNumberedBlockMatrix M)
ForceEffector
getSolveIndex
) for all dynamic or attached components affected by this
force effector.addSolveBlocks
in interface ForceEffector
M
- solve matrix to which blocks should be added