PolyFEM
Loading...
Searching...
No Matches
OgdenElasticity.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace polyfem::assembler
7{
8 class UnconstrainedOgdenElasticity : public GenericElastic<UnconstrainedOgdenElasticity>
9 {
10 public:
12
13 // sets material params
14 void add_multimaterial(const int index, const json &params, const Units &units) override;
15
16 const GenericMatParams &alphas() const { return alphas_; }
17 const GenericMatParams &mus() const { return mus_; }
18 const GenericMatParams &Ds() const { return Ds_; }
19
20 std::string name() const override { return "UnconstrainedOgden"; }
21 std::map<std::string, ParamFunc> parameters() const override;
22
23 template <typename T>
25 const RowVectorNd &p,
26 const double t,
27 const int el_id,
28 const DefGradMatrix<T> &def_grad) const;
29
30 private:
34 };
35
36 class IncompressibleOgdenElasticity : public GenericElastic<IncompressibleOgdenElasticity>
37 {
38 public:
40
41 // sets material params
42 void add_multimaterial(const int index, const json &params, const Units &units) override;
43
45 const GenericMatParams &coefficients() const { return coefficients_; }
47 const GenericMatParams &expoenents() const { return expoenents_; }
49 const GenericMatParam &bulk_modulus() const { return bulk_modulus_; }
50
52 int num_terms() const { return coefficients_.size(); }
53
54 std::string name() const override { return "IncompressibleOgden"; }
55 std::map<std::string, ParamFunc> parameters() const override;
56
57 template <typename T>
59 const RowVectorNd &p,
60 const double t,
61 const int el_id,
62 const DefGradMatrix<T> &def_grad) const;
63
64 private:
68 };
69} // namespace polyfem::assembler
70
71#include "OgdenElasticity.tpp"
void add_multimaterial(const int index, const json &params, const Units &units) override
const GenericMatParam & bulk_modulus() const
Bulk modulus.
int num_terms() const
Number of terms in the Ogden model.
T elastic_energy(const RowVectorNd &p, const double t, const int el_id, const DefGradMatrix< T > &def_grad) const
std::map< std::string, ParamFunc > parameters() const override
const GenericMatParams & coefficients() const
Coefficient of nth term, where n can range from 1 to 6.
const GenericMatParams & expoenents() const
Exponent of nth term, where n can range from 1 to 6.
std::map< std::string, ParamFunc > parameters() const override
T elastic_energy(const RowVectorNd &p, const double t, const int el_id, const DefGradMatrix< T > &def_grad) const
void add_multimaterial(const int index, const json &params, const Units &units) override
Used for test only.
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic, 0, 3, 3 > DefGradMatrix
nlohmann::json json
Definition Common.hpp:9
Eigen::Matrix< double, 1, Eigen::Dynamic, Eigen::RowMajor, 1, 3 > RowVectorNd
Definition Types.hpp:13