suanPan
LeeNewmark.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 LEENEWMARK_H
34#define LEENEWMARK_H
35
36#include "LeeNewmarkBase.h"
37
38class LeeNewmark : public LeeNewmarkBase {
39 const vec mass_coef, stiffness_coef;
40
41 const uword n_damping = mass_coef.n_elem;
42
43 const double CM;
44
45 [[nodiscard]] uword get_total_size() const override;
46
47 void update_stiffness() const override;
48 void update_residual() const override;
49
50 virtual void initialize_mass(const shared_ptr<DomainBase>&);
51 virtual void initialize_stiffness(const shared_ptr<DomainBase>&);
52
53protected:
54 shared_ptr<MetaMat<double>> current_mass = nullptr;
55 shared_ptr<MetaMat<double>> current_stiffness = nullptr;
56 shared_ptr<MetaMat<double>> current_geometry = nullptr;
57
58public:
59 LeeNewmark(unsigned, vec&&, vec&&, double, double);
60
61 int initialize() override;
62
63 int process_constraint() override;
64 int process_constraint_resistance() override;
65
66 void assemble_resistance() override;
67
68 void print() override;
69};
70
71class LeeElementalNewmark final : public LeeNewmark {
72 void initialize_mass(const shared_ptr<DomainBase>&) override;
73 void initialize_stiffness(const shared_ptr<DomainBase>&) override;
74
75public:
77};
78
79#endif
80
Definition: LeeNewmark.h:71
A LeeNewmarkBase class defines a solver using Newmark algorithm with Lee damping model.
Definition: LeeNewmarkBase.h:36
A LeeNewmark class defines a solver using Newmark algorithm with Lee damping model.
Definition: LeeNewmark.h:38
void assemble_resistance() override
Definition: LeeNewmark.cpp:152
void print() override
Definition: LeeNewmark.cpp:174
shared_ptr< MetaMat< double > > current_stiffness
Definition: LeeNewmark.h:55
shared_ptr< MetaMat< double > > current_geometry
Definition: LeeNewmark.h:56
int process_constraint() override
Definition: LeeNewmark.cpp:100
int process_constraint_resistance() override
Definition: LeeNewmark.cpp:146
int initialize() override
Definition: LeeNewmark.cpp:90
shared_ptr< MetaMat< double > > current_mass
Definition: LeeNewmark.h:54
LeeNewmark(unsigned, vec &&, vec &&, double, double)
Definition: LeeNewmark.cpp:84