SolveMlcp.h
Go to the documentation of this file.
1 // This file is a part of the OpenSurgSim project.
2 // Copyright 2013, SimQuest Solutions Inc.
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 // http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 
16 #ifndef SURGSIM_PHYSICS_SOLVEMLCP_H
17 #define SURGSIM_PHYSICS_SOLVEMLCP_H
18 
19 #include <memory>
20 
23 
24 namespace SurgSim
25 {
26 namespace Physics
27 {
28 
30 class SolveMlcp : public Computation
31 {
32 public:
35  explicit SolveMlcp(bool doCopyState = false);
36 
38  virtual ~SolveMlcp();
39 
40  void setMaxIterations(int maxIterations);
41 
42  void setSolverPrecision(double epsilon);
43 
44  void setContactTolerance(double epsilon);
45 
46 protected:
47 
52  virtual std::shared_ptr<PhysicsManagerState> doUpdate(const double& dt,
53  const std::shared_ptr<PhysicsManagerState>& state) override;
54 
55 private:
56 
59 };
60 
61 }; // Physics
62 }; // SurgSim
63 
64 #endif // SURGSIM_PHYSICS_SOLVEMLCP_H
Definition: DriveElementFromInputBehavior.cpp:27
void setSolverPrecision(double epsilon)
Definition: SolveMlcp.cpp:54
A solver for mixed LCP problems using the Gauss-Seidel iterative method.
Definition: MlcpGaussSeidelSolver.h:47
void setContactTolerance(double epsilon)
Definition: SolveMlcp.cpp:59
virtual ~SolveMlcp()
Destructor.
Definition: SolveMlcp.cpp:35
virtual std::shared_ptr< PhysicsManagerState > doUpdate(const double &dt, const std::shared_ptr< PhysicsManagerState > &state) override
Override doUpdate from superclass.
Definition: SolveMlcp.cpp:38
Encapsulates a calculation over a selection of objects, needs to be subclassed to be used...
Definition: Computation.h:30
SurgSim::Math::MlcpGaussSeidelSolver m_gaussSeidelSolver
The Gauss-Seidel Mlcp solver.
Definition: SolveMlcp.h:58
SolveMlcp(bool doCopyState=false)
Constructor.
Definition: SolveMlcp.cpp:32
void setMaxIterations(int maxIterations)
Definition: SolveMlcp.cpp:49
Solve the system Mixed Linear Complementarity Problem (Mlcp)
Definition: SolveMlcp.h:30