Geomi
ImplicitEulerStepInternals.hpp
1 #ifndef DEF_VARIATIONAL_IMPLICITEULERSTEPINTERNALS
2 #define DEF_VARIATIONAL_IMPLICITEULERSTEPINTERNALS
3 
4 #include <vector>
5 
6 namespace Variational {
7 
8 template <typename T_M,
9  typename T_Q,
10  typename T_TQ>
11 class ImplicitEulerStepInternals : public Abstract::StepInternals<T_M,T_Q,T_TQ>, public ::Abstract::NOXStep<T_Q,1>
12 {
13 public:
16  { }
17 
19  getInitialGuess ()
20  {
21  NOXVector<T_Q::DOF> ret((1.0+1.0/this->m_h)*this->m_q1-(1.0/this->m_h)*this->m_q0);
22  return ret;
23  }
24 
25  bool
26  computeF (NOXVector<T_Q::DOF>& f, const NOXVector<T_Q::DOF>& q)
27  {
28  f = this->m_h * this->m_problem.dLdq(this->m_q1,(this->m_q1-this->m_q0)/this->m_h)
29  + this->m_problem.dLdv(this->m_q1,(this->m_q1-this->m_q0)/this->m_h)
30  - this->m_problem.dLdv(q,(q-this->m_q1)/this->m_h);
31  return true;
32  }
33 
34  bool
35  computeJacobian (Eigen::Matrix<double,T_Q::DOF,T_Q::DOF>& J, const NOXVector<T_Q::DOF>& q)
36  {
37  J = this->m_problem.JqdLdv(q,(q-this->m_q1)/this->m_h )
38  - this->m_problem.JvdLdv(q,(q-this->m_q1)/this->m_h )/this->m_h;
39  return true;
40  }
41 };
42 } // namespace Variational
43 
44 #endif
Definition: Abstract_Problem.hpp:10
Definition: Abstract_LieProblem.hpp:6
Definition: ImplicitEulerStepInternals.hpp:11
Definition: Abstract_StepInternals.hpp:13
Definition: NOXVector.hpp:14
Definition: Abstract_NOXStep.hpp:12