suanPan
C3D8.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  ******************************************************************************/
29 #ifndef C3D8_H
30 #define C3D8_H
31 
33 
34 class C3D8 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 = 8, c_dof = 3, c_size = c_dof * c_node;
44 
45  static const field<vec> h_mode;
46 
47  const char int_scheme;
48 
49  const bool hourglass_control;
50 
51  mat hourglass;
52 
53  vector<IntegrationPoint> int_pt;
54 
55 public:
56  C3D8(unsigned, // tag
57  uvec&&, // node tag
58  unsigned, // material tag
59  char = 'I', // reduced integration
60  bool = false // nonlinear geometry switch
61  );
62 
63  int initialize(const shared_ptr<DomainBase>&) override;
64 
65  int update_status() override;
66 
67  int commit_status() override;
68  int clear_status() override;
69  int reset_status() override;
70 
71  [[nodiscard]] mat compute_shape_function(const mat&, unsigned) const override;
72 
73  vector<vec> record(OutputType) override;
74 
75  void print() override;
76 
77 #ifdef SUANPAN_VTK
78  void Setup() override;
79  mat GetData(OutputType) override;
80  void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
81  void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
82 #endif
83 };
84 
85 #endif
86 
OutputType
Definition: OutputType.h:21
The C3D8 class defines C3D8 C3D8R elements.
Definition: C3D8.h:34
mat compute_shape_function(const mat &, unsigned) const override
Definition: C3D8.cpp:198
int commit_status() override
Definition: C3D8.cpp:180
int reset_status() override
Definition: C3D8.cpp:192
void print() override
Definition: C3D8.cpp:206
int update_status() override
Definition: C3D8.cpp:103
C3D8(unsigned, uvec &&, unsigned, char='I', bool=false)
Definition: C3D8.cpp:35
int initialize(const shared_ptr< DomainBase > &) override
Definition: C3D8.cpp:40
int clear_status() override
Definition: C3D8.cpp:186
vector< vec > record(OutputType) override
Definition: C3D8.cpp:200
Definition: MaterialElement.h:74