public class LinearPointConstraint extends ConstrainerBase
ModelComponent.FilePathSaveType, ModelComponent.NavpanelVisibility| Modifier and Type | Field and Description |
|---|---|
static double |
DEFAULT_COMPLIANCE |
static double |
DEFAULT_DAMPING |
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, NULL_OBJ, useCompactPathNames| Constructor and Description |
|---|
LinearPointConstraint()
General constructor.
|
LinearPointConstraint(Point[] pnts,
double[] wgts)
General constructor
|
LinearPointConstraint(Point[] pnts,
double[] wgts,
Point3d target)
General constructor
|
LinearPointConstraint(Point[] pnts,
VectorNd wgts,
Point3d target)
General constructor
|
| 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. |
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() |
Point[] |
getPoints() |
Point3d |
getTarget() |
double[] |
getWeights() |
void |
scan(ReaderTokenizer rtok,
java.lang.Object ref)
Scans this element from a ReaderTokenizer.
|
boolean |
scanItem(ReaderTokenizer rtok,
java.util.Deque<ScanToken> tokens) |
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 |
setTarget(Point3d pos)
Sets a target sum of positions
|
double |
updateConstraints(double t,
int flags)
Updates the current set of constraints, and returns the maximum
penetration
> 0 associated with all of them. |
void |
zeroForces()
Zeros all bilateral and unilateral constraint forces in this constraint.
|
addFrictionConstraints, addUnilateralConstraints, getFrictionForces, getFrictionState, getState, getUnilateralForces, getUnilateralInfo, getUnilateralSizes, getUnilateralState, hasState, maxFrictionConstraintSets, setFrictionForces, setFrictionState, setState, setUnilateralForces, setUnilateralStatecheckFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, copy, createTempFlag, disconnectFromHierarchy, getChildren, getGrandParent, getHardReferences, getName, getNameRange, getNavpanelVisibility, getNavpanelVisibility, getNumber, getParent, getProperty, getSoftReferences, hasChildren, isFixed, isMarked, isScanning, isSelected, isWritable, makeValidName, makeValidName, notifyParentOfChange, postscan, printReferences, recursivelyContained, recursivelyContains, removeTempFlag, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, writeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitadvanceState, getAuxVarDerivative, getAuxVarState, getStateVersion, numAuxVars, requiresAdvance, setAuxVarStatepublic static double DEFAULT_COMPLIANCE
public static double DEFAULT_DAMPING
public LinearPointConstraint()
setPoints(Point[], double[]).public LinearPointConstraint(Point[] pnts, double[] wgts)
pnts - list of points to constrainwgts - list of weightspublic LinearPointConstraint(Point[] pnts, double[] wgts, Point3d target)
pnts - list of points to constrainwgts - list of weightstarget - target sumpublic PropertyList getAllPropertyInfo()
HasPropertiesgetAllPropertyInfo in interface HasPropertiesgetAllPropertyInfo in class ModelComponentBasepublic void setTarget(Point3d pos)
pos - target positionpublic Point[] getPoints()
public double[] getWeights()
public Point3d getTarget()
public double getCompliance()
public void setCompliance(double c)
public double getDamping()
public void setDamping(double d)
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 zeroForces()
ConstrainerzeroForces in interface ConstrainerzeroForces in class ConstrainerBasepublic double updateConstraints(double t,
int flags)
Constrainer> 0 associated with all of them. If no constraints are
presently active, returns -1.updateConstraints in interface ConstrainerupdateConstraints in class ConstrainerBasepublic void getConstrainedComponents(java.util.HashSet<DynamicComponent> comps)
ConstrainergetConstrainedComponents in interface ConstrainergetConstrainedComponents in class ConstrainerBasecomps - set to which constrained components should be addedpublic void scan(ReaderTokenizer rtok, java.lang.Object ref) throws java.io.IOException
ModelComponentBasewrite.scan in interface ModelComponentscan in interface Scannablescan in class ModelComponentBasertok - Tokenizer from which to scan the elementref - optional reference object which can be used for resolving references to
other objectsjava.io.IOException - if an I/O or formatting error occuredpublic boolean scanItem(ReaderTokenizer rtok, java.util.Deque<ScanToken> tokens) throws java.io.IOException
java.io.IOException