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 
24 
25 namespace SurgSim
26 {
27 namespace Physics
28 {
29 
31 class SolveMlcp : public Computation
32 {
33 public:
36  explicit SolveMlcp(bool doCopyState = false);
37 
39 
41  virtual ~SolveMlcp();
42 
45  void setMaxIterations(size_t maxIterations);
46 
49  size_t getMaxIterations() const;
50 
53  void setPrecision(double epsilon);
54 
57  double getPrecision() const;
58 
61  void setContactTolerance(double epsilon);
62 
65  double getContactTolerance() const;
66 
67 protected:
68 
73  std::shared_ptr<PhysicsManagerState> doUpdate(const double& dt, const std::shared_ptr<PhysicsManagerState>& state)
74  override;
75 
76 private:
77 
80 };
81 
82 }; // Physics
83 }; // SurgSim
84 
85 #endif // SURGSIM_PHYSICS_SOLVEMLCP_H
Computation.h
Macros.h
SurgSim::Physics::SolveMlcp::SolveMlcp
SolveMlcp(bool doCopyState=false)
Constructor.
Definition: SolveMlcp.cpp:28
MlcpGaussSeidelSolver.h
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Physics::SolveMlcp::m_gaussSeidelSolver
SurgSim::Math::MlcpGaussSeidelSolver m_gaussSeidelSolver
The Gauss-Seidel Mlcp solver.
Definition: SolveMlcp.h:79
SurgSim::Math::MlcpGaussSeidelSolver
A solver for mixed LCP problems using the Gauss-Seidel iterative method.
Definition: MlcpGaussSeidelSolver.h:53
SurgSim::Physics::SolveMlcp::getPrecision
double getPrecision() const
Get the precision of the MLCP solver.
Definition: SolveMlcp.cpp:90
SurgSim::Physics::SolveMlcp::doUpdate
std::shared_ptr< PhysicsManagerState > doUpdate(const double &dt, const std::shared_ptr< PhysicsManagerState > &state) override
Override doUpdate from superclass.
Definition: SolveMlcp.cpp:35
SurgSim::Physics::SolveMlcp::getMaxIterations
size_t getMaxIterations() const
Get the maximum number of iterations for the MLCP solver.
Definition: SolveMlcp.cpp:80
SurgSim::Physics::SolveMlcp::setContactTolerance
void setContactTolerance(double epsilon)
Set the contact tolerance for the MLCP solver.
Definition: SolveMlcp.cpp:95
SurgSim::Physics::SolveMlcp::setPrecision
void setPrecision(double epsilon)
Set the precision of the MLCP solver.
Definition: SolveMlcp.cpp:85
SurgSim::Physics::SolveMlcp::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Physics::SolveMlcp)
SurgSim::Physics::SolveMlcp::setMaxIterations
void setMaxIterations(size_t maxIterations)
Set the maximum number of iterations for the MLCP solver.
Definition: SolveMlcp.cpp:75
SurgSim::Physics::SolveMlcp::getContactTolerance
double getContactTolerance() const
Get the contact tolerance for the MLCP solver.
Definition: SolveMlcp.cpp:100
SurgSim::Physics::SolveMlcp::~SolveMlcp
virtual ~SolveMlcp()
Destructor.
Definition: SolveMlcp.cpp:32
SurgSim::Physics::Computation
Encapsulates a calculation over a selection of objects, needs to be subclassed to be used.
Definition: Computation.h:32
SurgSim::Physics::SolveMlcp
Solve the system Mixed Linear Complementarity Problem (Mlcp)
Definition: SolveMlcp.h:31