suanPan
T2D2.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  ******************************************************************************/
32 #ifndef T2D2_H
33 #define T2D2_H
34 
36 #include <Element/Utility/T2DC.h>
37 
38 class T2D2 final : public MaterialElement1D {
39  static constexpr unsigned t_node = 2, t_dof = 2, t_size = t_dof * t_node;
40 
41  const double length = 0.; // length of the element
42  const double area; // area of the cross-section
43  const double rigidity;
44  const double euler = 1.;
45 
46  unique_ptr<Material> t_material; // material model
47  unique_ptr<Orientation> t_trans; // transformation
48 
49  const bool update_area; // flag to indicate if to update section area
50  const bool log_strain; // flag to indicate if to use log strain
51 public:
52  T2D2(unsigned, // tag
53  uvec&&, // node tag
54  unsigned, // material tag
55  double, // area
56  bool = false, // nonlinear geometry switch
57  bool = true, // update area switch
58  bool = true, // log strain switch
59  double = -1. // flexural rigidity
60  );
61 
62  int initialize(const shared_ptr<DomainBase>&) override;
63 
64  int update_status() override;
65 
66  int commit_status() override;
67  int clear_status() override;
68  int reset_status() override;
69 
70  vector<vec> record(OutputType) override;
71 
72  void print() override;
73 
74 #ifdef SUANPAN_VTK
75  void Setup() override;
76  void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
77  void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
78 #endif
79 };
80 
81 #endif
82 
OutputType
Definition: OutputType.h:21
Definition: MaterialElement.h:50
A T2D2 class.
Definition: T2D2.h:38
vector< vec > record(OutputType) override
Definition: T2D2.cpp:100
T2D2(unsigned, uvec &&, unsigned, double, bool=false, bool=true, bool=true, double=-1.)
Definition: T2D2.cpp:22
void print() override
Definition: T2D2.cpp:102
int initialize(const shared_ptr< DomainBase > &) override
Definition: T2D2.cpp:30
int clear_status() override
Definition: T2D2.cpp:88
int reset_status() override
Definition: T2D2.cpp:94
int commit_status() override
Definition: T2D2.cpp:82
int update_status() override
Definition: T2D2.cpp:46
Definition: shape.h:50