suanPan
Loading...
Searching...
No Matches
LeeNewmarkIterative.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2025 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 ******************************************************************************/
35#ifndef LEENEWMARKITERATIVE_H
36#define LEENEWMARKITERATIVE_H
37
38#include "../Newmark.h"
39
40#include <Domain/Factory.hpp>
42
43class LeeNewmarkIterative final : public Newmark {
44public:
45 enum class Type {
46 T0,
47 T1,
48 T2,
49 T3,
50 T4
51 };
52
53 struct Mode {
55 vec p;
56 double zeta, omega;
57 };
58
59private:
60 unsigned n_block{0};
61
62 std::vector<Mode> damping_mode;
63
64 shared_ptr<Factory<double>> factory = nullptr;
65
66 shared_ptr<MetaMat<double>> current_mass = nullptr;
67 shared_ptr<MetaMat<double>> current_stiffness = nullptr;
68
69 unique_ptr<MetaMat<double>> worker = nullptr;
70
71 void init_worker(unsigned, unsigned);
72
73 void assemble(const shared_ptr<MetaMat<double>>&, uword, uword, double) const;
74
75 void assemble_mass(uword, uword, double) const;
76 void assemble_stiffness(uword, uword, double) const;
77 void assemble_mass(const std::vector<sword>&, const std::vector<sword>&, const std::vector<double>&) const;
78 void assemble_stiffness(const std::vector<sword>&, const std::vector<sword>&, const std::vector<double>&) const;
79
80 void formulate_block(sword&, double, double, int) const;
81 void formulate_block(sword&, const std::vector<double>&, const std::vector<double>&, const std::vector<int>&) const;
82
83 [[nodiscard]] vec update_by_mode_one(double, double, int) const;
84 [[nodiscard]] vec update_by_mode_two(double, double, int, int);
85 [[nodiscard]] vec update_by_mode_three(double, double, double);
86 [[nodiscard]] vec update_by_mode_four(double, double, int, int, int, int, double);
87
88 void update_damping_force();
89
90public:
91 LeeNewmarkIterative(unsigned, std::vector<Mode>&&, double, double);
92
93 int initialize() override;
94
95 [[nodiscard]] int process_constraint() override;
96 [[nodiscard]] int process_constraint_resistance() override;
97
98 void assemble_matrix() override;
99
100 void print() override;
101};
102
103#endif
104
A LeeNewmarkIterative class defines a solver using Newmark algorithm with Lee damping model.
Definition LeeNewmarkIterative.h:43
int process_constraint() override
Definition LeeNewmarkIterative.cpp:353
int initialize() override
Definition LeeNewmarkIterative.cpp:343
void assemble_matrix() override
Definition LeeNewmarkIterative.cpp:374
Type
Definition LeeNewmarkIterative.h:45
int process_constraint_resistance() override
Definition LeeNewmarkIterative.cpp:368
void print() override
Definition LeeNewmarkIterative.cpp:400
A MetaMat class that holds matrices.
Definition MetaMat.hpp:74
A Newmark class defines a solver using Newmark algorithm.
Definition Newmark.h:45
Definition LeeNewmarkIterative.h:53
double zeta
Definition LeeNewmarkIterative.h:56
double omega
Definition LeeNewmarkIterative.h:56
Type t
Definition LeeNewmarkIterative.h:54
vec p
Definition LeeNewmarkIterative.h:55