opensurgsim
OdeSolverLinearEulerImplicit.h
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_MATH_ODESOLVERLINEAREULERIMPLICIT_H
17 #define SURGSIM_MATH_ODESOLVERLINEAREULERIMPLICIT_H
18 
19 #include "SurgSim/Math/OdeSolverEulerImplicit.h"
21 
22 namespace SurgSim
23 {
24 
25 namespace Math
26 {
27 
35 {
36 public:
39  explicit OdeSolverLinearEulerImplicit(OdeEquation* equation);
40 
41  void setNewtonRaphsonMaximumIteration(size_t maximumIteration) override;
42 
45  void solve(double dt, const OdeState& currentState, OdeState* newState, bool computeCompliance = true) override;
46 
47 private:
49  SparseMatrix m_constantK;
50 
52  bool m_initialized;
53 };
54 
55 }; // namespace Math
56 
57 }; // namespace SurgSim
58 
59 #endif // SURGSIM_MATH_ODESOLVERLINEAREULERIMPLICIT_H
Wraps glewInit() to separate the glew opengl definitions from the osg opengl definitions only imgui n...
Definition: AddRandomSphereBehavior.cpp:36
Eigen::SparseMatrix< double > SparseMatrix
A sparse matrix.
Definition: SparseMatrix.h:32
OdeSolverLinearEulerImplicit(OdeEquation *equation)
Constructor.
Definition: OdeSolverLinearEulerImplicit.cpp:26
void solve(double dt, const OdeState &currentState, OdeState *newState, bool computeCompliance=true) override
The parameter computeCompliance is irrelevant for any Linear solver as it is a constant matrix...
Definition: OdeSolverLinearEulerImplicit.cpp:43
Ode equation of 2nd order of the form with for initial conditions and a set of boundary conditions...
Definition: OdeEquation.h:54
The state of an ode of 2nd order of the form with boundary conditions.
Definition: OdeState.h:38
Definitions of useful sparse matrix functions.
void setNewtonRaphsonMaximumIteration(size_t maximumIteration) override
Definition: OdeSolverLinearEulerImplicit.cpp:35
Linear Version of the Euler Implicit ode solver This solver assumes that the system is linear...
Definition: OdeSolverLinearEulerImplicit.h:34
Euler implicit (a.k.a backward Euler) ode solver (see OdeSolverEulerImplicit.dox for more details)...
Definition: OdeSolverEulerImplicit.h:28