suanPan
Loading...
Searching...
No Matches
YLD0418P.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2025 Theodore Chang
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 ******************************************************************************/
29#ifndef YLD0418P_H
30#define YLD0418P_H
31
33#include <Toolbox/Expression.h>
35
37 struct Saturation {
38 Saturation(const double R, const double B)
39 : rate(R)
40 , bound(B) {}
41
42 const double rate, bound;
43
44 const bool active = rate > 0. && bound > 0.;
45 };
46
47 const vec modulus, ratio, parameter;
48 const double exponent;
49 const double ref_stress; // reference stress for scaling
50
52};
53
54class YLD0418P final : protected DataYLD0418P, public Material3D {
55 static constexpr double two_third = 2. / 3.;
56 static const double root_two_third;
57 static constexpr unsigned max_iteration = 20u;
58 static constexpr uword sa{0};
59 static const span sb, sc;
60 static const mat unit_dev_tensor;
61
62 const unsigned hardening_tag;
63
64 ResourceHolder<Expression> hardening_expression;
65
66 mat66 dev_ini_stiffness;
67 mat66 C1, C2;
68
69 [[nodiscard]] std::pair<double, double> compute_hardening(const double pe) const {
70 if(const auto k = hardening_expression->evaluate(pe).at(0); k >= 0.) return {k, hardening_expression->gradient(pe).at(0)};
71
72 return {0., 0.};
73 };
74
75 using yield_t = std::tuple<const double, const vec6, mat66>;
76
77 [[nodiscard]] yield_t compute_yield_surface(const vec3&, const mat33&, const vec3&, const mat33&) const;
78
79 int with_kinematic();
80 int without_kinematic();
81
82public:
84 unsigned, // tag
85 vec&&, // elastic modulus
86 vec&&, // poissons ratio
87 vec&&, // parameter (18)
88 double, // exponent
89 double, // reference stress
90 unsigned, // hardening expression tag
91 double, // kinematic rate
92 double, // kinematic bound
93 double // density
94 );
95
96 int initialize(const shared_ptr<DomainBase>&) override;
97
98 unique_ptr<Material> get_copy() override;
99
100 int update_trial_status(const vec&) override;
101
102 int clear_status() override;
103 int commit_status() override;
104 int reset_status() override;
105
106 void print() override;
107};
108
109#endif
110
The Material3D class.
Definition Material3D.h:35
Definition ResourceHolder.h:32
The YLD0418P class.
Definition YLD0418P.h:54
int initialize(const shared_ptr< DomainBase > &) override
Definition YLD0418P.cpp:109
void print() override
Definition YLD0418P.cpp:318
int reset_status() override
Definition YLD0418P.cpp:310
int commit_status() override
Definition YLD0418P.cpp:302
unique_ptr< Material > get_copy() override
Definition YLD0418P.cpp:131
int update_trial_status(const vec &) override
Definition YLD0418P.cpp:133
int clear_status() override
Definition YLD0418P.cpp:294
Definition YLD0418P.h:37
const double bound
Definition YLD0418P.h:42
const double rate
Definition YLD0418P.h:42
const bool active
Definition YLD0418P.h:44
Saturation(const double R, const double B)
Definition YLD0418P.h:38
Definition YLD0418P.h:36
const vec modulus
Definition YLD0418P.h:47
const double exponent
Definition YLD0418P.h:48
const vec parameter
Definition YLD0418P.h:47
const Saturation kin
Definition YLD0418P.h:51
const vec ratio
Definition YLD0418P.h:47
const double ref_stress
Definition YLD0418P.h:49