suanPan
NonlinearJ2.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 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 = 20u;
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:
58  unsigned, // tag
59  double, // elastic modulus
60  double, // poisson's ratio
61  double = 0. // density
62  );
63 
64  int initialize(const shared_ptr<DomainBase>&) override;
65 
66  [[nodiscard]] double get_parameter(ParameterType) const override;
67 
68  int update_trial_status(const vec&) override;
69 
70  int clear_status() override;
71  int commit_status() override;
72  int reset_status() override;
73 
74  void print() override;
75 };
76 
77 #endif
78 
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:100
int reset_status() override
Definition: NonlinearJ2.cpp:116
int commit_status() override
Definition: NonlinearJ2.cpp:108
double get_parameter(ParameterType) const override
Definition: NonlinearJ2.cpp:37
int update_trial_status(const vec &) override
Definition: NonlinearJ2.cpp:39
int initialize(const shared_ptr< DomainBase > &) override
Definition: NonlinearJ2.cpp:29
NonlinearJ2(unsigned, double, double, double=0.)
Definition: NonlinearJ2.cpp:25
void print() override
Definition: NonlinearJ2.cpp:124
Definition: NonlinearJ2.h:36
const double elastic_modulus
Definition: NonlinearJ2.h:37
const double poissons_ratio
Definition: NonlinearJ2.h:38