iMSTK
Interactive Medical Simulation Toolkit
imstkVectorizedState.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 "imstkMath.h"
10 
11 namespace imstk
12 {
19 {
20 public:
21  FeDeformBodyState() = default;
22  FeDeformBodyState(const size_t size) { initialize(size); }
23  virtual ~FeDeformBodyState() = default;
24 
28  void initialize(const size_t numDof);
29 
33  void setState(const Vectord& u, const Vectord& v, const Vectord& a);
34 
38  void setU(const Vectord& u);
39 
43  void setV(const Vectord& v);
44 
48  void setA(const Vectord& a);
49 
53  void setState(std::shared_ptr<FeDeformBodyState> rhs);
54 
58  //const Vectord& getQ() const { return m_q; }
59  Vectord& getQ() { return m_q; }
60 
64  //const Vectord& getQDot() const { return m_qDot; }
65  Vectord& getQDot() { return m_qDot; }
66 
70  //const Vectord& getQDotDot() const { return m_qDotDot; }
71  Vectord& getQDotDot() { return m_qDotDot; }
72 
76  //const Vectord& getState() const { return getQ(); }
77  Vectord& getState() { return getQ(); }
78 
79 protected:
80  Vectord m_q; // State
81  Vectord m_qDot; // Derivative of state w.r.t time
82  Vectord m_qDotDot; // Double derivative of state w.r.t time
83 };
84 } // namespace imstk
Vectord & getState()
Get the state.
void setState(const Vectord &u, const Vectord &v, const Vectord &a)
Set the state to a given one.
Compound Geometry.
Vectord & getQ()
Get the state.
This class stores the state of the unknown field variable in vectorized form.
void setU(const Vectord &u)
Set the current state.
void setV(const Vectord &v)
Set the time derivative of state.
Vectord & getQDot()
Get the derivative of state w.r.t time.
void initialize(const size_t numDof)
Initialize the problem state.
Vectord & getQDotDot()
Get the double derivative of state w.r.t time.
void setA(const Vectord &a)
Set double time derivative of the state.