public abstract class ParticleConstraintBase extends RenderableConstrainerBase implements ScalableUnits
ModelComponent.FilePathSaveType, ModelComponent.NavpanelVisibility| Modifier and Type | Field and Description |
|---|---|
static PropertyList |
myProps |
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNamesTRANSPARENT, TWO_DIMENSIONAL| Constructor and Description |
|---|
ParticleConstraintBase() |
| 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. |
void |
addParticle(Particle p) |
void |
addParticles(java.util.Collection<? extends Particle> parts) |
int |
addUnilateralConstraints(SparseBlockMatrix NT,
VectorNd dg,
int numu)
Appends the current unilateral force constraint matrix
Nc^T to the
matrix NT, by appending block columns to it. |
PropertyList |
getAllPropertyInfo()
Returns a list giving static information about all properties exported by
this object.
|
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 |
getCompliance() |
void |
getConstrainedComponents(java.util.HashSet<DynamicComponent> comps)
Collected all the dynamic components constrained by this constrainer.
|
double |
getDamping() |
Particle |
getParticle(int idx) |
double |
getPenetrationTol() |
void |
getSoftReferences(java.util.List<ModelComponent> refs)
Appends all soft references for this component to a list.
|
void |
getState(DataBuffer data)
Saves state information for this component by adding data to the
supplied DataBuffer.
|
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.
|
boolean |
isEngaged(int idx) |
boolean |
isUnilateral() |
int |
numParticles() |
boolean |
removeParticle(Particle p) |
int |
setBilateralForces(VectorNd lam,
double s,
int idx)
Sets the bilateral forces that were computed to enforce this
constraint.
|
void |
setCompliance(double c) |
void |
setDamping(double d) |
void |
setPenetrationTol(double tol) |
void |
setState(DataBuffer data)
Restores the state for this component by reading from the supplied
data buffer, starting at the current buffer offsets.
|
void |
setUnilateral(boolean unilateral) |
int |
setUnilateralForces(VectorNd the,
double s,
int idx)
Sets the unilateral forces that were computed to enforce this
constraint.
|
void |
updateReferences(boolean undo,
java.util.Deque<java.lang.Object> undoInfo)
May be called by the system if any of the soft references for
this component are removed from the the component hierarchy.
|
void |
zeroForces()
Zeros all bilateral and unilateral constraint forces in this constraint.
|
copy, createRenderProps, defaultRenderPropsAreNull, getRenderHints, getRenderProps, getSelection, isSelectable, numSelectionQueriesNeeded, prerender, render, setRenderProps, updateBoundsaddFrictionConstraints, getFrictionForces, getFrictionState, getUnilateralState, hasState, maxFrictionConstraintSets, setFrictionForces, setFrictionState, setUnilateralState, updateConstraintscheckFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, hasChildren, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, writeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitscaleDistance, scaleMassconnectToHierarchy, disconnectFromHierarchy, getHardReferences, getName, getNavpanelVisibility, getNumber, getParent, hasState, isFixed, isMarked, isSelected, notifyParentOfChange, scan, setFixed, setMarked, setName, setNumber, setParent, setSelected, setWritablegetPropertygetChildren, hasChildrenpostscanisWritable, writeadvanceState, getAuxVarDerivative, getAuxVarState, getStateVersion, numAuxVars, requiresAdvance, setAuxVarStatepublic static PropertyList myProps
public PropertyList getAllPropertyInfo()
HasPropertiesgetAllPropertyInfo in interface HasPropertiesgetAllPropertyInfo in class RenderableConstrainerBasepublic double getDamping()
public void setDamping(double d)
public double getCompliance()
public void setCompliance(double c)
public double getPenetrationTol()
public void setPenetrationTol(double tol)
public boolean isUnilateral()
public void setUnilateral(boolean unilateral)
public void addParticle(Particle p)
public void addParticles(java.util.Collection<? extends Particle> parts)
public Particle getParticle(int idx)
public int numParticles()
public boolean removeParticle(Particle p)
public void getBilateralSizes(VectorNi sizes)
Constrainersizes.getBilateralSizes in interface ConstrainergetBilateralSizes in class ConstrainerBasesizes - vector to which the block column sizes are appendedpublic int addBilateralConstraints(SparseBlockMatrix GT, VectorNd dg, int numb)
ConstrainerGc^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 ConstraineraddBilateralConstraints in class ConstrainerBaseGT - 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 dgnumbpublic int getBilateralInfo(MechSystem.ConstraintInfo[] ginfo, int idx)
ConstrainerGc 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 ConstrainergetBilateralInfo in class ConstrainerBaseginfo - returns the constraint informationidx - starting location in ginfo for returning constraint
infoidxpublic int setBilateralForces(VectorNd lam, double s, int idx)
Constrainerlam, 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 ConstrainersetBilateralForces in class ConstrainerBaselam - supplies the force impulses, which should be scaled by ss - scaling factor for the force valuesidx - starting index of forces in lamidxpublic int getBilateralForces(VectorNd lam, int idx)
ConstrainerConstrainer.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 ConstrainergetBilateralForces in class ConstrainerBaselam - returns the forcesidx - starting index for forces in lamidxpublic void getUnilateralSizes(VectorNi sizes)
Constrainersizes.getUnilateralSizes in interface ConstrainergetUnilateralSizes in class ConstrainerBasesizes - vector to which the block column sizes are appendedpublic int addUnilateralConstraints(SparseBlockMatrix NT, VectorNd dg, int numu)
ConstrainerNc^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 ConstraineraddUnilateralConstraints in class ConstrainerBaseNT - matrix to which the unilateral force contraint matrix
is appended.dg - if non-null, returns the velocity constraint time
derivativenumu - starting index for time derivative in dnnumupublic int getUnilateralInfo(MechSystem.ConstraintInfo[] ninfo, int idx)
ConstrainerNc 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 ConstrainergetUnilateralInfo in class ConstrainerBaseninfo - returns the constraint informationidx - starting location in ninfo for returning constraint
infoidxpublic int setUnilateralForces(VectorNd the, double s, int idx)
Constrainerthe, 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 ConstrainersetUnilateralForces in class ConstrainerBasethe - supplies the force impulses, which should be scaled by ss - scaling factor for the force valuesidx - starting index of forces in theidxpublic int getUnilateralForces(VectorNd the, int idx)
ConstrainerConstrainer.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 ConstrainergetUnilateralForces in class ConstrainerBasethe - returns the forcesidx - starting index for forces in theidxpublic void zeroForces()
ConstrainerzeroForces in interface ConstrainerzeroForces in class ConstrainerBasepublic boolean isEngaged(int idx)
public void getConstrainedComponents(java.util.HashSet<DynamicComponent> comps)
ConstrainergetConstrainedComponents in interface ConstrainergetConstrainedComponents in class ConstrainerBasecomps - set to which constrained components should be addedpublic void getSoftReferences(java.util.List<ModelComponent> refs)
ModelComponentBaseupdateReferences() method will
be called to update its internal reference information.getSoftReferences in interface ModelComponentgetSoftReferences in class ModelComponentBaserefs - list to which soft references are appendedpublic void updateReferences(boolean undo,
java.util.Deque<java.lang.Object> undoInfo)
ModelComponentBaseundo equal to false,
this component should then examine its soft references and
use ComponentUtils.areConnected()
to determine which of them have been disconnected from the hierarchy.
Disconnected references should be removed, and sufficient information
should be appended to undoInfo to allow this update
to be undone if this method is called later with undo
equal to true. When undoing an update, the undo
information should be removed from the front of undoInfo.updateReferences in interface ModelComponentupdateReferences in class ModelComponentBaseundo - if true, indicates that the most
recent reference update should be undone, using the supplied
undo information.undoInfo - if undo is false, should be used
to store information allowing the reference update to be undone.
Otherwise, if undo is true, then this
supplied information to undo the most recent update.public void getState(DataBuffer data)
HasNumericStategetState in interface HasNumericStategetState in class ConstrainerBasedata - buffer for storing the state values.public void setState(DataBuffer data)
HasNumericStatesetState in interface HasNumericStatesetState in class ConstrainerBasedata - buffer containing the state information