suanPan
Loading...
Searching...
No Matches
CP4.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2025 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 ******************************************************************************/
36#ifndef CP4_H
37#define CP4_H
38
40
41class CP4 final : public MaterialElement2D {
42 struct IntegrationPoint final {
43 vec coor;
44 double weight;
45 unique_ptr<Material> m_material;
46 mat pn_pxy;
47 sp_mat strain_mat;
48 IntegrationPoint(vec&&, double, unique_ptr<Material>&&, mat&&);
49 };
50
51 static constexpr unsigned m_node = 4, m_dof = 2, m_size = m_dof * m_node;
52
53 static const vec h_mode;
54
55 const double thickness, penalty;
56
57 const bool reduced_scheme;
58
59 std::vector<IntegrationPoint> int_pt;
60
61 mat hourglass;
62
63 static void stack_stiffness(mat&, const mat&, const sp_mat&, double);
64
65public:
66 CP4(
67 unsigned, // tag
68 uvec&&, // node tag
69 unsigned, // material tag
70 double, // thickness
71 double, // multiplier for hourglassing control
72 bool, // reduced integration
73 bool // nonlinear geometry switch
74 );
75
76 int initialize(const shared_ptr<DomainBase>&) override;
77
78 int update_status() override;
79
80 int commit_status() override;
81 int clear_status() override;
82 int reset_status() override;
83
84 [[nodiscard]] mat compute_shape_function(const mat&, unsigned) const override;
85
86 std::vector<vec> record(OutputType) override;
87
88 void print() override;
89
90#ifdef SUANPAN_VTK
91 void Setup() override;
92 void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
93 mat GetData(OutputType) override;
94 void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
95#endif
96};
97
98#endif
99
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:41
int reset_status() override
Definition CP4.cpp:373
void print() override
Definition CP4.cpp:387
int initialize(const shared_ptr< DomainBase > &) override
Definition CP4.cpp:216
mat compute_shape_function(const mat &, unsigned) const override
Definition CP4.cpp:379
int update_status() override
Definition CP4.cpp:287
std::vector< vec > record(OutputType) override
Definition CP4.cpp:381
int commit_status() override
Definition CP4.cpp:361
int clear_status() override
Definition CP4.cpp:367
Definition MaterialElement.h:60