suanPan
CP4I.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (C) 2017-2022 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 CP4I_H
31 #define CP4I_H
32 
34 
35 class CP4I final : public MaterialElement2D {
36  struct IntegrationPoint final {
37  vec coor;
38  double weight;
39  unique_ptr<Material> m_material;
40  mat pn_pxy, B1, B2;
41  IntegrationPoint(vec&&, double, unique_ptr<Material>&&, mat&&);
42  };
43 
44  static constexpr unsigned m_node = 4, m_dof = 2, m_size = m_dof * m_node;
45 
46  const double thickness;
47 
48  vector<IntegrationPoint> int_pt;
49 
50  static void stack_stiffness(mat&, const mat&, const mat&, double);
51  static void stack_stiffness_incompatible(mat&, const mat&, const mat&, double);
52 
53 public:
54  CP4I(unsigned, // tag
55  uvec&&, // node tag
56  unsigned, // material tag
57  double = 1. // thickness
58  );
59 
60  int initialize(const shared_ptr<DomainBase>&) override;
61 
62  int update_status() override;
63 
64  int commit_status() override;
65  int clear_status() override;
66  int reset_status() override;
67 
68  [[nodiscard]] mat compute_shape_function(const mat&, unsigned) const override;
69 
70  vector<vec> record(OutputType) override;
71 
72  void print() override;
73 
74 #ifdef SUANPAN_VTK
75  void Setup() override;
76  void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
77  mat GetData(OutputType) override;
78  void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
79 #endif
80 };
81 
82 #endif
83 
OutputType
Definition: OutputType.h:21
The CP4I class handles CPS4I, CPE4I.
Definition: CP4I.h:35
mat compute_shape_function(const mat &, unsigned) const override
Definition: CP4I.cpp:346
int initialize(const shared_ptr< DomainBase > &) override
Definition: CP4I.cpp:241
CP4I(unsigned, uvec &&, unsigned, double=1.)
Definition: CP4I.cpp:237
int clear_status() override
Definition: CP4I.cpp:334
int commit_status() override
Definition: CP4I.cpp:328
vector< vec > record(OutputType) override
Definition: CP4I.cpp:348
int update_status() override
Definition: CP4I.cpp:298
void print() override
Definition: CP4I.cpp:357
int reset_status() override
Definition: CP4I.cpp:340
Definition: MaterialElement.h:62