suanPan
Flag.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 ******************************************************************************/
28#ifndef FLAG_H
29#define FLAG_H
30
32
33struct 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
50class Flag final : protected 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
63public:
64 Flag(
65 unsigned, // tag
66 double, // elastic modulus
67 double, // tension initial yield stress
68 double, // tension residual stress
69 double, // tension hardening ratio
70 double, // compression initial yield stress
71 double, // compression residual stress
72 double, // compression hardening ratio
73 double // density
74 );
75 Flag(
76 unsigned, // tag
77 double, // elastic modulus
78 double, // initial yield stress
79 double, // residual stress
80 double, // hardening ratio
81 double // density
82 );
83
84 int initialize(const shared_ptr<DomainBase>&) override;
85
87
88 int update_trial_status(const vec&) override;
89
90 int clear_status() override;
91 int commit_status() override;
92 int reset_status() override;
93
94 void print() override;
95};
96
97#endif
98
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