iMSTK
Interactive Medical Simulation Toolkit
imstkStVKForceModel.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 "imstkMacros.h"
8 
9 DISABLE_WARNING_PUSH
10  DISABLE_WARNING_HIDES_CLASS_MEMBER
11 
12 #include "imstkStVKForceModel.h"
13 
14 #include <StVKElementABCDLoader.h>
15 #include <tetMesh.h>
16 
17 DISABLE_WARNING_POP
18 
19 namespace imstk
20 {
21 StvkForceModel::StvkForceModel(std::shared_ptr<vega::VolumetricMesh> mesh,
22  const bool withGravity, const double gravity) : InternalForceModel()
23 {
24  auto tetMesh = std::dynamic_pointer_cast<vega::TetMesh>(mesh);
25  vega::StVKElementABCD* precomputedIntegrals = vega::StVKElementABCDLoader::load(tetMesh.get());
26  m_stVKInternalForces = std::make_shared<vega::StVKInternalForces>(tetMesh.get(), precomputedIntegrals, withGravity, gravity);
27  m_vegaStVKStiffnessMatrix = std::make_shared<vega::StVKStiffnessMatrix>(m_stVKInternalForces.get());
28 }
29 } // namespace imstk
Compound Geometry.