iMSTK
Interactive Medical Simulation Toolkit
imstkReducedFeDeformableObject.h
1 /*=========================================================================
2 
3  Library: iMSTK
4 
5  Copyright (c) Kitware, Inc. & Center for Modeling, Simulation,
6  & Imaging in Medicine, Rensselaer Polytechnic Institute.
7 
8  Licensed under the Apache License, Version 2.0 (the "License");
9  you may not use this file except in compliance with the License.
10  You may obtain a copy of the License at
11 
12  http://www.apache.org/licenses/LICENSE-2.0.txt
13 
14  Unless required by applicable law or agreed to in writing, software
15  distributed under the License is distributed on an "AS IS" BASIS,
16  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  See the License for the specific language governing permissions and
18  limitations under the License.
19 
20 =========================================================================*/
21 
22 #pragma once
23 
24 #include "imstkDynamicObject.h"
25 
26 namespace imstk
27 {
28 class Geometry;
29 class GeometryMap;
30 class ReducedStVK;
31 
38 {
39 public:
43  ReducedFeDeformableObject(const std::string& name) : DynamicObject(name) { }
44 
48  virtual ~ReducedFeDeformableObject() override = default;
49 
50 public:
51  virtual const std::string getTypeName() const override { return "ReducedFeDeformableObject"; }
52 
56  bool initialize() override;
57 
61  void initializeState();
62  void initializeState(const Vectord& p, const Vectord& v);
63 
67  //void setDynamicalModel(std::shared_ptr<DynamicalModel<VectorizedState>> dynaDefModel) override;
68 
72  Vectord& getContactForce();
73 
77  const Vectord& getDisplacements() const;
78 
82  const Vectord& getPrevDisplacements() const;
83 
87  const Vectord& getVelocities() const;
88 
92  const Vectord& getPrevVelocities() const;
93 
97  const Vectord& getAccelerations() const;
98 
102  const Vectord& getPrevAccelerations() const;
103 
104 protected:
105  std::shared_ptr<ReducedStVK> m_defModel = nullptr;
106 };
107 } // imstk
Vectord & getContactForce()
Set/Get dynamical model.
Base class for scene objects that move and/or deform.
Compound Geometry.
virtual ~ReducedFeDeformableObject() override=default
Destructor.
const Vectord & getAccelerations() const
Get the vector of current accelerations.
const Vectord & getVelocities() const
Get the vector of current velocities.
const Vectord & getPrevAccelerations() const
Get the vector of accelerations from previous time step.
void initializeState()
Initialize the kinematic state of the body.
ReducedFeDeformableObject(const std::string &name)
Constructor.
const Vectord & getPrevVelocities() const
Get the vector of velocities from previous time step.
const Vectord & getPrevDisplacements() const
Get the vector of displacements from previous time step.
bool initialize() override
Initialize the deformable object.
const Vectord & getDisplacements() const
Get the vector of current displacements.