suanPan
CP4.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 ******************************************************************************/
33#ifndef CP4_H
34#define CP4_H
35
37
38class CP4 final : public MaterialElement2D {
39 struct IntegrationPoint final {
40 vec coor;
41 double weight;
42 unique_ptr<Material> m_material;
43 mat pn_pxy;
44 sp_mat strain_mat;
45 IntegrationPoint(vec&&, double, unique_ptr<Material>&&, mat&&);
46 };
47
48 static constexpr unsigned m_node = 4, m_dof = 2, m_size = m_dof * m_node;
49
50 static const vec h_mode;
51
52 const double thickness;
53
54 const bool reduced_scheme;
55
56 vector<IntegrationPoint> int_pt;
57
58 mat hourglassing;
59
60 static void stack_stiffness(mat&, const mat&, const sp_mat&, double);
61
62public:
63 CP4(
64 unsigned, // tag
65 uvec&&, // node tag
66 unsigned, // material tag
67 double = 1., // thickness
68 bool = false, // reduced integration
69 bool = false // nonlinear geometry switch
70 );
71
72 int initialize(const shared_ptr<DomainBase>&) override;
73
74 int update_status() override;
75
76 int commit_status() override;
77 int clear_status() override;
78 int reset_status() override;
79
80 [[nodiscard]] mat compute_shape_function(const mat&, unsigned) const override;
81
82 vector<vec> record(OutputType) override;
83
84 void print() override;
85
86#ifdef SUANPAN_VTK
87 void Setup() override;
88 void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
89 mat GetData(OutputType) override;
90 void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
91#endif
92};
93
94#endif
95
OutputType
Definition: OutputType.h:23
The CP4 class handles CPS4, CPE4, CPS4R and CPE4R elements. It is a four node constant strain membran...
Definition: CP4.h:38
int reset_status() override
Definition: CP4.cpp:368
CP4(unsigned, uvec &&, unsigned, double=1., bool=false, bool=false)
Definition: CP4.cpp:209
void print() override
Definition: CP4.cpp:382
int initialize(const shared_ptr< DomainBase > &) override
Definition: CP4.cpp:214
mat compute_shape_function(const mat &, unsigned) const override
Definition: CP4.cpp:374
int update_status() override
Definition: CP4.cpp:282
vector< vec > record(OutputType) override
Definition: CP4.cpp:376
int commit_status() override
Definition: CP4.cpp:356
int clear_status() override
Definition: CP4.cpp:362
Definition: MaterialElement.h:64