suanPan
DC3D4.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 DC3D4_H
31 #define DC3D4_H
32 
35 
36 class DC3D4 final : public MaterialElement3D {
37  static constexpr unsigned c_node = 4, c_dof = 4, c_size = c_dof * c_node;
38  static const uvec u_dof, d_dof;
39 
40  const double release_rate;
41  const double volume = 0.;
42 
43  mat n_mat, pn_mat, b_mat;
44 
45  unique_ptr<Material> c_material;
46 
47  PhaseField c_phase;
48 
49  double maximum_energy = 0.;
50 
51 public:
52  DC3D4(unsigned, // tag
53  uvec&&, // node tag
54  unsigned, // material tag
55  double, // characteristic length
56  double // energy release rate
57  );
58 
59  int initialize(const shared_ptr<DomainBase>&) override;
60 
61  int update_status() override;
62 
63  int commit_status() override;
64  int clear_status() override;
65  int reset_status() override;
66 
67  vector<vec> record(OutputType) override;
68 
69  void print() override;
70 
71 #ifdef SUANPAN_VTK
72  void Setup() override;
73  mat GetData(OutputType) override;
74  void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
75  void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
76 #endif
77 };
78 
79 #endif
80 
OutputType
Definition: OutputType.h:21
The DC3D4 class defines DC3D4 elements.
Definition: DC3D4.h:36
DC3D4(unsigned, uvec &&, unsigned, double, double)
Definition: DC3D4.cpp:27
void print() override
Definition: DC3D4.cpp:114
int update_status() override
Definition: DC3D4.cpp:66
vector< vec > record(OutputType) override
Definition: DC3D4.cpp:108
int initialize(const shared_ptr< DomainBase > &) override
Definition: DC3D4.cpp:31
int commit_status() override
Definition: DC3D4.cpp:92
int reset_status() override
Definition: DC3D4.cpp:106
int clear_status() override
Definition: DC3D4.cpp:99
Definition: MaterialElement.h:74
A PhaseField class.
Definition: PhaseField.h:46