iMSTK
Interactive Medical Simulation Toolkit
imstkBackwardEuler.h
1 /*
2 ** This file is part of the Interactive Medical Simulation Toolkit (iMSTK)
3 ** iMSTK is distributed under the Apache License, Version 2.0.
4 ** See accompanying NOTICE for details.
5 */
6 
7 #pragma once
8 
9 #include "imstkTimeIntegrator.h"
10 
11 namespace imstk
12 {
19 {
20 public:
21  BackwardEuler(const double dT = 0.01) : TimeIntegrator(Type::BackwardEuler, dT) { }
22  ~BackwardEuler() override = default;
23 
27  void updateStateGivenDv(std::shared_ptr<FeDeformBodyState> prevState,
28  std::shared_ptr<FeDeformBodyState> currentState,
29  Vectord& dV) override;
30 
34  void updateStateGivenDu(std::shared_ptr<FeDeformBodyState> prevState,
35  std::shared_ptr<FeDeformBodyState> currentState,
36  Vectord& dU) override;
37 
41  void updateStateGivenV(std::shared_ptr<FeDeformBodyState> prevState,
42  std::shared_ptr<FeDeformBodyState> currentState,
43  Vectord& v) override;
44 
48  void updateStateGivenU(std::shared_ptr<FeDeformBodyState> prevState,
49  std::shared_ptr<FeDeformBodyState> currentState,
50  Vectord& u) override;
51 protected:
52 
53 // // Coefficients of the time integrator
54 // std::array<double, 3> m_alpha = { { 1, 0, 0 } };
55 // std::array<double, 3> m_beta = { { 1, -1, 0 } };
56 // std::array<double, 3> m_gamma = { { 1, -2, -1 } };
57 };
58 } // namespace imstk
void updateStateGivenU(std::shared_ptr< FeDeformBodyState > prevState, std::shared_ptr< FeDeformBodyState > currentState, Vectord &u) override
Update state given updated displacement.
This class defines the time integrators of various types. It only sets the rules of how the velocity ...
void updateStateGivenDu(std::shared_ptr< FeDeformBodyState > prevState, std::shared_ptr< FeDeformBodyState > currentState, Vectord &dU) override
Update state given change in displacement.
void updateStateGivenDv(std::shared_ptr< FeDeformBodyState > prevState, std::shared_ptr< FeDeformBodyState > currentState, Vectord &dV) override
Update state given change in velocity.
Compound Geometry.
Backward Euler time integration.
void updateStateGivenV(std::shared_ptr< FeDeformBodyState > prevState, std::shared_ptr< FeDeformBodyState > currentState, Vectord &v) override
Update state given updated velocity.