suanPan
DCP4.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 DCP4_H
31 #define DCP4_H
32 
35 
36 class DCP4 final : public MaterialElement2D {
37  struct IntegrationPoint final : PhaseField {
38  vec coor;
39  double weight;
40  double maximum_energy = 0.;
41  unique_ptr<Material> m_material;
42  mat n_mat, pn_mat, b_mat;
43  IntegrationPoint(vec&&, double, unique_ptr<Material>&&, mat&&, mat&&);
44  };
45 
46  static constexpr unsigned m_node = 4, m_dof = 3, m_size = m_dof * m_node;
47 
48  static const uvec u_dof, d_dof;
49 
50  const double release_rate;
51  const double thickness;
52 
53  vector<IntegrationPoint> int_pt;
54 
55 public:
56  DCP4(unsigned, // tag
57  uvec&&, // node tag
58  unsigned, // material tag
59  double, // characteristic length
60  double, // energy release rate
61  double = 1. // thickness
62  );
63 
64  int initialize(const shared_ptr<DomainBase>&) override;
65 
66  int update_status() override;
67 
68  int commit_status() override;
69  int clear_status() override;
70  int reset_status() override;
71 
72  vector<vec> record(OutputType) override;
73 
74  void print() override;
75 
76 #ifdef SUANPAN_VTK
77  void Setup() override;
78  void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
79  mat GetData(OutputType) override;
80  void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
81 #endif
82 };
83 
84 #endif
85 
OutputType
Definition: OutputType.h:21
The DCP4 class.
Definition: DCP4.h:36
DCP4(unsigned, uvec &&, unsigned, double, double, double=1.)
Definition: DCP4.cpp:37
vector< vec > record(OutputType) override
Definition: DCP4.cpp:155
int update_status() override
Definition: DCP4.cpp:93
int initialize(const shared_ptr< DomainBase > &) override
Definition: DCP4.cpp:42
int reset_status() override
Definition: DCP4.cpp:149
int clear_status() override
Definition: DCP4.cpp:139
void print() override
Definition: DCP4.cpp:180
int commit_status() override
Definition: DCP4.cpp:129
Definition: MaterialElement.h:62
A PhaseField class.
Definition: PhaseField.h:46