Simbody 3.7
Loading...
Searching...
No Matches
PGSImpulseSolver.h
Go to the documentation of this file.
1#ifndef SimTK_SIMBODY_PGS_IMPULSE_SOLVER_H_
2#define SimTK_SIMBODY_PGS_IMPULSE_SOLVER_H_
3
4/* -------------------------------------------------------------------------- *
5 * Simbody(tm) *
6 * -------------------------------------------------------------------------- *
7 * This is part of the SimTK biosimulation toolkit originating from *
8 * Simbios, the NIH National Center for Physics-Based Simulation of *
9 * Biological Structures at Stanford, funded under the NIH Roadmap for *
10 * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody. *
11 * *
12 * Portions copyright (c) 2014 Stanford University and the Authors. *
13 * Authors: Michael Sherman *
14 * Contributors: *
15 * *
16 * Licensed under the Apache License, Version 2.0 (the "License"); you may *
17 * not use this file except in compliance with the License. You may obtain a *
18 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. *
19 * *
20 * Unless required by applicable law or agreed to in writing, software *
21 * distributed under the License is distributed on an "AS IS" BASIS, *
22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
23 * See the License for the specific language governing permissions and *
24 * limitations under the License. *
25 * -------------------------------------------------------------------------- */
26
28
29namespace SimTK {
30
56public:
57 explicit PGSImpulseSolver(Real roll2slipTransitionSpeed)
58 : ImpulseSolver(roll2slipTransitionSpeed,
59 1e-6, // default PGS convergence tolerance
60 100), // default PGS max number iterations
61 m_SOR(1.2) {}
62
66 bool solve
67 (int phase,
68 const Array_<MultiplierIndex>& participating,
69 const Matrix& A,
70 const Vector& D,
71 const Array_<MultiplierIndex>& expanding, // nx<=m of these
72 Vector& piExpand,
73 Vector& verrStart, // in/out
74 Vector& verrApplied, // in/out
75 Vector& pi,
76 Array_<UncondRT>& unconditional,
77 Array_<UniContactRT>& uniContact,
78 Array_<UniSpeedRT>& uniSpeed,
79 Array_<BoundedRT>& bounded,
80 Array_<ConstraintLtdFrictionRT>& consLtdFriction,
81 Array_<StateLtdFrictionRT>& stateLtdFriction
82 ) const override;
83
90 (const Array_<MultiplierIndex>& participating, // p<=m of these
91 const Matrix& A, // m X m, symmetric
92 const Vector& D, // m, diag>=0 added to A
93 const Vector& rhs, // m, RHS
94 Vector& pi // m, unknown result
95 ) const override;
96
97private:
98 Real m_SOR;
99};
100
101} // namespace SimTK
102
103#endif // SimTK_SIMBODY_PGS_IMPULSE_SOLVER_H_
#define SimTK_SIMBODY_EXPORT
Definition Simbody/include/simbody/internal/common.h:68
The Array_<T> container class is a plug-compatible replacement for the C++ standard template library ...
Definition Array.h:1520
This is the abstract base class for impulse solvers, which solve an important subproblem of the conta...
Definition ImpulseSolver.h:109
Projected Gauss Seidel impulse solver.
Definition PGSImpulseSolver.h:55
bool solve(int phase, const Array_< MultiplierIndex > &participating, const Matrix &A, const Vector &D, const Array_< MultiplierIndex > &expanding, Vector &piExpand, Vector &verrStart, Vector &verrApplied, Vector &pi, Array_< UncondRT > &unconditional, Array_< UniContactRT > &uniContact, Array_< UniSpeedRT > &uniSpeed, Array_< BoundedRT > &bounded, Array_< ConstraintLtdFrictionRT > &consLtdFriction, Array_< StateLtdFrictionRT > &stateLtdFriction) const override
Solve with conditional constraints.
bool solveBilateral(const Array_< MultiplierIndex > &participating, const Matrix &A, const Vector &D, const Vector &rhs, Vector &pi) const override
Solve with only unconditional constraints.
PGSImpulseSolver(Real roll2slipTransitionSpeed)
Definition PGSImpulseSolver.h:57
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition Assembler.h:37
SimTK_Real Real
This is the default compiled-in floating point type for SimTK, either float or double.
Definition SimTKcommon/include/SimTKcommon/internal/common.h:606