suanPan
CDPM2.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (C) 2017-2023 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 
36 struct DataCDPM2 {
37  const double elastic_modulus = 3E4;
38  const double poissons_ratio = .3;
39  const double ft = 3.;
40  const double fc = 10.;
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 = 2E-4;
50  const double efc = 1E-4;
51 
52  const double e = 1.;
53  const double e0 = ft / elastic_modulus;
54  const double ftfc = ft / fc;
55  const double m0 = 3. * (fc / ft - ftfc) * e / (1. + e);
56  const double lndf = log(df + 1.) - log(2. * df - 1.);
57  const double sqrtdf = ft * sqrt(2. / (3. + 6. * df * df));
58  const double eh = bh - dh;
59  const double fh = ch * eh / (ah - bh);
60 };
61 
62 class CDPM2 final : protected DataCDPM2, public Material3D {
63 public:
64  enum class DamageType {
65  NODAMAGE,
66  ISOTROPIC,
68  };
69 
70 private:
71  static constexpr unsigned max_iteration = 20;
72  static const double sqrt_six;
73  static const double sqrt_three_two;
74  static const mat unit_dev_tensor;
75 
76  const double double_shear = elastic_modulus / (1. + poissons_ratio);
77  const double bulk = elastic_modulus / (3. - 6. * poissons_ratio);
78 
79  const DamageType damage_type = DamageType::ANISOTROPIC;
80 
81  void compute_plasticity(double, double, double, podarray<double>&) const;
82  int compute_damage(double, double, double, double, double, podarray<double>&);
83  int compute_damage_factor(double, double, double, double, double&, podarray<double>&) const;
84 
85 public:
86  CDPM2(unsigned, // tag
87  double, // elastic_modulus
88  double, // poissons_ratio
89  double, // ft
90  double, // fc
91  double, // qh0
92  double, // hp
93  double, // df
94  double, // ah
95  double, // bh
96  double, // ch
97  double, // dh
98  double, // as
99  double, // eft
100  double, // efc
101  DamageType, // damage type
102  double // density
103  );
104 
105  int initialize(const shared_ptr<DomainBase>&) override;
106 
107  unique_ptr<Material> get_copy() override;
108 
109  [[nodiscard]] double get_parameter(ParameterType) const override;
110 
111  int update_trial_status(const vec&) override;
112 
113  int clear_status() override;
114  int commit_status() override;
115  int reset_status() override;
116 
117  vector<vec> record(OutputType) override;
118 
119  void print() override;
120 };
121 
122 #endif
123 
OutputType
Definition: OutputType.h:21
ParameterType
Definition: ParameterType.h:21
The CDPM2 class.
Definition: CDPM2.h:62
int initialize(const shared_ptr< DomainBase > &) override
Definition: CDPM2.cpp:321
int update_trial_status(const vec &) override
Definition: CDPM2.cpp:340
CDPM2(unsigned, double, double, double, double, double, double, double, double, double, double, double, double, double, double, DamageType, double)
Definition: CDPM2.cpp:316
DamageType
Definition: CDPM2.h:64
vector< vec > record(OutputType) override
Definition: CDPM2.cpp:559
double get_parameter(ParameterType) const override
Definition: CDPM2.cpp:331
void print() override
Definition: CDPM2.cpp:567
int reset_status() override
Definition: CDPM2.cpp:551
int clear_status() override
Definition: CDPM2.cpp:535
int commit_status() override
Definition: CDPM2.cpp:543
unique_ptr< Material > get_copy() override
Definition: CDPM2.cpp:329
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:59
const double as
Definition: CDPM2.h:48
const double lndf
Definition: CDPM2.h:56
const double eh
Definition: CDPM2.h:58
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 m0
Definition: CDPM2.h:55
const double fc
Definition: CDPM2.h:40
const double ftfc
Definition: CDPM2.h:54
const double e0
Definition: CDPM2.h:53
const double efc
Definition: CDPM2.h:50
const double hp
Definition: CDPM2.h:42
const double sqrtdf
Definition: CDPM2.h:57