suanPan
LeeNewmarkFull.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 LEENEWMARKFULL_H
33 #define LEENEWMARKFULL_H
34 
35 #include "LeeNewmarkBase.h"
36 
37 class LeeNewmarkFull final : public LeeNewmarkBase {
38 public:
39  enum class Type {
40  T0,
41  T1,
42  T2,
43  T3,
44  T4
45  };
46 
47  struct Mode {
49  vec p;
50  double zeta, omega;
51  };
52 
53 private:
54  std::vector<Mode> damping_mode;
55 
56  // a temporary matrix holding first block nonzero entries from damping matrix
57  const triplet_form<double, uword> rabbit;
58  const triplet_form<double, uword> current_stiffness;
59  const triplet_form<double, uword> current_mass;
60 
61  using index_tm = decltype(current_mass)::index_type;
62  using index_ts = decltype(current_stiffness)::index_type;
63 
64  [[nodiscard]] uword get_amplifier() const;
65  [[nodiscard]] uword get_total_size() const override;
66 
67  void update_stiffness() const override;
68  void update_residual() const override;
69 
70  void formulate_block(uword&, double, double, int) const;
71  void formulate_block(uword&, const std::vector<double>&, const std::vector<double>&, const std::vector<int>&) const;
72  void assemble_by_mode_zero(uword&, double, double) const;
73  void assemble_by_mode_one(uword&, double, double, int) const;
74  void assemble_by_mode_two(uword&, double, double, int, int) const;
75  void assemble_by_mode_three(uword&, double, double, double) const;
76  void assemble_by_mode_four(uword&, double, double, int, int, int, int, double) const;
77 
78 public:
79  explicit LeeNewmarkFull(unsigned, std::vector<Mode>&&, double, double, StiffnessType);
80 
81  int initialize() override;
82 
83  int process_constraint() override;
84 
85  void print() override;
86 };
87 
88 #endif
89 
double zeta
Definition: LeeNewmarkFull.h:50
StiffnessType
Definition: LeeNewmarkBase.h:38
Type t
Definition: LeeNewmarkFull.h:48
Definition: LeeNewmarkFull.h:47
A LeeNewmarkFull class defines a solver using Newmark algorithm with Lee damping model.
Definition: LeeNewmarkFull.h:37
LeeNewmarkFull(unsigned, std::vector< Mode > &&, double, double, StiffnessType)
Definition: LeeNewmarkFull.cpp:296
int initialize() override
Definition: LeeNewmarkFull.cpp:323
vec p
Definition: LeeNewmarkFull.h:49
Type
Definition: LeeNewmarkFull.h:39
int process_constraint() override
Definition: LeeNewmarkFull.cpp:332
A LeeNewmarkBase class defines a solver using Newmark algorithm with Lee damping model.
Definition: LeeNewmarkBase.h:36
void print() override
Definition: LeeNewmarkFull.cpp:507