suanPan
B3DC.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  ******************************************************************************/
36 #ifndef B3DC_H
37 #define B3DC_H
38 
39 #include "B3DL.h"
40 
41 class B3DC : public B3DL {
42  mat basic{3, 3, fill::none};
43 
44  rowvec t6i, t6j;
45 
46 protected:
47  const span sa{0, 2}, sb{3, 5}, sc{6, 8}, sd{9, 11};
48 
49  double elongation = 0.;
50 
51  mat trial_rotation{3, 2, fill::zeros}, current_rotation{3, 2, fill::zeros};
53  field<mat> sn{6}, se{3};
54 
55  vec theta;
57 
58  const double initial_length = 0.;
59 
60  [[nodiscard]] mat compute_a() const;
61  [[nodiscard]] mat compute_l(const mat&, const subview_col<double>&) const;
62  [[nodiscard]] mat compute_m(const mat&, const subview_col<double>&) const;
63  [[nodiscard]] mat compute_g(const mat&, const subview_col<double>&, const subview_col<double>&) const;
64 
65  // some syntax sugar
66  [[nodiscard]] subview_col<double> e(uword) const;
67  [[nodiscard]] subview_col<double> r(uword) const;
68  [[nodiscard]] subview_col<double> ni(uword) const;
69  [[nodiscard]] subview_col<double> nj(uword) const;
70  [[nodiscard]] const mat& sni(uword) const;
71  [[nodiscard]] const mat& snj(uword) const;
72 
73  void update_direct_cosine(const vec&);
74  void update_e(const vec&);
75  void update_theta();
76 
77  void update_transformation() override;
78 
79  [[nodiscard]] virtual unsigned nodal_size() const;
80 
81 public:
82  using B3DL::B3DL;
83 
84  [[nodiscard]] bool is_nlgeom() const override;
85 
86  unique_ptr<Orientation> get_copy() override;
87 
88  void commit_status() override;
89  void reset_status() override;
90  void clear_status() override;
91 
92  [[nodiscard]] vec to_local_vec(const vec&) const override;
93  [[nodiscard]] vec to_global_vec(const vec&) const override;
94  [[nodiscard]] mat to_global_geometry_mat(const mat&) const override;
95  [[nodiscard]] mat to_global_stiffness_mat(const mat&) const override;
96 };
97 
98 #endif
99 
A B3DC class.
Definition: B3DC.h:41
mat trial_n
Definition: B3DC.h:52
subview_col< double > ni(uword) const
Definition: B3DC.cpp:84
mat to_global_geometry_mat(const mat &) const override
Definition: B3DC.cpp:234
void update_e(const vec &)
Definition: B3DC.cpp:107
mat transformation
Definition: B3DC.h:56
mat trial_rotation
Definition: B3DC.h:51
const span sa
Definition: B3DC.h:47
const mat & sni(uword) const
Definition: B3DC.cpp:88
mat current_n
Definition: B3DC.h:52
void update_theta()
Definition: B3DC.cpp:113
void update_direct_cosine(const vec &)
Definition: B3DC.cpp:92
virtual unsigned nodal_size() const
Definition: B3DC.cpp:204
void reset_status() override
Definition: B3DC.cpp:216
const span sd
Definition: B3DC.h:47
mat compute_g(const mat &, const subview_col< double > &, const subview_col< double > &) const
Definition: B3DC.cpp:47
const span sc
Definition: B3DC.h:47
mat compute_a() const
Definition: B3DC.cpp:22
subview_col< double > e(uword) const
Definition: B3DC.cpp:80
field< mat > se
Definition: B3DC.h:53
const span sb
Definition: B3DC.h:47
mat current_rotation
Definition: B3DC.h:51
void clear_status() override
Definition: B3DC.cpp:222
vec theta
Definition: B3DC.h:55
const double initial_length
Definition: B3DC.h:58
bool is_nlgeom() const override
Definition: B3DC.cpp:206
subview_col< double > nj(uword) const
Definition: B3DC.cpp:86
void update_transformation() override
Definition: B3DC.cpp:121
void commit_status() override
Definition: B3DC.cpp:210
mat compute_m(const mat &, const subview_col< double > &) const
Definition: B3DC.cpp:42
unique_ptr< Orientation > get_copy() override
Definition: B3DC.cpp:208
field< mat > sn
Definition: B3DC.h:53
vec to_local_vec(const vec &) const override
transform anything from global to local system e.g., disp -> disp, vel -> vel, acc -> acc,...
Definition: B3DC.cpp:230
mat to_global_stiffness_mat(const mat &) const override
Definition: B3DC.cpp:303
mat compute_l(const mat &, const subview_col< double > &) const
Definition: B3DC.cpp:26
mat trial_ref
Definition: B3DC.h:52
mat current_ref
Definition: B3DC.h:52
const mat & snj(uword) const
Definition: B3DC.cpp:90
double elongation
Definition: B3DC.h:49
subview_col< double > r(uword) const
Definition: B3DC.cpp:82
vec to_global_vec(const vec &) const override
transform anything from local to global system e.g., disp -> disp, vel -> vel, acc -> acc,...
Definition: B3DC.cpp:232
A B3DL class.
Definition: B3DL.h:47