Simbody  3.5
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 
29 namespace SimTK {
30 
56 public:
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_11;
83 
89  bool solveBilateral
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_11;
96 
97 private:
98  Real m_SOR;
99 };
100 
101 } // namespace SimTK
102 
103 #endif // SimTK_SIMBODY_PGS_IMPULSE_SOLVER_H_
This is the top-level SimTK namespace into which all SimTK names are placed to avoid collision with o...
Definition: Assembler.h:37
This is the abstract base class for impulse solvers, which solve an important subproblem of the conta...
Definition: ImpulseSolver.h:109
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:593
Projected Gauss Seidel impulse solver.
Definition: PGSImpulseSolver.h:55
#define OVERRIDE_11
Definition: SimTKcommon/include/SimTKcommon/internal/common.h:267
PGSImpulseSolver(Real roll2slipTransitionSpeed)
Definition: PGSImpulseSolver.h:57
The SimTK::Array_<T> container class is a plug-compatible replacement for the C++ standard template l...
Definition: Array.h:50
#define SimTK_SIMBODY_EXPORT
Definition: Simbody/include/simbody/internal/common.h:72