suanPan
T2D2.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  ******************************************************************************/
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(
53  unsigned, // tag
54  uvec&&, // node tag
55  unsigned, // material tag
56  double, // area
57  bool = false, // nonlinear geometry switch
58  bool = true, // update area switch
59  bool = true, // log strain switch
60  double = -1. // flexural rigidity
61  );
62 
63  int initialize(const shared_ptr<DomainBase>&) override;
64 
65  int update_status() override;
66 
67  int commit_status() override;
68  int clear_status() override;
69  int reset_status() override;
70 
71  vector<vec> record(OutputType) override;
72 
73  void print() override;
74 
75 #ifdef SUANPAN_VTK
76  void Setup() override;
77  void GetData(vtkSmartPointer<vtkDoubleArray>&, OutputType) override;
78  void SetDeformation(vtkSmartPointer<vtkPoints>&, double) override;
79 #endif
80 };
81 
82 #endif
83 
OutputType
Definition: OutputType.h:23
Definition: MaterialElement.h:51
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