PolyFEM
Loading...
Searching...
No Matches
GrowthElasticity.hpp
Go to the documentation of this file.
1#pragma once
2
4
5#include <memory>
6
7namespace polyfem::assembler
8{
9 namespace detail
10 {
11 class GrowthElasticityModel;
12 }
13
44 Eigen::MatrixXd read_growth_cell_array(
45 const io::ResourceIO &resources, const std::string &path, const std::string &field, const int ncomp_expected);
46
48 {
49 public:
52
53 std::string name() const override { return "GrowthElasticity"; }
54 std::map<std::string, ParamFunc> parameters() const override;
55
56 void set_size(const int size) override;
57 void add_multimaterial(const int index, const json &params, const Units &units, const io::ResourceIO &resources) override;
58
65 double driving_force(const int el_id, const RowVectorNd &pos, const double t, const Eigen::Matrix3d &Ce) const;
67 Eigen::Vector3d wall_normal(const int el_id) const;
68
79 void grown_stresses(
80 const int el_id, const RowVectorNd &pos, const double t,
81 const Eigen::Matrix3d &F, const double theta,
82 Eigen::Matrix3d &cauchy, Eigen::Matrix3d &pk1, Eigen::Matrix3d &pk2,
83 double &energy) const;
84
85 protected:
86 int rows() const override { return size(); }
87 int cols() const override { return 1; }
88
89 double compute_energy(const MixedNonLinearAssemblerData &data) const override;
90 Eigen::VectorXd compute_gradient(const MixedNonLinearAssemblerData &data) const override;
91 void compute_hessian(const MixedNonLinearAssemblerData &data, LocalHessian &hessian) const override;
92
93 private:
96
97 std::unique_ptr<detail::GrowthElasticityModel> model_;
98 };
99} // namespace polyfem::assembler
LocalHessian hessian
Eigen::Vector3d wall_normal(const int el_id) const
Reference wall normal n0 of element el_id (unit).
void grown_stresses(const int el_id, const RowVectorNd &pos, const double t, const Eigen::Matrix3d &F, const double theta, Eigen::Matrix3d &cauchy, Eigen::Matrix3d &pk1, Eigen::Matrix3d &pk2, double &energy) const
Stresses and energy density of the grown material, total energy density J^g psi_e(F Fg^{-1}),...
double driving_force(const int el_id, const RowVectorNd &pos, const double t, const Eigen::Matrix3d &Ce) const
Growth driving force f_I = -(1/vn) d(J^g psi_e)/d theta as a function of the elastic right Cauchy-Gre...
double compute_energy(const MixedNonLinearAssemblerData &data) const override
std::string name() const override
void set_size(const int size) override
void add_multimaterial(const int index, const json &params, const Units &units, const io::ResourceIO &resources) override
std::map< std::string, ParamFunc > parameters() const override
detail::GrowthElasticityModel & model()
Eigen::VectorXd compute_gradient(const MixedNonLinearAssemblerData &data) const override
void compute_hessian(const MixedNonLinearAssemblerData &data, LocalHessian &hessian) const override
std::unique_ptr< detail::GrowthElasticityModel > model_
Reusable element matrix with inline storage for small blocks and a dynamic fallback for high-order el...
Read-only interface to a hierarchical collection of simulation resources.
Used for test only.
Eigen::MatrixXd read_growth_cell_array(const io::ResourceIO &resources, const std::string &path, const std::string &field, const int ncomp_expected)
Mixed (displacement, growth) assembler implementing the correction energy of finite areal growth of a...
nlohmann::json json
Definition Common.hpp:9
Eigen::Matrix< double, 1, Eigen::Dynamic, Eigen::RowMajor, 1, 3 > RowVectorNd
Definition Types.hpp:13