OdeSolverEulerImplicit.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_MATH_ODESOLVEREULERIMPLICIT_H
#define SURGSIM_MATH_ODESOLVEREULERIMPLICIT_H
#include "SurgSim/Math/OdeSolver.h"
namespace SurgSim
{
namespace Math
{
class OdeSolverEulerImplicit : public OdeSolver
{
public:
explicit OdeSolverEulerImplicit(OdeEquation* equation);
virtual void setNewtonRaphsonMaximumIteration(size_t maximumIteration);
size_t getNewtonRaphsonMaximumIteration() const;
void setNewtonRaphsonEpsilonConvergence(double epsilonConvergence);
double getNewtonRaphsonEpsilonConvergence() const;
void solve(double dt, const OdeState& currentState, OdeState* newState, bool computeCompliance = true) override;
protected:
void assembleLinearSystem(double dt, const OdeState& state, const OdeState& newState,
bool computeRHS = true) override;
size_t m_maximumIteration;
double m_epsilonConvergence;
Vector m_previousSolution;
};
}; // namespace Math
}; // namespace SurgSim
#endif // SURGSIM_MATH_ODESOLVEREULERIMPLICIT_H
SurgSim
Definition: CompoundShapeToGraphics.cpp:29
SurgSim::Math::OdeSolverEulerImplicit::getNewtonRaphsonMaximumIteration
size_t getNewtonRaphsonMaximumIteration() const
Definition: OdeSolverEulerImplicit.cpp:38
OdeSolver.h
SurgSim::Math::OdeEquation
Ode equation of 2nd order of the form with for initial conditions and a set of boundary conditions...
Definition: OdeEquation.h:54
SurgSim::Math::OdeState
The state of an ode of 2nd order of the form with boundary conditions.
Definition: OdeState.h:38
SurgSim::Math::OdeSolverEulerImplicit::m_previousSolution
Vector m_previousSolution
Newton-Raphson previous solution (we solve a problem to find deltaV, the variation in velocity) ...
Definition: OdeSolverEulerImplicit.h:60
SurgSim::Math::Vector
Eigen::Matrix< double, Eigen::Dynamic, 1 > Vector
A dynamic size column vector.
Definition: Vector.h:68
SurgSim::Math::OdeSolverEulerImplicit::getNewtonRaphsonEpsilonConvergence
double getNewtonRaphsonEpsilonConvergence() const
Definition: OdeSolverEulerImplicit.cpp:50
SurgSim::Math::OdeSolverEulerImplicit::m_epsilonConvergence
double m_epsilonConvergence
Newton-Raphson convergence criteria (variation of the solution over time)
Definition: OdeSolverEulerImplicit.h:57
SurgSim::Math::OdeSolver
Base class for all solvers of ode equation of order 2 of the form .
Definition: OdeSolver.h:78
SurgSim::Math::OdeSolverEulerImplicit
Euler implicit (a.k.a backward Euler) ode solver (see OdeSolverEulerImplicit.dox for more details)...
Definition: OdeSolverEulerImplicit.h:28
SurgSim::Math::OdeSolverEulerImplicit::setNewtonRaphsonMaximumIteration
virtual void setNewtonRaphsonMaximumIteration(size_t maximumIteration)
Definition: OdeSolverEulerImplicit.cpp:31
SurgSim::Math::OdeSolverEulerImplicit::OdeSolverEulerImplicit
OdeSolverEulerImplicit(OdeEquation *equation)
Constructor.
Definition: OdeSolverEulerImplicit.cpp:25
SurgSim::Math::OdeSolverEulerImplicit::assembleLinearSystem
void assembleLinearSystem(double dt, const OdeState &state, const OdeState &newState, bool computeRHS=true) override
Assemble the linear system (A.x=b) to be solved for the state and new states (useful for certain ode ...
Definition: OdeSolverEulerImplicit.cpp:124
SurgSim::Math::OdeSolverEulerImplicit::solve
void solve(double dt, const OdeState &currentState, OdeState *newState, bool computeCompliance=true) override
Solves the equation.
Definition: OdeSolverEulerImplicit.cpp:55
SurgSim::Math::OdeSolverEulerImplicit::m_maximumIteration
size_t m_maximumIteration
Newton-Raphson maximum number of iteration (1 => linearization)
Definition: OdeSolverEulerImplicit.h:54
SurgSim::Math::OdeSolverEulerImplicit::setNewtonRaphsonEpsilonConvergence
void setNewtonRaphsonEpsilonConvergence(double epsilonConvergence)
Definition: OdeSolverEulerImplicit.cpp:43