suanPan
Orientation.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 ORIENTATION_H
34#define ORIENTATION_H
35
36#include <Domain/Tag.h>
37
38enum class OrientationType {
39 T2D,
40 T3D,
41 B2D,
42 B3D,
43 B3DOS
44};
45
46class Element;
47
48class Orientation : public Tag {
49protected:
50 const Element* element_ptr = nullptr;
51
52 vec z_axis;
53
54 double length = 0., inclination = 0.;
55
57
58 void check_element_ptr() const;
59
60 virtual void update_transformation() = 0;
61
62public:
63 explicit Orientation(unsigned = 0, vec&& = {});
64 Orientation(const Orientation&) = default; // copy allowed
65 Orientation(Orientation&&) = delete; // move forbidden
66 Orientation& operator=(const Orientation&) = delete; // copy assign forbidden
67 Orientation& operator=(Orientation&&) = delete; // move assign forbidden
68 ~Orientation() override = default;
69
70 void update_axis(const vec&);
71
72 virtual void set_element_ptr(const Element*);
73
74 [[nodiscard]] virtual bool is_nlgeom() const;
75
76 [[nodiscard]] virtual OrientationType get_orientation_type() const = 0;
77
78 [[nodiscard]] double get_length() const;
79 [[nodiscard]] double get_inclination() const;
80 [[nodiscard]] const mat& get_transformation() const;
81
82 virtual unique_ptr<Orientation> get_copy() = 0;
83
84 virtual void update_status();
85 virtual void commit_status();
86 virtual void reset_status();
87 virtual void clear_status();
88
89 [[nodiscard]] virtual vec to_local_vec(double) const;
90 [[nodiscard]] virtual vec to_global_vec(double) const;
91 [[nodiscard]] virtual mat to_global_mass_mat(double) const;
92 [[nodiscard]] virtual mat to_global_geometry_mat(double) const;
93 [[nodiscard]] virtual mat to_global_stiffness_mat(double) const;
94
95 [[nodiscard]] virtual vec to_local_vec(vec&&) const;
96 [[nodiscard]] virtual vec to_global_vec(vec&&) const;
97 [[nodiscard]] virtual mat to_global_mass_mat(mat&&) const;
98 [[nodiscard]] virtual mat to_global_geometry_mat(mat&&) const;
99 [[nodiscard]] virtual mat to_global_stiffness_mat(mat&&) const;
100
107 [[nodiscard]] virtual vec to_local_vec(const vec&) const = 0;
114 [[nodiscard]] virtual vec to_global_vec(const vec&) const = 0;
120 [[nodiscard]] virtual mat to_global_mass_mat(const mat&) const;
121 [[nodiscard]] virtual mat to_global_geometry_mat(const mat&) const;
122 [[nodiscard]] virtual mat to_global_stiffness_mat(const mat&) const = 0;
123};
124
125#endif
126
A Element class.
Definition: Element.h:117
A Orientation class.
Definition: Orientation.h:48
virtual void update_status()
Definition: Orientation.cpp:42
virtual bool is_nlgeom() const
Definition: Orientation.cpp:34
virtual OrientationType get_orientation_type() const =0
Orientation(const Orientation &)=default
Orientation & operator=(Orientation &&)=delete
virtual mat to_global_mass_mat(double) const
Definition: Orientation.cpp:57
vec z_axis
Definition: Orientation.h:52
virtual void update_transformation()=0
virtual vec to_global_vec(double) const
Definition: Orientation.cpp:55
virtual vec to_local_vec(const vec &) const =0
transform anything from global to local system e.g., disp -> disp, vel -> vel, acc -> acc,...
virtual mat to_global_geometry_mat(double) const
Definition: Orientation.cpp:59
double get_length() const
Definition: Orientation.cpp:36
virtual mat to_global_stiffness_mat(const mat &) const =0
virtual vec to_global_vec(const vec &) const =0
transform anything from local to global system e.g., disp -> disp, vel -> vel, acc -> acc,...
mat direction_cosine
Definition: Orientation.h:56
Orientation & operator=(const Orientation &)=delete
void update_axis(const vec &)
Definition: Orientation.cpp:27
void check_element_ptr() const
Definition: Orientation.cpp:21
double length
Definition: Orientation.h:54
virtual void reset_status()
Definition: Orientation.cpp:49
virtual void set_element_ptr(const Element *)
Definition: Orientation.cpp:29
const mat & get_transformation() const
Definition: Orientation.cpp:40
~Orientation() override=default
virtual vec to_local_vec(double) const
Definition: Orientation.cpp:53
double inclination
Definition: Orientation.h:54
double get_inclination() const
Definition: Orientation.cpp:38
Orientation(unsigned=0, vec &&={})
Definition: Orientation.cpp:23
virtual unique_ptr< Orientation > get_copy()=0
Orientation(Orientation &&)=delete
virtual mat to_global_stiffness_mat(double) const
Definition: Orientation.cpp:61
virtual void clear_status()
Definition: Orientation.cpp:51
virtual void commit_status()
Definition: Orientation.cpp:47
const Element * element_ptr
Definition: Orientation.h:50
A base Tag class.
Definition: Tag.h:38
OrientationType
Definition: Orientation.h:38