suanPan
Loading...
Searching...
No Matches
Section.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 ******************************************************************************/
28#ifndef SECTION_H
29#define SECTION_H
30
31#include <Domain/Tag.h>
33
34enum class SectionType : unsigned {
35 D0 = 0,
36 D1 = 1,
37 D2 = 2,
38 D3 = 3,
39 NM2D = 3,
40 NM3D = 6
41};
42
43enum class OutputType;
44
45class DomainBase;
46class Material;
47
49 const unsigned material_tag; // material tag
50
52
53 const double area;
54
55 const double linear_density;
56
57 const vec eccentricity;
58
59 vec trial_deformation; // trial deformation
60 vec current_deformation; // current deformation
61
62 vec trial_deformation_rate; // trial deformation rate
63 vec current_deformation_rate; // current deformation rate
64
65 vec trial_resistance; // trial resistance
66 vec current_resistance; // current resistance
67
68 mat initial_stiffness; // initial stiffness matrix
69 mat current_stiffness; // stiffness matrix
70 mat trial_stiffness; // stiffness matrix
71};
72
73class Section : protected DataSection, public Tag {
74 const bool initialized = false;
75 const bool symmetric = false;
76
77public:
78 explicit Section(unsigned = 0, // section tag
79 SectionType = SectionType::D0, // section type
80 unsigned = 0, // material tag
81 double = 0., // area
82 vec&& = {0., 0.} // eccentricity
83 );
84 Section(const Section&) = default; // default copy ctor
85 Section(Section&&) = delete; // move forbidden
86 Section& operator=(const Section&) = delete; // assign forbidden
87 Section& operator=(Section&&) = delete; // assign forbidden
88
89 ~Section() override = default;
90
91 int initialize_base(const shared_ptr<DomainBase>&);
92
93 virtual int initialize(const shared_ptr<DomainBase>&) = 0;
94
95 void set_initialized(bool) const;
96 void set_symmetric(bool) const;
97 [[nodiscard]] bool is_initialized() const;
98 [[nodiscard]] bool is_symmetric() const;
99
100 [[nodiscard]] SectionType get_section_type() const;
101
102 void set_eccentricity(const vec&) const;
103 [[nodiscard]] const vec& get_eccentricity() const;
104
105 [[nodiscard]] virtual const vec& get_trial_deformation() const;
106 [[nodiscard]] virtual const vec& get_trial_deformation_rate() const;
107 [[nodiscard]] virtual const vec& get_trial_resistance() const;
108 [[nodiscard]] virtual const mat& get_trial_stiffness() const;
109
110 [[nodiscard]] virtual const vec& get_current_deformation() const;
111 [[nodiscard]] virtual const vec& get_current_deformation_rate() const;
112 [[nodiscard]] virtual const vec& get_current_resistance() const;
113 [[nodiscard]] virtual const mat& get_current_stiffness() const;
114
115 [[nodiscard]] virtual const mat& get_initial_stiffness() const;
116
117 virtual unique_ptr<Section> get_copy() = 0;
118
120
121 int update_incre_status(double);
122 int update_incre_status(double, double);
123 int update_trial_status(double);
124 int update_trial_status(double, double);
125
126 virtual int update_incre_status(const vec&);
127 virtual int update_incre_status(const vec&, const vec&);
128 virtual int update_trial_status(const vec&);
129 virtual int update_trial_status(const vec&, const vec&);
130
131 virtual int clear_status() = 0;
132 virtual int commit_status() = 0;
133 virtual int reset_status() = 0;
134
135 virtual std::vector<vec> record(OutputType);
136};
137
138namespace suanpan {
139 unique_ptr<Section> make_copy(const shared_ptr<Section>&);
140 unique_ptr<Section> make_copy(const unique_ptr<Section>&);
141 unique_ptr<Section> initialized_section_copy(const shared_ptr<DomainBase>&, uword);
142} // namespace suanpan
143
144#endif
145
OutputType
Definition OutputType.h:21
ParameterType
Definition ParameterType.h:21
The DomainBase class is a template.
Definition DomainBase.h:104
A Material abstract base class.
Definition Material.h:102
A Section class.
Definition Section.h:73
bool is_initialized() const
Definition Section.cpp:57
void set_symmetric(bool) const
Definition Section.cpp:55
virtual const vec & get_trial_deformation() const
Definition Section.cpp:67
void set_eccentricity(const vec &) const
Definition Section.cpp:63
virtual double get_parameter(ParameterType=ParameterType::NONE)
Definition Section.cpp:85
virtual int clear_status()=0
int update_incre_status(double)
Definition Section.cpp:92
Section & operator=(const Section &)=delete
const vec & get_eccentricity() const
Definition Section.cpp:65
SectionType get_section_type() const
Definition Section.cpp:61
virtual const mat & get_initial_stiffness() const
Definition Section.cpp:83
virtual const vec & get_trial_resistance() const
Definition Section.cpp:71
void set_initialized(bool) const
Definition Section.cpp:53
~Section() override=default
int initialize_base(const shared_ptr< DomainBase > &)
Definition Section.cpp:27
virtual std::vector< vec > record(OutputType)
Definition Section.cpp:122
virtual const mat & get_current_stiffness() const
Definition Section.cpp:81
virtual const vec & get_trial_deformation_rate() const
Definition Section.cpp:69
int update_trial_status(double)
Definition Section.cpp:103
Section(Section &&)=delete
virtual int commit_status()=0
virtual const vec & get_current_resistance() const
Definition Section.cpp:79
bool is_symmetric() const
Definition Section.cpp:59
Section(const Section &)=default
Section & operator=(Section &&)=delete
virtual const vec & get_current_deformation() const
Definition Section.cpp:75
virtual int reset_status()=0
virtual const vec & get_current_deformation_rate() const
Definition Section.cpp:77
virtual int initialize(const shared_ptr< DomainBase > &)=0
virtual unique_ptr< Section > get_copy()=0
virtual const mat & get_trial_stiffness() const
Definition Section.cpp:73
A base Tag class.
Definition Tag.h:38
SectionType
Definition Section.h:34
Definition MatrixModifier.hpp:36
unique_ptr< Material > make_copy(const shared_ptr< Material > &)
Definition Material.cpp:356
unique_ptr< Section > initialized_section_copy(const shared_ptr< DomainBase > &, uword)
Definition Section.cpp:135
Definition Section.h:48
vec trial_deformation
Definition Section.h:59
mat initial_stiffness
Definition Section.h:68
vec trial_resistance
Definition Section.h:65
mat current_stiffness
Definition Section.h:69
vec trial_deformation_rate
Definition Section.h:62
const SectionType section_type
Definition Section.h:51
const unsigned material_tag
Definition Section.h:49
vec current_deformation
Definition Section.h:60
const vec eccentricity
Definition Section.h:57
vec current_resistance
Definition Section.h:66
const double linear_density
Definition Section.h:55
vec current_deformation_rate
Definition Section.h:63
mat trial_stiffness
Definition Section.h:70
const double area
Definition Section.h:53