suanPan
Loading...
Searching...
No Matches
CINP4.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 ******************************************************************************/
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(unsigned, // tag
60 uvec&&, // node tag
61 unsigned, // material tag
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 void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
81#endif
82};
83
84#endif
85
OutputType
Definition: OutputType.h:21
The CINP4 class handles CINPS4 and CINPE4 elements.
Definition: CINP4.h:38
int commit_status() override
Definition: CINP4.cpp:324
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:62