suanPan
CDPM2.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2024 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 ******************************************************************************/
31#ifndef CDPM2_H
32#define CDPM2_H
33
35
36struct DataCDPM2 {
37 const double elastic_modulus = 3E4;
38 const double poissons_ratio = .3;
39 const double ft = 3.;
40 const double fc = 30.;
41 const double qh0 = .3;
42 const double hp = .01;
43 const double df = .85;
44 const double ah = .08;
45 const double bh = .003;
46 const double ch = 2.;
47 const double dh = 1E-6;
48 const double as = 5.;
49 const double eft = 5E-4;
50 const double efc = 5E-4;
51
52 const double e = [&] {
53 const auto fbc = 1.16 * fc;
54 const auto factor = ft / fbc * (fbc + fc) * (fbc - fc) / (fc + ft) / (fc - ft);
55 return (1. + factor) / (2. - factor);
56 }();
57 const double e0 = ft / elastic_modulus;
58 const double ftfc = ft / fc;
59 const double m0 = 3. * (fc / ft - ftfc) * e / (1. + e);
60 const double lndf = log(df + 1.) - log(2. * df - 1.);
61 const double sqrtdf = ft * sqrt(2. / (3. + 6. * df * df));
62 const double eh = bh - dh;
63 const double fh = ch * eh / (ah - bh);
64
65 const double ra = (1. + e) * (1. - e);
66 const double rb = pow(2. * e - 1., 2.);
67 const double rc = rb * e * (5. * e - 4.);
68};
69
70class CDPM2 final : protected DataCDPM2, public Material3D {
71public:
72 enum class DamageType {
73 NODAMAGE,
74 ISOTROPIC,
75 ANISOTROPIC
76 };
77
78private:
79 static constexpr unsigned max_iteration = 20u;
80 static const double sqrt_six;
81 static const double sqrt_three_two;
82 static const mat unit_dev_tensor;
83
84 const double double_shear = elastic_modulus / (1. + poissons_ratio);
85 const double bulk = elastic_modulus / (3. - 6. * poissons_ratio);
86
87 const DamageType damage_type = DamageType::ANISOTROPIC;
88
89 void compute_plasticity(double, double, double, double, vec&) const;
90 int compute_damage(double, double, double, double, double, vec&);
91 int compute_damage_factor(double, double, double, double, double&, vec&) const;
92
93public:
94 CDPM2(
95 unsigned, // tag
96 double, // elastic_modulus
97 double, // poissons_ratio
98 double, // ft
99 double, // fc
100 double, // qh0
101 double, // hp
102 double, // df
103 double, // ah
104 double, // bh
105 double, // ch
106 double, // dh
107 double, // as
108 double, // eft
109 double, // efc
110 DamageType, // damage type
111 double // density
112 );
113
114 int initialize(const shared_ptr<DomainBase>&) override;
115
117
118 [[nodiscard]] double get_parameter(ParameterType) const override;
119
120 int update_trial_status(const vec&) override;
121
122 int clear_status() override;
123 int commit_status() override;
124 int reset_status() override;
125
126 vector<vec> record(OutputType) override;
127
128 void print() override;
129};
130
131#endif
132
OutputType
Definition: OutputType.h:23
ParameterType
Definition: ParameterType.h:21
The CDPM2 class.
Definition: CDPM2.h:70
int initialize(const shared_ptr< DomainBase > &) override
Definition: CDPM2.cpp:361
int update_trial_status(const vec &) override
Definition: CDPM2.cpp:373
CDPM2(unsigned, double, double, double, double, double, double, double, double, double, double, double, double, double, double, DamageType, double)
Definition: CDPM2.cpp:356
DamageType
Definition: CDPM2.h:72
vector< vec > record(OutputType) override
Definition: CDPM2.cpp:667
double get_parameter(ParameterType) const override
Definition: CDPM2.cpp:371
void print() override
Definition: CDPM2.cpp:674
int reset_status() override
Definition: CDPM2.cpp:659
int clear_status() override
Definition: CDPM2.cpp:643
int commit_status() override
Definition: CDPM2.cpp:651
unique_ptr< Material > get_copy() override
Definition: CDPM2.cpp:369
The Material3D class.
Definition: Material3D.h:37
Definition: CDPM2.h:36
const double ch
Definition: CDPM2.h:46
const double eft
Definition: CDPM2.h:49
const double poissons_ratio
Definition: CDPM2.h:38
const double fh
Definition: CDPM2.h:63
const double as
Definition: CDPM2.h:48
const double lndf
Definition: CDPM2.h:60
const double ra
Definition: CDPM2.h:65
const double eh
Definition: CDPM2.h:62
const double rb
Definition: CDPM2.h:66
const double elastic_modulus
Definition: CDPM2.h:37
const double e
Definition: CDPM2.h:52
const double dh
Definition: CDPM2.h:47
const double qh0
Definition: CDPM2.h:41
const double df
Definition: CDPM2.h:43
const double ah
Definition: CDPM2.h:44
const double ft
Definition: CDPM2.h:39
const double bh
Definition: CDPM2.h:45
const double rc
Definition: CDPM2.h:67
const double m0
Definition: CDPM2.h:59
const double fc
Definition: CDPM2.h:40
const double ftfc
Definition: CDPM2.h:58
const double e0
Definition: CDPM2.h:57
const double efc
Definition: CDPM2.h:50
const double hp
Definition: CDPM2.h:42
const double sqrtdf
Definition: CDPM2.h:61