suanPan
C3D20.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  ******************************************************************************/
29 #ifndef C3D20_H
30 #define C3D20_H
31 
33 
34 class C3D20 final : public MaterialElement3D {
35  struct IntegrationPoint final {
36  vec coor;
37  double weight;
38  unique_ptr<Material> c_material;
39  mat pn_pxyz, strain_mat;
40  IntegrationPoint(vec&&, double, unique_ptr<Material>&&, mat&&);
41  };
42 
43  static constexpr unsigned c_node = 20, c_dof = 3, c_size = c_dof * c_node;
44 
45  const bool reduced_scheme;
46 
47  vector<IntegrationPoint> int_pt;
48 
49 public:
50  C3D20(unsigned, // tag
51  uvec&&, // node tag
52  unsigned, // material tag
53  bool = true, // reduced integration
54  bool = false // nonlinear geometry switch
55  );
56 
57  int initialize(const shared_ptr<DomainBase>&) override;
58 
59  int update_status() override;
60 
61  int commit_status() override;
62  int clear_status() override;
63  int reset_status() override;
64 
65  [[nodiscard]] mat compute_shape_function(const mat&, unsigned) const override;
66 
67  vector<vec> record(OutputType) override;
68 
69  void print() override;
70 
71 #ifdef SUANPAN_VTK
72  void Setup() override;
73  void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
74  void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
75 #endif
76 };
77 
78 #endif
79 
OutputType
Definition: OutputType.h:21
The C3D20 class defines C3D20 C3D20R elements.
Definition: C3D20.h:34
C3D20(unsigned, uvec &&, unsigned, bool=true, bool=false)
Definition: C3D20.cpp:32
int initialize(const shared_ptr< DomainBase > &) override
Definition: C3D20.cpp:36
int update_status() override
Definition: C3D20.cpp:88
int commit_status() override
Definition: C3D20.cpp:160
vector< vec > record(OutputType) override
Definition: C3D20.cpp:180
mat compute_shape_function(const mat &, unsigned) const override
Definition: C3D20.cpp:178
int reset_status() override
Definition: C3D20.cpp:172
int clear_status() override
Definition: C3D20.cpp:166
void print() override
Definition: C3D20.cpp:188
Definition: MaterialElement.h:74