public class JointCoordinateCoupling extends ConstrainerBase implements BodyConstrainer
ModelComponent.FilePathSaveType, ModelComponent.NavpanelVisibility
enforceUniqueCompositeNames, enforceUniqueNames, myNumber, myProps, NULL_OBJ, useCompactPathNames
Constructor and Description |
---|
JointCoordinateCoupling() |
JointCoordinateCoupling(java.util.List<JointCoordinateHandle> coords,
Diff1FunctionNx1 fxn) |
JointCoordinateCoupling(java.lang.String name,
java.util.List<JointCoordinateHandle> coords,
Diff1FunctionNx1 fxn) |
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 |
addBilateralConstraints(SparseBlockMatrix GT,
VectorNd dg,
int numb,
int[] solveIndexMap)
Implementation of
Constrainer.addBilateralConstraints(SparseBlockMatrix,VectorNd,int) that allows the
block row positions in GT to be reassigned vis a solve matrix
map. |
int |
addUnilateralConstraints(SparseBlockMatrix NT,
VectorNd dn,
int numu,
int[] solveIndexMap)
Implementation of
Constrainer.addUnilateralConstraints(SparseBlockMatrix,VectorNd,int) that allows the
block row positions in NT to be reassigned vis a solve matrix
map. |
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.
|
void |
getConstrainedComponents(java.util.HashSet<DynamicComponent> comps)
Collected all the dynamic components constrained by this constrainer.
|
java.util.ArrayList<JointCoordinateHandle> |
getCoordinateHandles()
Returns the coordinate handles used by this coupling.
|
double |
getScaleFactor() |
int |
setBilateralForces(VectorNd lam,
double s,
int idx)
Sets the bilateral forces that were computed to enforce this
constraint.
|
void |
setScaleFactor(double s) |
double |
updateConstraints(double t,
int flags)
Updates the current set of constraints, and returns the maximum
penetration
> 0 associated with all of them. |
void |
updateCoordinateValue()
Explicitly update the coordinate value associated with this coupling,
based on the current value of the independent coordinates.
|
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, setUnilateralState
checkFlag, checkName, checkNameUniqueness, clearFlag, clone, connectToHierarchy, copy, createTempFlag, disconnectFromHierarchy, getAllPropertyInfo, 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, scan, setFixed, setFlag, setMarked, setName, setNavpanelVisibility, setNavpanelVisibility, setNumber, setParent, setScanning, setSelected, setWritable, updateReferences, write
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addFrictionConstraints, addUnilateralConstraints, getFrictionForces, getFrictionState, getUnilateralForces, getUnilateralInfo, getUnilateralSizes, getUnilateralState, maxFrictionConstraintSets, setFrictionForces, setFrictionState, setUnilateralForces, setUnilateralState
advanceState, getAuxVarDerivative, getAuxVarState, getStateVersion, numAuxVars, requiresAdvance, setAuxVarState
public JointCoordinateCoupling()
public JointCoordinateCoupling(java.util.List<JointCoordinateHandle> coords, Diff1FunctionNx1 fxn)
public JointCoordinateCoupling(java.lang.String name, java.util.List<JointCoordinateHandle> coords, Diff1FunctionNx1 fxn)
public double getScaleFactor()
public void setScaleFactor(double s)
public void getBilateralSizes(VectorNi sizes)
Constrainer
sizes
.getBilateralSizes
in interface Constrainer
getBilateralSizes
in class ConstrainerBase
sizes
- vector to which the block column sizes are appendedpublic void updateCoordinateValue()
public java.util.ArrayList<JointCoordinateHandle> getCoordinateHandles()
public int addBilateralConstraints(SparseBlockMatrix GT, VectorNd dg, int numb)
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
addBilateralConstraints
in class ConstrainerBase
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 addBilateralConstraints(SparseBlockMatrix GT, VectorNd dg, int numb, int[] solveIndexMap)
Constrainer.addBilateralConstraints(SparseBlockMatrix,VectorNd,int)
that allows the
block row positions in GT
to be reassigned vis a solve matrix
map. This enables the creation of constrained system equations for model
component subsets.addBilateralConstraints
in interface BodyConstrainer
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
solveIndexMap
- if non-null
, maps the solve indices of the
constrained components onto the block-row indices of GT
.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
getBilateralInfo
in class ConstrainerBase
ginfo
- returns the constraint informationidx
- starting location in ginfo
for returning constraint
infoidx
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 ConstrainerBase
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 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 ConstrainerBase
lam
- returns the forcesidx
- starting index for forces in lam
idx
public int addUnilateralConstraints(SparseBlockMatrix NT, VectorNd dn, int numu, int[] solveIndexMap)
Constrainer.addUnilateralConstraints(SparseBlockMatrix,VectorNd,int)
that allows the
block row positions in NT
to be reassigned vis a solve matrix
map. This enables the creation of constrained system equations for model
component subsets.addUnilateralConstraints
in interface BodyConstrainer
NT
- matrix to which the bilateral force contraint matrix
is appended.dn
- if non-null
, returns the velocity constraint time
derivativenumu
- starting index for time derivative in dg
solveIndexMap
- if non-null
, maps the solve indices of the
constrained components onto the block-row indices of NT
.numb
public void zeroForces()
Constrainer
zeroForces
in interface Constrainer
zeroForces
in class ConstrainerBase
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
updateConstraints
in class ConstrainerBase
public void getConstrainedComponents(java.util.HashSet<DynamicComponent> comps)
Constrainer
getConstrainedComponents
in interface Constrainer
getConstrainedComponents
in class ConstrainerBase
comps
- set to which constrained components should be added