SolveMlcp.h
Go to the documentation of this file.
// This file is a part of the OpenSurgSim project.
// Copyright 2013, SimQuest Solutions Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#ifndef SURGSIM_PHYSICS_SOLVEMLCP_H
#define SURGSIM_PHYSICS_SOLVEMLCP_H
#include <memory>
#include "SurgSim/Framework/Macros.h"
#include "SurgSim/Math/MlcpGaussSeidelSolver.h"
#include "SurgSim/Physics/Computation.h"
namespace SurgSim
{
namespace Physics
{
class SolveMlcp : public Computation
{
public:
explicit SolveMlcp(bool doCopyState = false);
SURGSIM_CLASSNAME(SurgSim::Physics::SolveMlcp);
virtual ~SolveMlcp();
void setMaxIterations(size_t maxIterations);
size_t getMaxIterations() const;
void setPrecision(double epsilon);
double getPrecision() const;
void setContactTolerance(double epsilon);
double getContactTolerance() const;
protected:
std::shared_ptr<PhysicsManagerState> doUpdate(const double& dt, const std::shared_ptr<PhysicsManagerState>& state)
override;
private:
SurgSim::Math::MlcpGaussSeidelSolver m_gaussSeidelSolver;
};
}; // Physics
}; // SurgSim
#endif // SURGSIM_PHYSICS_SOLVEMLCP_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Math::MlcpGaussSeidelSolver
A solver for mixed LCP problems using the Gauss-Seidel iterative method.
Definition: MlcpGaussSeidelSolver.h:53
SurgSim::Physics::SolveMlcp::setContactTolerance
void setContactTolerance(double epsilon)
Set the contact tolerance for the MLCP solver.
Definition: SolveMlcp.cpp:95
SurgSim::Physics::SolveMlcp::getPrecision
double getPrecision() const
Get the precision of the MLCP solver.
Definition: SolveMlcp.cpp:90
SurgSim::Physics::SolveMlcp::getContactTolerance
double getContactTolerance() const
Get the contact tolerance for the MLCP solver.
Definition: SolveMlcp.cpp:100
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::~SolveMlcp
virtual ~SolveMlcp()
Destructor.
Definition: SolveMlcp.cpp:32
SurgSim::Physics::SolveMlcp::setPrecision
void setPrecision(double epsilon)
Set the precision of the MLCP solver.
Definition: SolveMlcp.cpp:85
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
Macros.h
SurgSim::Physics::SolveMlcp::SURGSIM_CLASSNAME
SURGSIM_CLASSNAME(SurgSim::Physics::SolveMlcp)
SurgSim::Physics::SolveMlcp::getMaxIterations
size_t getMaxIterations() const
Get the maximum number of iterations for the MLCP solver.
Definition: SolveMlcp.cpp:80
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::m_gaussSeidelSolver
SurgSim::Math::MlcpGaussSeidelSolver m_gaussSeidelSolver
The Gauss-Seidel Mlcp solver.
Definition: SolveMlcp.h:79
SurgSim::Physics::SolveMlcp::SolveMlcp
SolveMlcp(bool doCopyState=false)
Constructor.
Definition: SolveMlcp.cpp:28
Computation.h
SurgSim::Physics::SolveMlcp
Solve the system Mixed Linear Complementarity Problem (Mlcp)
Definition: SolveMlcp.h:31
MlcpGaussSeidelSolver.h