suanPan
QE2.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  ******************************************************************************/
33 #ifndef QE2_H
34 #define QE2_H
35 
37 
38 class QE2 final : public MaterialElement2D {
39  struct IntegrationPoint final {
40  vec coor;
41  const double factor;
42  unique_ptr<Material> m_material;
43  mat P, A, B, BI;
44  IntegrationPoint(vec&&, double, unique_ptr<Material>&&);
45  };
46 
47  static constexpr unsigned m_node = 4, m_dof = 2, m_size = m_dof * m_node;
48 
49  static mat mapping;
50 
51  const double thickness;
52 
53  vector<IntegrationPoint> int_pt;
54 
55  const mat mat_stiffness, iso_mapping;
56 
57  mat HT, HIL, HILI, L, LI; // constant matrices
58 
59  mat initial_qtitt, trial_qtitt, current_qtitt; // eq. 65
60  vec trial_qtifi, current_qtifi; // eq. 65
61  vec trial_lambda, current_lambda; // enhanced strain
62  vec trial_alpha, current_alpha; // strain
63  vec trial_beta, current_beta; // stress
64 
65  vec pre_disp;
66 
67  static vec form_stress_mode(double, double);
68 
69 public:
70  QE2(
71  unsigned, // tag
72  uvec&&, // node tags
73  unsigned, // material tags
74  double = 1. // thickness
75  );
76 
77  int initialize(const shared_ptr<DomainBase>&) override;
78 
79  int update_status() override;
80 
81  int clear_status() override;
82  int commit_status() override;
83  int reset_status() override;
84 
85  [[nodiscard]] mat compute_shape_function(const mat&, unsigned) const override;
86 
87  vector<vec> record(OutputType) override;
88 
89  void print() override;
90 
91 #ifdef SUANPAN_VTK
92  void Setup() override;
93  void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
94  mat GetData(OutputType) override;
95  void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
96 #endif
97 };
98 
99 #endif
100 
OutputType
Definition: OutputType.h:23
Definition: MaterialElement.h:64
A QE2 class.
Definition: QE2.h:38
int update_status() override
Definition: QE2.cpp:136
int clear_status() override
Definition: QE2.cpp:165
QE2(unsigned, uvec &&, unsigned, double=1.)
Definition: QE2.cpp:42
vector< vec > record(OutputType) override
Definition: QE2.cpp:207
mat compute_shape_function(const mat &, unsigned) const override
Definition: QE2.cpp:205
int reset_status() override
Definition: QE2.cpp:192
void print() override
Definition: QE2.cpp:217
int initialize(const shared_ptr< DomainBase > &) override
Definition: QE2.cpp:46
int commit_status() override
Definition: QE2.cpp:179