suanPan
MaterialExample.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 ******************************************************************************/
29#ifndef MATERIALEXAMPLE_H
30#define MATERIALEXAMPLE_H
31
32#include <Material/Material.h>
33
40 const double elastic_modulus; // elastic modulus
41 const double yield_stress; // initial yield stress
42 const double hardening_ratio; // hardening ratio
43 const double beta; // isotropic/kinematic hardening factor
44 const double plastic_modulus; // plastic modulus
45};
46
48 double current_back_stress = 0.;
49 double current_plastic_strain = 0.;
50 double trial_back_stress = 0.;
51 double trial_plastic_strain = 0.;
52
53public:
54 explicit MaterialExample(unsigned = 0, // tag
55 double = 2E5, // elastic modulus
56 double = 400., // initial yield stress
57 double = .05, // hardening ratio
58 double = 0., // isotropic/kinematic hardening factor
59 double = 0. // density
60 );
61
62 int initialize(const shared_ptr<DomainBase>&) override;
63
65
66 int update_trial_status(const vec&) override;
67
68 int clear_status() override;
69 int commit_status() override;
70 int reset_status() override;
71
72 void print() override;
73};
74
76
77#endif
78
A MaterialExample material class.
Definition: MaterialExample.h:47
int clear_status() override
Operations are required to achieve the following objective.
Definition: MaterialExample.cpp:178
void print() override
Definition: MaterialExample.cpp:219
int commit_status() override
Operations are required to achieve the following objective.
Definition: MaterialExample.cpp:194
int update_trial_status(const vec &) override
There are two states we are managing at any time point. The current state is the converged state from...
Definition: MaterialExample.cpp:143
int reset_status() override
Operations are required to achieve the following objective.
Definition: MaterialExample.cpp:210
int initialize(const shared_ptr< DomainBase > &) override
Unless the target material model involves other material models to compute responses,...
Definition: MaterialExample.cpp:107
MaterialExample(unsigned=0, double=2E5, double=400., double=.05, double=0., double=0.)
The constructor of material model depends on the specific model to be implemented....
Definition: MaterialExample.cpp:86
unique_ptr< Material > get_copy() override
The get_copy() method should always be implemented with make_unique. In case the model defines other ...
Definition: MaterialExample.cpp:125
A Material abstract base class.
Definition: Material.h:111
SUANPAN_EXPORT void new_materialexample(unique_ptr< Material > &, istringstream &)
Definition: MaterialExample.cpp:21
It is recommended to store data, especially constant data, in a simple structure. The motivation is t...
Definition: MaterialExample.h:39
const double hardening_ratio
Definition: MaterialExample.h:42
const double elastic_modulus
Definition: MaterialExample.h:40
const double yield_stress
Definition: MaterialExample.h:41
const double plastic_modulus
Definition: MaterialExample.h:44
const double beta
Definition: MaterialExample.h:43
#define SUANPAN_EXPORT
Definition: suanPan.h:154