suanPan
NonlinearJ2.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 NONLINEARJ2_H
32 #define NONLINEARJ2_H
33 
35 
37  const double elastic_modulus; // elastic modulus
38  const double poissons_ratio; // poisson's ratio
39 };
40 
41 class NonlinearJ2 : protected DataNonlinearJ2, public Material3D {
42  static constexpr unsigned max_iteration = 20;
43  static constexpr double two_third = 2. / 3.;
44  static const double root_two_third;
45  static const mat unit_dev_tensor;
46 
47  const double shear_modulus = elastic_modulus / (2. + 2. * poissons_ratio); // shear modulus
48  const double double_shear = 2. * shear_modulus; // double shear modulus
49  const double square_double_shear = double_shear * double_shear; // square shear modulus
50 
51  [[nodiscard]] virtual double compute_k(double) const = 0;
52  [[nodiscard]] virtual double compute_dk(double) const = 0;
53  [[nodiscard]] virtual double compute_h(double) const = 0;
54  [[nodiscard]] virtual double compute_dh(double) const = 0;
55 
56 public:
57  NonlinearJ2(unsigned, // tag
58  double, // elastic modulus
59  double, // poisson's ratio
60  double = 0. // density
61  );
62 
63  int initialize(const shared_ptr<DomainBase>&) override;
64 
65  [[nodiscard]] double get_parameter(ParameterType) const override;
66 
67  int update_trial_status(const vec&) override;
68 
69  int clear_status() override;
70  int commit_status() override;
71  int reset_status() override;
72 
73  vector<vec> record(OutputType) override;
74 
75  void print() override;
76 };
77 
78 #endif
79 
OutputType
Definition: OutputType.h:21
ParameterType
Definition: ParameterType.h:21
The Material3D class.
Definition: Material3D.h:37
The NonlinearJ2 class.
Definition: NonlinearJ2.h:41
int clear_status() override
Definition: NonlinearJ2.cpp:104
int reset_status() override
Definition: NonlinearJ2.cpp:120
int commit_status() override
Definition: NonlinearJ2.cpp:112
double get_parameter(ParameterType) const override
Definition: NonlinearJ2.cpp:37
int update_trial_status(const vec &) override
Definition: NonlinearJ2.cpp:46
int initialize(const shared_ptr< DomainBase > &) override
Definition: NonlinearJ2.cpp:29
vector< vec > record(OutputType) override
Definition: NonlinearJ2.cpp:128
NonlinearJ2(unsigned, double, double, double=0.)
Definition: NonlinearJ2.cpp:25
void print() override
Definition: NonlinearJ2.cpp:134
Definition: NonlinearJ2.h:36
const double elastic_modulus
Definition: NonlinearJ2.h:37
const double poissons_ratio
Definition: NonlinearJ2.h:38