suanPan
🧮 An Open Source, Parallel and Heterogeneous Finite Element Analysis Framework
Loading...
Searching...
No Matches
SGCMQ.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2026 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 const double objective_length;
55
56 const char scheme;
57
58 std::vector<IntegrationPoint> int_pt;
59
60 [[nodiscard]] vec form_diff_coor(const mat&) const;
61 static mat form_drilling_n(const vec&, const vec&);
62 static mat form_drilling_dn(const vec&, const vec&);
63 static mat form_displacement_dn(const mat&, const mat&);
64 static vec form_stress_mode(double, double);
65 void form_mass(double, const mat&);
66 void form_body_force(const mat&);
67
68public:
69 SGCMQ(
70 unsigned, // element tag
71 uvec&&, // node tag
72 unsigned, // material tag
73 double, // thickness
74 double, // objective_length
75 char // integration type
76 );
77
78 int initialize(const shared_ptr<DomainBase>&) override;
79
80 int update_status() override;
81
82 int commit_status() override;
83 int clear_status() override;
84 int reset_status() override;
85
86 [[nodiscard]] mat compute_shape_function(const mat&, unsigned) const override;
87
88 [[nodiscard]] std::vector<vec> record(OutputType) const override;
89
90 void print() override;
91
92#ifdef SUANPAN_VTK
93 [[nodiscard]] vtkSmartPointer<vtkCell> GetCell() const override;
94
95 mat GetData(OutputType) override;
96 mat GetDeformation(double) override;
97#endif
98};
99
100#endif
101
OutputType
Definition OutputType.h:23
Definition MaterialElement.h:60
A SGCMQ class.
Definition SGCMQ.h:39
int reset_status() override
Definition SGCMQ.cpp:247
int initialize(const shared_ptr< DomainBase > &) override
Definition SGCMQ.cpp:169
int update_status() override
Definition SGCMQ.cpp:221
static mat form_drilling_dn(const vec &, const vec &)
Definition SGCMQ.cpp:83
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:253
void print() override
Definition SGCMQ.cpp:261
static constexpr unsigned m_dof
Definition SGCMQ.h:49
std::vector< IntegrationPoint > int_pt
Definition SGCMQ.h:58
static const mat mapping
Definition SGCMQ.h:27
void form_mass(double, const mat &)
Definition SGCMQ.cpp:129
static mat form_displacement_dn(const mat &, const mat &)
Definition SGCMQ.cpp:113
int clear_status() override
Definition SGCMQ.cpp:241
vec form_diff_coor(const mat &) const
Definition SGCMQ.cpp:39
static mat form_drilling_n(const vec &, const vec &)
Definition SGCMQ.cpp:61
std::vector< vec > record(OutputType) const override
Definition SGCMQ.cpp:255
int commit_status() override
Definition SGCMQ.cpp:235
static constexpr unsigned m_size
Definition SGCMQ.h:49
const char scheme
Definition SGCMQ.h:56
static vec form_stress_mode(double, double)
Definition SGCMQ.cpp:127
void form_body_force(const mat &)
Definition SGCMQ.cpp:151
const double objective_length
Definition SGCMQ.h:54