Simbody
3.5
|
00001 #ifndef SimTK_SIMBODY_PGS_IMPULSE_SOLVER_H_ 00002 #define SimTK_SIMBODY_PGS_IMPULSE_SOLVER_H_ 00003 00004 /* -------------------------------------------------------------------------- * 00005 * Simbody(tm) * 00006 * -------------------------------------------------------------------------- * 00007 * This is part of the SimTK biosimulation toolkit originating from * 00008 * Simbios, the NIH National Center for Physics-Based Simulation of * 00009 * Biological Structures at Stanford, funded under the NIH Roadmap for * 00010 * Medical Research, grant U54 GM072970. See https://simtk.org/home/simbody. * 00011 * * 00012 * Portions copyright (c) 2014 Stanford University and the Authors. * 00013 * Authors: Michael Sherman * 00014 * Contributors: * 00015 * * 00016 * Licensed under the Apache License, Version 2.0 (the "License"); you may * 00017 * not use this file except in compliance with the License. You may obtain a * 00018 * copy of the License at http://www.apache.org/licenses/LICENSE-2.0. * 00019 * * 00020 * Unless required by applicable law or agreed to in writing, software * 00021 * distributed under the License is distributed on an "AS IS" BASIS, * 00022 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * 00023 * See the License for the specific language governing permissions and * 00024 * limitations under the License. * 00025 * -------------------------------------------------------------------------- */ 00026 00027 #include "simbody/internal/ImpulseSolver.h" 00028 00029 namespace SimTK { 00030 00055 class SimTK_SIMBODY_EXPORT PGSImpulseSolver : public ImpulseSolver { 00056 public: 00057 explicit PGSImpulseSolver(Real roll2slipTransitionSpeed) 00058 : ImpulseSolver(roll2slipTransitionSpeed, 00059 1e-6, // default PGS convergence tolerance 00060 100), // default PGS max number iterations 00061 m_SOR(1.2) {} 00062 00066 bool solve 00067 (int phase, 00068 const Array_<MultiplierIndex>& participating, 00069 const Matrix& A, 00070 const Vector& D, 00071 const Array_<MultiplierIndex>& expanding, // nx<=m of these 00072 Vector& piExpand, 00073 Vector& verrStart, // in/out 00074 Vector& verrApplied, // in/out 00075 Vector& pi, 00076 Array_<UncondRT>& unconditional, 00077 Array_<UniContactRT>& uniContact, 00078 Array_<UniSpeedRT>& uniSpeed, 00079 Array_<BoundedRT>& bounded, 00080 Array_<ConstraintLtdFrictionRT>& consLtdFriction, 00081 Array_<StateLtdFrictionRT>& stateLtdFriction 00082 ) const OVERRIDE_11; 00083 00089 bool solveBilateral 00090 (const Array_<MultiplierIndex>& participating, // p<=m of these 00091 const Matrix& A, // m X m, symmetric 00092 const Vector& D, // m, diag>=0 added to A 00093 const Vector& rhs, // m, RHS 00094 Vector& pi // m, unknown result 00095 ) const OVERRIDE_11; 00096 00097 private: 00098 Real m_SOR; 00099 }; 00100 00101 } // namespace SimTK 00102 00103 #endif // SimTK_SIMBODY_PGS_IMPULSE_SOLVER_H_