public class MechSystemSolver
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
MechSystemSolver.Integrator |
static class |
MechSystemSolver.MatrixSolver |
static class |
MechSystemSolver.PosStabilization
Indicates the method by which positions should be stabilized.
|
Modifier and Type | Field and Description |
---|---|
static boolean |
myDefaultHybridSolveP |
static boolean |
profileConstraintSolves |
boolean |
profileKKTSolveTime |
boolean |
profileWholeSolve |
static boolean |
useFictitousJacobianForces |
static boolean |
useGlobalFriction |
static boolean |
useVelProjection |
Constructor and Description |
---|
MechSystemSolver(MechSystem system)
Create a new MechSystem solver for a specified MechSystem.
|
MechSystemSolver(MechSystem system,
MechSystemSolver solver)
Create a new MechSystem solver for a specified MechSystem,
with settings imported from an existing MechSystemSolver.
|
Modifier and Type | Method and Description |
---|---|
void |
addActiveMassMatrix(MechSystem sys,
SparseBlockMatrix S,
double t) |
void |
addMassForces(VectorNd f,
double t) |
void |
addSubVector(VectorNd vr,
VectorNd v1,
int off,
int size)
Computes
|
void |
backwardEuler(double t0,
double t1,
StepAdjustment stepAdjust) |
void |
computeParametricForces(double h) |
void |
constrainedBackwardEuler(double t0,
double t1,
StepAdjustment stepAdjust) |
SparseBlockMatrix |
createActiveBilateralMatrix(double t) |
SparseBlockMatrix |
createActiveMassMatrix(double t)
Creates and returns a sparse block matrix consisting of the current
active portion of the mass matrix.
|
SparseBlockMatrix |
createActiveStiffnessMatrix(double h) |
void |
dispose() |
void |
finalize() |
void |
fullBackwardEuler(double t0,
double t1,
StepAdjustment stepAdjust) |
boolean |
getHybridSolve() |
MechSystemSolver.Integrator |
getIntegrator() |
MechSystemSolver.MatrixSolver |
getMatrixSolver() |
int |
getMaxIterations() |
MechSystemSolver.PosStabilization |
getStabilization() |
double |
getTolerance() |
IterativeSolver.ToleranceType |
getToleranceType() |
boolean |
getUpdateForcesAtStepEnd() |
boolean |
hasMatrixSolver(MechSystemSolver.MatrixSolver solver) |
boolean |
isPardisoAvailable() |
void |
KKTFactorAndSolve(VectorNd vel,
VectorNd fpar,
VectorNd bf,
VectorNd btmp,
VectorNd vel0,
double t,
double h,
boolean velocitySolve)
Solves a KKT system in which the Jacobian augmented M matrix and
and force vectors are given by
|
void |
KKTFactorAndSolve(VectorNd vel,
VectorNd fpar,
VectorNd bf,
VectorNd btmp,
VectorNd vel0,
double t,
double h,
double a0,
double a1,
double a2,
double a3,
boolean velocitySolve)
Solves a KKT system in which the Jacobian augmented M matrix and
and force vectors are given by
|
void |
KKTSolve(VectorNd vel,
VectorNd lam,
VectorNd the,
VectorNd bf)
Solves the KKT system given a new right hand side bf.
|
void |
mulActiveInertias(VectorNd b,
VectorNd v) |
void |
nonDynamicSolve(double t0,
double t1,
StepAdjustment stepAdjust) |
void |
projectPosConstraints(double t) |
void |
projectRigidBodyPosConstraints(double t) |
void |
setCrsFileName(java.lang.String name) |
void |
setHybridSolve(boolean enable) |
void |
setIntegrator(MechSystemSolver.Integrator integrator) |
void |
setIterativeSolver(IterativeSolver solver) |
static void |
setLogWriter(java.io.PrintWriter writer) |
void |
setMatrixSolver(MechSystemSolver.MatrixSolver solver) |
void |
setMaxIterations(int max) |
void |
setParametricTargets(double s,
double h) |
void |
setStabilization(MechSystemSolver.PosStabilization stabilization) |
void |
setSubVector(VectorNd vr,
VectorNd v1,
int off,
int size)
Sets
|
void |
setTolerance(double tol) |
void |
setToleranceType(IterativeSolver.ToleranceType type) |
void |
setUpdateForcesAtStepEnd(boolean enable) |
void |
solve(double t0,
double t1,
StepAdjustment stepAdjust) |
void |
trapezoidal(double t0,
double t1,
StepAdjustment stepAdjust) |
void |
updateMassMatrix(double t) |
void |
updateStateSizes() |
public boolean profileKKTSolveTime
public boolean profileWholeSolve
public static boolean useVelProjection
public static boolean useGlobalFriction
public static boolean useFictitousJacobianForces
public static boolean myDefaultHybridSolveP
public static boolean profileConstraintSolves
public MechSystemSolver(MechSystem system)
public MechSystemSolver(MechSystem system, MechSystemSolver solver)
public void setUpdateForcesAtStepEnd(boolean enable)
public boolean getUpdateForcesAtStepEnd()
public boolean getHybridSolve()
public void setHybridSolve(boolean enable)
public void setParametricTargets(double s, double h)
public void computeParametricForces(double h)
public void updateMassMatrix(double t)
public SparseBlockMatrix createActiveMassMatrix(double t)
t
- current timepublic void updateStateSizes()
public void setIntegrator(MechSystemSolver.Integrator integrator)
public void setIterativeSolver(IterativeSolver solver)
public MechSystemSolver.Integrator getIntegrator()
public double getTolerance()
public void setTolerance(double tol)
public IterativeSolver.ToleranceType getToleranceType()
public void setToleranceType(IterativeSolver.ToleranceType type)
public void setMaxIterations(int max)
public int getMaxIterations()
public void setMatrixSolver(MechSystemSolver.MatrixSolver solver)
public void setStabilization(MechSystemSolver.PosStabilization stabilization)
public MechSystemSolver.PosStabilization getStabilization()
public boolean isPardisoAvailable()
public boolean hasMatrixSolver(MechSystemSolver.MatrixSolver solver)
public MechSystemSolver.MatrixSolver getMatrixSolver()
public void nonDynamicSolve(double t0, double t1, StepAdjustment stepAdjust)
public void solve(double t0, double t1, StepAdjustment stepAdjust)
public void addActiveMassMatrix(MechSystem sys, SparseBlockMatrix S, double t)
public void addMassForces(VectorNd f, double t)
public void addSubVector(VectorNd vr, VectorNd v1, int off, int size)
vr += v1(off:off+size-1)
public void setSubVector(VectorNd vr, VectorNd v1, int off, int size)
vr = v1(off:off+size-1)
public void backwardEuler(double t0, double t1, StepAdjustment stepAdjust)
public void KKTFactorAndSolve(VectorNd vel, VectorNd fpar, VectorNd bf, VectorNd btmp, VectorNd vel0, double t, double h, boolean velocitySolve)
M' = M - h df/dv - h^2 df/dx bf' = bf + (-h df/dv) vel0When used to solve for velocities in an implicit integrator, then on input, bf is assumed to be given by
bf = M vel0 + h fwhere h is the time step and f is the generalized forces, while on output bf is modified to include the Jacobian terms described above. XXX question about which time do we want? t0 or t1? Right now it is set to t1; setting it to t0 seems to cause a small difference in the inverse tongue model.
public void KKTFactorAndSolve(VectorNd vel, VectorNd fpar, VectorNd bf, VectorNd btmp, VectorNd vel0, double t, double h, double a0, double a1, double a2, double a3, boolean velocitySolve)
M' = M + a0 df/dv + a1 df/dx bf' = bf + (a2 df/dv + a3 df/dx) vel0It is assumed that a0 and a1 are both non-zero. It is also assumed that the a0 = -alpha h, where h is the step size and alpha indicates the propertion of implicitness for the solve; i.e., for regular backward euler, alpha=1, while for trapezoidal solves, alpha = 0.5; When used to solve for velocities in an implicit integrator, then on input, bf is assumed to be given by
bf = M vel0 + h fwhere h is the time step and f is the generalized forces, while on output bf is modified to include the Jacobian terms described above.
public void setCrsFileName(java.lang.String name)
public static void setLogWriter(java.io.PrintWriter writer)
public void KKTSolve(VectorNd vel, VectorNd lam, VectorNd the, VectorNd bf)
bf = M vel0 + f1while on output it is modified to include Jacobian terms that depend on vel0. Thus if one want to use KKTSolve to compute velocities based on different force values f2, one should use a calling sequence similar to the following:
bf1 = M vel0 + f1 KKTFactorAndSolve (vel1, bf1, btmp, vel0, ...) bf2 = bf1 - f1 + f2 KKTSolve (vel2, myLam, the, bf2)
public void projectPosConstraints(double t)
public void projectRigidBodyPosConstraints(double t)
public void constrainedBackwardEuler(double t0, double t1, StepAdjustment stepAdjust)
public void fullBackwardEuler(double t0, double t1, StepAdjustment stepAdjust)
public void trapezoidal(double t0, double t1, StepAdjustment stepAdjust)
public SparseBlockMatrix createActiveStiffnessMatrix(double h)
public SparseBlockMatrix createActiveBilateralMatrix(double t)
public void dispose()
public void finalize()
finalize
in class java.lang.Object