iMSTK
Interactive Medical Simulation Toolkit
imstkVectorizedState.cpp
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 #include "imstkVectorizedState.h"
8 
9 namespace imstk
10 {
11 void
12 FeDeformBodyState::initialize(const size_t numDof)
13 {
14  m_q.resize(numDof);
15  m_qDot.resize(numDof);
16  m_qDotDot.resize(numDof);
17 
18  m_q.setZero();
19  m_qDot.setZero();
20  m_qDotDot.setZero();
21 };
22 
23 void
24 FeDeformBodyState::setState(const Vectord& u, const Vectord& v, const Vectord& a)
25 {
26  m_q = u;
27  m_qDot = v;
28  m_qDotDot = a;
29 }
30 
31 void
32 FeDeformBodyState::setU(const Vectord& u)
33 {
34  m_q = u;
35 }
36 
37 void
38 FeDeformBodyState::setV(const Vectord& v)
39 {
40  m_qDot = v;
41 }
42 
43 void
44 FeDeformBodyState::setA(const Vectord& a)
45 {
46  m_qDotDot = a;
47 }
48 
49 void
50 FeDeformBodyState::setState(std::shared_ptr<FeDeformBodyState> rhs)
51 {
52  m_q = rhs->getQ();
53  m_qDot = rhs->getQDot();
54  m_qDotDot = rhs->getQDotDot();
55 }
56 } // namespace imstk
void setState(const Vectord &u, const Vectord &v, const Vectord &a)
Set the state to a given one.
Compound Geometry.
void setU(const Vectord &u)
Set the current state.
void setV(const Vectord &v)
Set the time derivative of state.
void initialize(const size_t numDof)
Initialize the problem state.
void setA(const Vectord &a)
Set double time derivative of the state.