suanPan
Flag.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (C) 2017-2022 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  ******************************************************************************/
28 #ifndef FLAG_H
29 #define FLAG_H
30 
32 
33 struct DataFlag {
34  const double elastic_modulus; // elastic modulus
35 
36  const double t_hardening_ratio;
37  const double t_yield_stress;
38  const double t_residual_stress;
39 
40  const double c_hardening_ratio;
41  const double c_yield_stress;
42  const double c_residual_stress;
43 
48 };
49 
50 class Flag final : DataFlag, public Material1D {
51  enum class Status {
52  NONE,
53  TLOAD,
54  TUNLOAD,
55  TLOW,
56  CLOAD,
57  CUNLOAD,
58  CLOW
59  };
60 
61  Status trial_status = Status::NONE, current_status = Status::NONE;
62 
63 public:
64  Flag(unsigned, // tag
65  double, // elastic modulus
66  double, // tension initial yield stress
67  double, // tension residual stress
68  double, // tension hardening ratio
69  double, // compression initial yield stress
70  double, // compression residual stress
71  double, // compression hardening ratio
72  double // density
73  );
74  Flag(unsigned, // tag
75  double, // elastic modulus
76  double, // initial yield stress
77  double, // residual stress
78  double, // hardening ratio
79  double // density
80  );
81 
82  int initialize(const shared_ptr<DomainBase>&) override;
83 
84  unique_ptr<Material> get_copy() override;
85 
86  int update_trial_status(const vec&) override;
87 
88  int clear_status() override;
89  int commit_status() override;
90  int reset_status() override;
91 
92  void print() override;
93 };
94 
95 #endif
96 
A Flag material class.
Definition: Flag.h:50
int update_trial_status(const vec &) override
Definition: Flag.cpp:39
int initialize(const shared_ptr< DomainBase > &) override
Definition: Flag.cpp:29
int commit_status() override
Definition: Flag.cpp:111
int reset_status() override
Definition: Flag.cpp:120
Flag(unsigned, double, double, double, double, double, double, double, double)
Definition: Flag.cpp:21
void print() override
Definition: Flag.cpp:129
unique_ptr< Material > get_copy() override
Definition: Flag.cpp:37
int clear_status() override
Definition: Flag.cpp:102
A Material1D class.
Definition: Material1D.h:36
@ NONE
Definition: Flag.h:33
const double c_yield_stress
Definition: Flag.h:41
const double t_yield_stress
Definition: Flag.h:37
const double t_yield_strain
Definition: Flag.h:44
const double c_hardening_ratio
Definition: Flag.h:40
const double elastic_modulus
Definition: Flag.h:34
const double c_yield_strain
Definition: Flag.h:46
const double c_residual_strain
Definition: Flag.h:47
const double c_residual_stress
Definition: Flag.h:42
const double t_residual_strain
Definition: Flag.h:45
const double t_hardening_ratio
Definition: Flag.h:36
const double t_residual_stress
Definition: Flag.h:38