suanPan
CINP4.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 ******************************************************************************/
33#ifndef CINP4_H
34#define CINP4_H
35
37
38class CINP4 final : public MaterialElement2D {
39 struct IntegrationPoint final {
40 vec coor;
41 double weight;
42 unique_ptr<Material> m_material;
43 mat pn_pxy, strain_mat;
44 IntegrationPoint(vec&&, double, unique_ptr<Material>&&, mat&&);
45 };
46
47 static constexpr unsigned m_node = 4, m_dof = 2, m_size = m_dof * m_node;
48
49 const double thickness;
50
51 vector<IntegrationPoint> int_pt;
52
53 static mat compute_mapping(const vec&);
54 static mat compute_n(const vec&);
55 static mat compute_dn(const vec&);
56 static void stack_stiffness(mat&, const mat&, const mat&, double);
57
58public:
59 CINP4(
60 unsigned, // tag
61 uvec&&, // node tag
62 unsigned, // material tag
63 double = 1. // thickness
64 );
65
66 int initialize(const shared_ptr<DomainBase>&) override;
67
68 int update_status() override;
69
70 int commit_status() override;
71 int clear_status() override;
72 int reset_status() override;
73
74 vector<vec> record(OutputType) override;
75
76 void print() override;
77
78#ifdef SUANPAN_VTK
79 void Setup() override;
80 void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
81 void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
82#endif
83};
84
85#endif
86
OutputType
Definition: OutputType.h:23
The CINP4 class handles CINPS4 and CINPE4 elements.
Definition: CINP4.h:38
int commit_status() override
Definition: CINP4.cpp:324
CINP4(unsigned, uvec &&, unsigned, double=1.)
Definition: CINP4.cpp:264
void print() override
Definition: CINP4.cpp:348
int reset_status() override
Definition: CINP4.cpp:336
int clear_status() override
Definition: CINP4.cpp:330
vector< vec > record(OutputType) override
Definition: CINP4.cpp:342
int update_status() override
Definition: CINP4.cpp:301
int initialize(const shared_ptr< DomainBase > &) override
Definition: CINP4.cpp:268
Definition: MaterialElement.h:64