suanPan
CSMQ.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  ******************************************************************************/
30 #ifndef CSMQ_H
31 #define CSMQ_H
32 
34 
35 class 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 
57 public:
58  CSMQ(
59  unsigned, // tag
60  uvec&&, // node tag
61  unsigned, // material tag
62  unsigned, // number of nodes
63  double = 1., // thickness
64  double = -1. // length
65  );
66 
67  int initialize(const shared_ptr<DomainBase>&) override;
68 
69  int update_status() override;
70 
71  int commit_status() override;
72  int clear_status() override;
73  int reset_status() override;
74 
75  [[nodiscard]] mat compute_shape_function(const mat&, unsigned) const override;
76 
77  vector<vec> record(OutputType) override;
78 
79  void print() override;
80 
81 #ifdef SUANPAN_VTK
82  void Setup() override;
83  void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
84  mat GetData(OutputType) override;
85  void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
86 #endif
87 };
88 
89 class CSMQ5 final : public CSMQ {
90  static const uvec t_dof;
91  static const uvec r_dof;
92 
93  const uvec& get_translation_dof() override;
94  const uvec& get_rotation_dof() override;
95 
96 public:
97  CSMQ5(
98  unsigned, // tag
99  uvec&&, // node tag
100  unsigned, // material tag
101  double = 1., // thickness
102  double = -1. // length
103  );
104 };
105 
106 class CSMQ6 final : public CSMQ {
107  static const uvec t_dof;
108  static const uvec r_dof;
109 
110  const uvec& get_translation_dof() override;
111  const uvec& get_rotation_dof() override;
112 
113 public:
114  CSMQ6(
115  unsigned, // tag
116  uvec&&, // node tag
117  unsigned, // material tag
118  double = 1., // thickness
119  double = -1. // length
120  );
121 };
122 
123 class CSMQ7 final : public CSMQ {
124  static const uvec t_dof;
125  static const uvec r_dof;
126 
127  const uvec& get_translation_dof() override;
128  const uvec& get_rotation_dof() override;
129 
130 public:
131  CSMQ7(
132  unsigned, // tag
133  uvec&&, // node tag
134  unsigned, // material tag
135  double = 1., // thickness
136  double = -1. // length
137  );
138 };
139 
140 #endif
141 
OutputType
Definition: OutputType.h:23
Definition: CSMQ.h:89
CSMQ5(unsigned, uvec &&, unsigned, double=1., double=-1.)
Definition: CSMQ.cpp:267
Definition: CSMQ.h:106
CSMQ6(unsigned, uvec &&, unsigned, double=1., double=-1.)
Definition: CSMQ.cpp:277
Definition: CSMQ.h:123
CSMQ7(unsigned, uvec &&, unsigned, double=1., double=-1.)
Definition: CSMQ.cpp:287
The CSMQ class.
Definition: CSMQ.h:35
int initialize(const shared_ptr< DomainBase > &) override
Definition: CSMQ.cpp:36
CSMQ(unsigned, uvec &&, unsigned, unsigned, double=1., double=-1.)
Definition: CSMQ.cpp:31
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:64