suanPan
DCP4.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2024 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
36class 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
55public:
56 DCP4(
57 unsigned, // tag
58 uvec&&, // node tag
59 unsigned, // material tag
60 double, // characteristic length
61 double, // energy release rate
62 double = 1. // thickness
63 );
64
65 int initialize(const shared_ptr<DomainBase>&) override;
66
67 int update_status() override;
68
69 int commit_status() override;
70 int clear_status() override;
71 int reset_status() override;
72
73 vector<vec> record(OutputType) override;
74
75 void print() override;
76
77#ifdef SUANPAN_VTK
78 void Setup() override;
79 void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
80 mat GetData(OutputType) override;
81 void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
82#endif
83};
84
85#endif
86
OutputType
Definition: OutputType.h:23
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:163
int commit_status() override
Definition: DCP4.cpp:129
Definition: MaterialElement.h:64
A PhaseField class.
Definition: PhaseField.h:46