PolyFEM
Loading...
Searching...
No Matches
HGOFiber.hpp
Go to the documentation of this file.
1#pragma once
2
5
6namespace polyfem::assembler
7{
8 class HGOFiber : public GenericFiber<HGOFiber>
9 {
10 public:
11 HGOFiber();
12
13 // sets material params
14 void add_multimaterial(const int index, const json &params, const Units &units) override;
15
16 std::string name() const override { return "HGOFiber"; }
17 std::map<std::string, ParamFunc> parameters() const override;
18
19 template <typename T>
21 const RowVectorNd &p,
22 const double t,
23 const int el_id,
24 const DefGradMatrix<T> &def_grad) const
25 {
26 const double k1 = k1_(p, t, el_id);
27 const double k2 = k2_(p, t, el_id);
28 const T i4Bar = I4Bar(p, t, el_id, def_grad);
29
30 const T temp = i4Bar - T(1.0);
31
32 return (k1 / (2.0 * k2)) * (exp(k2 * temp * temp) - 1.0);
33 }
34
35 private:
38 };
39} // namespace polyfem::assembler
T I4Bar(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
Definition HGOFiber.cpp:10
std::map< std::string, ParamFunc > parameters() const override
Definition HGOFiber.cpp:20
T elastic_energy(const RowVectorNd &p, const double t, const int el_id, const DefGradMatrix< T > &def_grad) const
Definition HGOFiber.hpp:20
std::string name() const override
Definition HGOFiber.hpp:16
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