suanPan
T2D2.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (C) 2017-2022 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 
44  unique_ptr<Material> t_material; // material model
45  unique_ptr<Orientation> t_trans; // transformation
46 
47  const bool update_area; // flag to indicate if to update section area
48  const bool log_strain; // flag to indicate if to use log strain
49 public:
50  T2D2(unsigned, // tag
51  uvec&&, // node tag
52  unsigned, // material tag
53  double, // area
54  bool = false, // nonlinear geometry switch
55  bool = true, // update area switch
56  bool = true // log strain switch
57  );
58 
59  int initialize(const shared_ptr<DomainBase>&) override;
60 
61  int update_status() override;
62 
63  int commit_status() override;
64  int clear_status() override;
65  int reset_status() override;
66 
67  vector<vec> record(OutputType) override;
68 
69  void print() override;
70 
71 #ifdef SUANPAN_VTK
72  void Setup() override;
73  void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
74  void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
75 #endif
76 };
77 
78 #endif
79 
OutputType
Definition: OutputType.h:21
Definition: MaterialElement.h:50
A T2D2 class.
Definition: T2D2.h:38
vector< vec > record(OutputType) override
Definition: T2D2.cpp:91
void print() override
Definition: T2D2.cpp:93
int initialize(const shared_ptr< DomainBase > &) override
Definition: T2D2.cpp:29
T2D2(unsigned, uvec &&, unsigned, double, bool=false, bool=true, bool=true)
Definition: T2D2.cpp:22
int clear_status() override
Definition: T2D2.cpp:79
int reset_status() override
Definition: T2D2.cpp:85
int commit_status() override
Definition: T2D2.cpp:73
int update_status() override
Definition: T2D2.cpp:43
Definition: shapeFunction.h:50