suanPan
DC3D4.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  ******************************************************************************/
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(
53  unsigned, // tag
54  uvec&&, // node tag
55  unsigned, // material tag
56  double, // characteristic length
57  double // energy release rate
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  vector<vec> record(OutputType) override;
69 
70  void print() override;
71 
72 #ifdef SUANPAN_VTK
73  void Setup() override;
74  mat GetData(OutputType) override;
75  void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
76  void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
77 #endif
78 };
79 
80 #endif
81 
OutputType
Definition: OutputType.h:23
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:77
A PhaseField class.
Definition: PhaseField.h:46