9#ifndef PBAT_SIM_ALGORITHM_NEWTON_INTEGRATOR_H
10#define PBAT_SIM_ALGORITHM_NEWTON_INTEGRATOR_H
19#include "pbat/sim/contact/MultibodyTetrahedralMeshSystem.h"
22#ifdef PBAT_USE_SUITESPARSE
23 #include <Eigen/CholmodSupport>
25 #include <Eigen/SparseCholesky>
39 static auto constexpr kDims = 3;
52 Eigen::SparseMatrix<ScalarType, Eigen::ColMajor, IndexType>;
53#ifdef PBAT_USE_SUITESPARSE
55 Eigen::CholmodDecomposition<HessianMatrixType, Eigen::Upper>;
59 Eigen::SimplicialLDLT<HessianMatrixType, Eigen::Upper>;
93 void Step(std::optional<io::Archive> archive = std::nullopt);
100 return mElastoDynamics;
145 std::vector<Eigen::Triplet<ScalarType, IndexType>>
147 std::unique_ptr<DecompositionType> mInverseHessian;
149 Eigen::Vector<ScalarType, Eigen::Dynamic> mGrad;
Header file for the Newton integrator's configuration.
Header file for the Finite Element Elasto-Dynamics module.
Header file for line search algorithms.
Stable Neo-Hookean smith2018snh hyperelastic energy.
Tetrahedron finite element.
static auto constexpr kOrder
Shape function order.
Definition Integrator.h:40
Index IndexType
Integer index type.
Definition Integrator.h:43
Integrator(Integrator &&other) noexcept=default
Move constructor.
contact::MultibodyTetrahedralMeshSystem< IndexType > MeshSystemType
Mesh system type.
Definition Integrator.h:44
Integrator & operator=(Integrator const &other)
Copy assignment operator.
Definition Integrator.cpp:20
auto GetConfig() const -> Config const &
Get the Config object.
Definition Integrator.h:121
auto GetElastoDynamics() const -> ElastoDynamicsType const &
Get the Elasto Dynamics object.
Definition Integrator.h:98
auto GetMeshSystem() const -> MeshSystemType const &
Get the Mesh System object.
Definition Integrator.h:111
auto GetMeshSystem() -> MeshSystemType &
Get the Mesh System object.
Definition Integrator.h:116
Eigen::SimplicialLDLT< HessianMatrixType, Eigen::Upper > DecompositionType
Hessian decomposition type.
Definition Integrator.h:58
Eigen::SparseMatrix< ScalarType, Eigen::ColMajor, IndexType > HessianMatrixType
Hessian matrix type.
Definition Integrator.h:51
void ApplyConfig()
Apply the current configuration to the integrator.
Definition Integrator.cpp:226
dynamics::FemElastoDynamics< fem::Tetrahedron< 1 >, kDims, physics::StableNeoHookeanEnergy< kDims >, ScalarType, IndexType > ElastoDynamicsType
Elasto-dynamics type.
Definition Integrator.h:45
void AssembleHessian(ScalarType bt2)
Assemble the Hessian matrix.
Definition Integrator.cpp:138
auto GetConfig() -> Config &
Get the Config object.
Definition Integrator.h:126
void Step(std::optional< io::Archive > archive=std::nullopt)
Perform a single time step of the Newton integrator.
Definition Integrator.cpp:49
auto GetElastoDynamics() -> ElastoDynamicsType &
Get the Elasto Dynamics object.
Definition Integrator.h:106
Integrator(Integrator const &other)
Copy constructor.
Definition Integrator.cpp:7
static auto constexpr kDims
Number of spatial dimensions.
Definition Integrator.h:39
Integrator & operator=(Integrator &&other) noexcept=default
Move assignment operator.
Scalar ScalarType
Floating point scalar type.
Definition Integrator.h:42
Header file for Newton's method for optimization.
typename detail::Tetrahedron< Order > Tetrahedron
Tetrahedron finite element.
Definition Tetrahedron.h:38
Namespace for Newton simulation algorithms.
Definition Config.cpp:8
std::ptrdiff_t Index
Index type.
Definition Aliases.h:17
double Scalar
Scalar type.
Definition Aliases.h:18
Definition LineSearch.h:20
Newton's method for optimization.
Definition Newton.h:27
Definition StableNeoHookeanEnergy.h:23
Newton integrator configuration.
Definition Config.h:25
Multibody Tetrahedral Mesh System.
Definition MultibodyTetrahedralMeshSystem.h:26
Finite Element Elasto-Dynamics initial value problem with Dirichlet boundary conditions using BDF (ba...
Definition FemElastoDynamics.h:54