suanPan
Loading...
Searching...
No Matches
CSMQ.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 ******************************************************************************/
30#ifndef CSMQ_H
31#define CSMQ_H
32
34
35class CSMQ : public MaterialElement2D {
36 struct IntegrationPoint final {
37 vec coor;
38 double weight;
39 unique_ptr<Material> m_material;
40 mat b1, b2, b3;
41 IntegrationPoint(vec&&, double, unique_ptr<Material>&&);
42 };
43
44 static constexpr unsigned m_dof = 3;
45
46 const unsigned m_node;
47
48 const unsigned m_size = m_dof * m_node;
49
50 const double thickness;
51
52 vector<IntegrationPoint> int_pt;
53
54 virtual const uvec& get_translation_dof() = 0;
55 virtual const uvec& get_rotation_dof() = 0;
56
57public:
58 CSMQ(unsigned, // tag
59 uvec&&, // node tag
60 unsigned, // material tag
61 unsigned, // number of nodes
62 double = 1., // thickness
63 double = -1. // length
64 );
65
66 int initialize(const shared_ptr<DomainBase>&) override;
67
68 int update_status() override;
69
70 int commit_status() override;
71 int clear_status() override;
72 int reset_status() override;
73
74 [[nodiscard]] mat compute_shape_function(const mat&, unsigned) const override;
75
76 vector<vec> record(OutputType) override;
77
78 void print() override;
79
80#ifdef SUANPAN_VTK
81 void Setup() override;
82 void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
83 mat GetData(OutputType) override;
84 void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
85#endif
86};
87
88class CSMQ5 final : public CSMQ {
89 static const uvec t_dof;
90 static const uvec r_dof;
91
92 const uvec& get_translation_dof() override;
93 const uvec& get_rotation_dof() override;
94
95public:
96 CSMQ5(unsigned, // tag
97 uvec&&, // node tag
98 unsigned, // material tag
99 double = 1., // thickness
100 double = -1. // length
101 );
102};
103
104class CSMQ6 final : public CSMQ {
105 static const uvec t_dof;
106 static const uvec r_dof;
107
108 const uvec& get_translation_dof() override;
109 const uvec& get_rotation_dof() override;
110
111public:
112 CSMQ6(unsigned, // tag
113 uvec&&, // node tag
114 unsigned, // material tag
115 double = 1., // thickness
116 double = -1. // length
117 );
118};
119
120class CSMQ7 final : public CSMQ {
121 static const uvec t_dof;
122 static const uvec r_dof;
123
124 const uvec& get_translation_dof() override;
125 const uvec& get_rotation_dof() override;
126
127public:
128 CSMQ7(unsigned, // tag
129 uvec&&, // node tag
130 unsigned, // material tag
131 double = 1., // thickness
132 double = -1. // length
133 );
134};
135
136#endif
137
OutputType
Definition OutputType.h:21
Definition CSMQ.h:88
Definition CSMQ.h:104
Definition CSMQ.h:120
The CSMQ class.
Definition CSMQ.h:35
int initialize(const shared_ptr< DomainBase > &) override
Definition CSMQ.cpp:36
int commit_status() override
Definition CSMQ.cpp:174
mat compute_shape_function(const mat &, unsigned) const override
Definition CSMQ.cpp:192
vector< vec > record(OutputType) override
Definition CSMQ.cpp:194
int reset_status() override
Definition CSMQ.cpp:186
void print() override
Definition CSMQ.cpp:200
int clear_status() override
Definition CSMQ.cpp:180
int update_status() override
Definition CSMQ.cpp:149
Definition MaterialElement.h:62