suanPan
NonlinearCDP.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  ******************************************************************************/
43 #ifndef NONLINEARCDP_H
44 #define NONLINEARCDP_H
45 
47 
50  const double g_t, g_c;
51  const double alpha, alpha_p, s0;
52 };
53 
54 class NonlinearCDP : protected DataNonlinearCDP, public Material3D {
55  static constexpr unsigned max_iteration = 20u;
56  static const double root_three_two;
57  static constexpr double scale = .999; // to avoid overshoot
58  static const mat unit_dev_tensor;
59 
60  const double bulk = elastic_modulus / (3. - 6. * poissons_ratio);
61  const double double_shear = elastic_modulus / (1. + poissons_ratio);
62  const double three_alpha_p_bulk = 3. * alpha_p * bulk;
63  const double pfplambda = -3. * alpha * three_alpha_p_bulk - root_three_two * double_shear;
64  const double one_minus_alpha = 1. - alpha;
65 
66  const vec unit_alpha_p{alpha_p, alpha_p, alpha_p, 0., 0., 0.};
67 
68  static double compute_r(const vec&);
69  static vec compute_dr(const vec&);
70 
71  [[nodiscard]] inline double compute_s(double) const;
72 
86  [[nodiscard]] virtual podarray<double> compute_tension_backbone(double) const = 0;
87 
101  [[nodiscard]] virtual podarray<double> compute_compression_backbone(double) const = 0;
102 
103 public:
104  NonlinearCDP(
105  unsigned, // tag
106  double, // elastic modulus
107  double, // poissons ratio
108  double, // normalized crack energy (+)
109  double, // normalized crush energy (+)
110  double, // dilatancy parameter
111  double, // biaxial compression strength ratio
112  double, // stiffness recovery
113  double // density
114  );
115 
116  int initialize(const shared_ptr<DomainBase>&) override;
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 Material3D class.
Definition: Material3D.h:37
The NonlinearCDP class.
Definition: NonlinearCDP.h:54
int initialize(const shared_ptr< DomainBase > &) override
Definition: NonlinearCDP.cpp:46
int commit_status() override
Definition: NonlinearCDP.cpp:227
int clear_status() override
Definition: NonlinearCDP.cpp:219
void print() override
Definition: NonlinearCDP.cpp:250
int reset_status() override
Definition: NonlinearCDP.cpp:235
vector< vec > record(OutputType) override
Definition: NonlinearCDP.cpp:243
NonlinearCDP(unsigned, double, double, double, double, double, double, double, double)
Definition: NonlinearCDP.cpp:42
int update_trial_status(const vec &) override
Definition: NonlinearCDP.cpp:56
double get_parameter(ParameterType) const override
Definition: NonlinearCDP.cpp:54
Definition: NonlinearCDP.h:48
const double g_t
Definition: NonlinearCDP.h:50
const double alpha
Definition: NonlinearCDP.h:51
const double g_c
Definition: NonlinearCDP.h:50
const double elastic_modulus
Definition: NonlinearCDP.h:49
const double alpha_p
Definition: NonlinearCDP.h:51
const double s0
Definition: NonlinearCDP.h:51
const double poissons_ratio
Definition: NonlinearCDP.h:49