suanPan
CP8.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  ******************************************************************************/
31 #ifndef CP8_H
32 #define CP8_H
33 
35 
36 class CP8 final : public MaterialElement2D {
37  struct IntegrationPoint final {
38  vec coor;
39  double weight;
40  unique_ptr<Material> m_material;
41  mat pn_pxy;
42  sp_mat strain_mat;
43  IntegrationPoint(vec&&, double, unique_ptr<Material>&&, mat&&);
44  };
45 
46  static constexpr unsigned m_node = 8, m_dof = 2, m_size = m_dof * m_node;
47 
48  const double thickness;
49 
50  const bool reduced_scheme;
51 
52  vector<IntegrationPoint> int_pt;
53 
54 public:
55  CP8(
56  unsigned, // tag
57  uvec&&, // node tag
58  unsigned, // material tag
59  double = 1., // thickness
60  bool = false, // reduced integration
61  bool = false // nonlinear geometry switch
62  );
63 
64  int initialize(const shared_ptr<DomainBase>&) override;
65 
66  int update_status() override;
67 
68  int commit_status() override;
69  int clear_status() override;
70  int reset_status() override;
71 
72  [[nodiscard]] mat compute_shape_function(const mat&, unsigned) const override;
73 
74  vector<vec> record(OutputType) override;
75 
76  void print() override;
77 
78 #ifdef SUANPAN_VTK
79  void Setup() override;
80  void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
81  mat GetData(OutputType) override;
82  void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
83 #endif
84 };
85 
86 #endif
87 
OutputType
Definition: OutputType.h:23
The CP8 class handles CPS8, CPE8, CPS8R and CPE8R elements. It is a four node constant strain membran...
Definition: CP8.h:36
CP8(unsigned, uvec &&, unsigned, double=1., bool=false, bool=false)
Definition: CP8.cpp:39
mat compute_shape_function(const mat &, unsigned) const override
Definition: CP8.cpp:178
int commit_status() override
Definition: CP8.cpp:160
int reset_status() override
Definition: CP8.cpp:172
int clear_status() override
Definition: CP8.cpp:166
vector< vec > record(OutputType) override
Definition: CP8.cpp:180
int update_status() override
Definition: CP8.cpp:95
void print() override
Definition: CP8.cpp:186
int initialize(const shared_ptr< DomainBase > &) override
Definition: CP8.cpp:44
Definition: MaterialElement.h:64