suanPan
DCP3.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 ******************************************************************************/
29#ifndef DCP3_H
30#define DCP3_H
31
34
35class 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
51public:
52 DCP3(
53 unsigned, // tag
54 uvec&&, // node tag
55 unsigned, // material tag
56 double, // characteristic length
57 double, // energy release rate
58 double = 1. // thickness
59 );
60
61 int initialize(const shared_ptr<DomainBase>&) override;
62
63 int update_status() override;
64
65 int commit_status() override;
66 int clear_status() override;
67 int reset_status() override;
68
69 vector<vec> record(OutputType) override;
70
71 void print() override;
72
73#ifdef SUANPAN_VTK
74 void Setup() override;
75 void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
76 mat GetData(OutputType) override;
77 void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
78#endif
79};
80
81#endif
82
OutputType
Definition: OutputType.h:23
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:64
Definition: shape.h:50
A PhaseField class.
Definition: PhaseField.h:46