suanPan
SGCMQ.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 ******************************************************************************/
34#ifndef SGCMQ_H
35#define SGCMQ_H
36
38
39class SGCMQ : public MaterialElement2D {
40 struct IntegrationPoint final {
41 vec coor;
42 const double factor;
43 unique_ptr<Material> m_material;
44 mat poly_stress, poly_strain;
45 IntegrationPoint(vec&&, double, unique_ptr<Material>&&);
46 };
47
48protected:
49 static constexpr unsigned m_node = 4, m_dof = 3, m_size = m_dof * m_node;
50
51 static const mat mapping;
52
53 const double thickness;
54
55 const char scheme;
56
57 vector<IntegrationPoint> int_pt;
58
59 static vec form_diff_coor(const mat&);
60 static mat form_drilling_n(const vec&, const vec&);
61 static mat form_drilling_dn(const vec&, const vec&);
62 static mat form_displacement_dn(const mat&, const mat&);
63 static vec form_stress_mode(double, double);
64 void form_mass(double, const mat&);
65 void form_body_force(const mat&);
66
67public:
68 SGCMQ(
69 unsigned, // element tag
70 uvec&&, // node tag
71 unsigned, // material tag
72 double = 1., // thickness
73 char = 'I' // integration type
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 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
Definition: MaterialElement.h:64
A SGCMQ class.
Definition: SGCMQ.h:39
int reset_status() override
Definition: SGCMQ.cpp:237
int initialize(const shared_ptr< DomainBase > &) override
Definition: SGCMQ.cpp:159
int update_status() override
Definition: SGCMQ.cpp:211
static mat form_drilling_dn(const vec &, const vec &)
Definition: SGCMQ.cpp:75
const double thickness
Definition: SGCMQ.h:53
static constexpr unsigned m_node
Definition: SGCMQ.h:49
mat compute_shape_function(const mat &, unsigned) const override
Definition: SGCMQ.cpp:243
void print() override
Definition: SGCMQ.cpp:251
static constexpr unsigned m_dof
Definition: SGCMQ.h:49
static const mat mapping
Definition: SGCMQ.h:51
void form_mass(double, const mat &)
Definition: SGCMQ.cpp:121
static mat form_displacement_dn(const mat &, const mat &)
Definition: SGCMQ.cpp:105
int clear_status() override
Definition: SGCMQ.cpp:231
vector< IntegrationPoint > int_pt
Definition: SGCMQ.h:57
static mat form_drilling_n(const vec &, const vec &)
Definition: SGCMQ.cpp:53
int commit_status() override
Definition: SGCMQ.cpp:225
static constexpr unsigned m_size
Definition: SGCMQ.h:49
vector< vec > record(OutputType) override
Definition: SGCMQ.cpp:245
const char scheme
Definition: SGCMQ.h:55
SGCMQ(unsigned, uvec &&, unsigned, double=1., char='I')
Definition: SGCMQ.cpp:154
static vec form_stress_mode(double, double)
Definition: SGCMQ.cpp:119
static vec form_diff_coor(const mat &)
Definition: SGCMQ.cpp:38
void form_body_force(const mat &)
Definition: SGCMQ.cpp:142