suanPan
DCP3.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 DCP3_H
30 #define DCP3_H
31 
34 
35 class DCP3 final : public MaterialElement2D {
36  static constexpr unsigned m_node = 3, m_dof = 3, m_size = m_dof * m_node;
37  static const uvec u_dof, d_dof;
38 
39  const double release_rate;
40  const double thickness; // thickness
41  const double area = 0.; // area
42 
43  mat n_mat, pn_mat, b_mat;
44 
45  unique_ptr<Material> m_material; // store material model
46 
47  PhaseField m_phase;
48 
49  double maximum_energy = 0.;
50 
51 public:
52  DCP3(unsigned, // tag
53  uvec&&, // node tag
54  unsigned, // material tag
55  double, // characteristic length
56  double, // energy release rate
57  double = 1. // thickness
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  void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
75  mat GetData(OutputType) override;
76  void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
77 #endif
78 };
79 
80 #endif
81 
OutputType
Definition: OutputType.h:21
The DCP3 class.
Definition: DCP3.h:35
int initialize(const shared_ptr< DomainBase > &) override
Definition: DCP3.cpp:33
DCP3(unsigned, uvec &&, unsigned, double, double, double=1.)
Definition: DCP3.cpp:28
int clear_status() override
Definition: DCP3.cpp:107
void print() override
Definition: DCP3.cpp:122
int update_status() override
Definition: DCP3.cpp:68
vector< vec > record(OutputType) override
Definition: DCP3.cpp:116
int reset_status() override
Definition: DCP3.cpp:114
int commit_status() override
Definition: DCP3.cpp:100
Definition: MaterialElement.h:62
Definition: shapeFunction.h:50
A PhaseField class.
Definition: PhaseField.h:46