suanPan
CSMQ4.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 CSMQ4_H
31 #define CSMQ4_H
32 
34 
35 class CSMQ4 final : 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_node = 4, m_dof = 3, m_size = m_dof * m_node;
45 
46  static const uvec t_dof;
47  static const uvec r_dof;
48 
49  const double thickness;
50 
51  vector<IntegrationPoint> int_pt;
52 
53 public:
54  CSMQ4(
55  unsigned, // tag
56  uvec&&, // node tag
57  unsigned, // material tag
58  double = 1., // thickness
59  double = -1. // length
60  );
61 
62  int initialize(const shared_ptr<DomainBase>&) override;
63 
64  int update_status() override;
65 
66  int commit_status() override;
67  int clear_status() override;
68  int reset_status() override;
69 
70  [[nodiscard]] mat compute_shape_function(const mat&, unsigned) const override;
71 
72  vector<vec> record(OutputType) override;
73 
74  void print() override;
75 
76 #ifdef SUANPAN_VTK
77  void Setup() override;
78  void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
79  mat GetData(OutputType) override;
80  void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
81 #endif
82 };
83 
84 #endif
85 
OutputType
Definition: OutputType.h:23
The CSMQ4 class.
Definition: CSMQ4.h:35
void print() override
Definition: CSMQ4.cpp:195
int reset_status() override
Definition: CSMQ4.cpp:181
CSMQ4(unsigned, uvec &&, unsigned, double=1., double=-1.)
Definition: CSMQ4.cpp:34
mat compute_shape_function(const mat &, unsigned) const override
Definition: CSMQ4.cpp:187
int commit_status() override
Definition: CSMQ4.cpp:169
int initialize(const shared_ptr< DomainBase > &) override
Definition: CSMQ4.cpp:38
vector< vec > record(OutputType) override
Definition: CSMQ4.cpp:189
int clear_status() override
Definition: CSMQ4.cpp:175
int update_status() override
Definition: CSMQ4.cpp:147
Definition: MaterialElement.h:64