suanPan
SimpleSand.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 SIMPLESAND_H
32 #define SIMPLESAND_H
33 
35 
37  const double elastic_modulus; // elastic modulus
38  const double poissons_ratio; // poisson's ratio
39  const double m = .01;
40  const double a = -.7;
41  const double h = 5.;
42  const double ac = 1.25;
43  const double nb = 1.1;
44  const double nd = 3.5;
45  const double vc = 1.915;
46  const double pc = -130.;
47  const double lc = .02;
48  const double v0 = 2.;
49 };
50 
51 class SimpleSand final : DataSimpleSand, public Material3D {
52  static constexpr unsigned max_iteration = 20;
53  static const mat unit_dev_tensor;
54 
55  static constexpr uword sa = 0, sb = 1;
56  static const span sc, sd;
57 
58  const double shear = elastic_modulus / (2. + 2. * poissons_ratio); // shear modulus
59  const double double_shear = 2. * shear; // double shear
60  const double bulk = elastic_modulus / (3. - 6. * poissons_ratio);
61 
62 public:
63  SimpleSand(unsigned, // tag
64  double, // elastic modulus
65  double, // poissons ratio
66  double, // m
67  double, // A
68  double, // h
69  double, // alpha_c
70  double, // n_b
71  double, // n_d
72  double, // v_c
73  double, // p_c
74  double, // lambda_c
75  double, // v_0
76  double = 0. // density
77  );
78 
79  int initialize(const shared_ptr<DomainBase>&) override;
80 
81  unique_ptr<Material> get_copy() override;
82 
83  [[nodiscard]] double get_parameter(ParameterType) const override;
84 
85  int update_trial_status(const vec&) override;
86 
87  int clear_status() override;
88  int commit_status() override;
89  int reset_status() override;
90 
91  void print() override;
92 };
93 
94 #endif
95 
ParameterType
Definition: ParameterType.h:21
The Material3D class.
Definition: Material3D.h:37
The SimpleSand class.
Definition: SimpleSand.h:51
void print() override
Definition: SimpleSand.cpp:178
int update_trial_status(const vec &) override
Definition: SimpleSand.cpp:48
int initialize(const shared_ptr< DomainBase > &) override
Definition: SimpleSand.cpp:29
int clear_status() override
Definition: SimpleSand.cpp:154
double get_parameter(ParameterType) const override
Definition: SimpleSand.cpp:39
unique_ptr< Material > get_copy() override
Definition: SimpleSand.cpp:37
int reset_status() override
Definition: SimpleSand.cpp:170
SimpleSand(unsigned, double, double, double, double, double, double, double, double, double, double, double, double, double=0.)
Definition: SimpleSand.cpp:25
int commit_status() override
Definition: SimpleSand.cpp:162
Definition: SimpleSand.h:36
const double v0
Definition: SimpleSand.h:48
const double nd
Definition: SimpleSand.h:44
const double lc
Definition: SimpleSand.h:47
const double elastic_modulus
Definition: SimpleSand.h:37
const double pc
Definition: SimpleSand.h:46
const double poissons_ratio
Definition: SimpleSand.h:38
const double ac
Definition: SimpleSand.h:42
const double vc
Definition: SimpleSand.h:45
const double m
Definition: SimpleSand.h:39
const double h
Definition: SimpleSand.h:41
const double a
Definition: SimpleSand.h:40
const double nb
Definition: SimpleSand.h:43