suanPan
🧮 An Open Source, Parallel and Heterogeneous Finite Element Analysis Framework
Loading...
Searching...
No Matches
LeeNewmarkBase.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2026 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 ******************************************************************************/
29#ifndef LEENEWMARKBASE_H
30#define LEENEWMARKBASE_H
31
32#include "../Newmark.h"
33
34#include <Domain/Factory.hpp>
36
37class LeeNewmarkBase : public Newmark {
38public:
39 enum class StiffnessType : std::uint8_t {
40 INITIAL,
41 CURRENT,
42 TRIAL
43 };
44
45protected:
46 const uword n_block;
47
49
50 bool first_iteration = true;
51
53
54 mutable vec residual;
55
56 unique_ptr<MetaMat<double>> stiffness = nullptr;
57
58 shared_ptr<Factory<double>> factory = nullptr;
59
60 [[nodiscard]] virtual uword get_total_size() const = 0;
61
62 virtual void update_stiffness() const = 0;
63 virtual void update_residual() const = 0;
64
65 int erase_top_left_block() const;
66
67public:
68 LeeNewmarkBase(unsigned, double, double, StiffnessType = StiffnessType::CURRENT);
69
70 int initialize() override;
71
72 int update_internal(const mat&) final;
73
74 int solve(mat&, const mat&) final;
75 int solve(mat&, const sp_mat&) final;
76 int solve(mat&, mat&&) final;
77 int solve(mat&, sp_mat&&) final;
78
79 vec get_force_residual() final;
80 vec get_displacement_residual() final;
81
82 void commit_status() final;
83 void clear_status() final;
84 void reset_status() final;
85};
86
87#endif
88
A LeeNewmarkBase class defines a solver using Newmark algorithm with Lee damping model.
Definition LeeNewmarkBase.h:37
bool first_iteration
Definition LeeNewmarkBase.h:50
const uword n_block
Definition LeeNewmarkBase.h:46
unique_ptr< MetaMat< double > > stiffness
Definition LeeNewmarkBase.h:56
vec current_internal
Definition LeeNewmarkBase.h:52
virtual void update_stiffness() const =0
StiffnessType
Definition LeeNewmarkBase.h:39
vec get_displacement_residual() final
Definition LeeNewmarkBase.cpp:108
void clear_status() final
Definition LeeNewmarkBase.cpp:122
int update_internal(const mat &) final
Definition LeeNewmarkBase.cpp:82
vec residual
Definition LeeNewmarkBase.h:54
int initialize() override
Definition LeeNewmarkBase.cpp:58
void commit_status() final
Definition LeeNewmarkBase.cpp:114
int erase_top_left_block() const
Definition LeeNewmarkBase.cpp:23
const StiffnessType stiffness_type
Definition LeeNewmarkBase.h:48
virtual uword get_total_size() const =0
int solve(mat &, const mat &) final
Definition LeeNewmarkBase.cpp:88
shared_ptr< Factory< double > > factory
Definition LeeNewmarkBase.h:58
vec get_force_residual() final
Definition LeeNewmarkBase.cpp:102
void reset_status() final
Definition LeeNewmarkBase.cpp:130
virtual void update_residual() const =0
vec trial_internal
Definition LeeNewmarkBase.h:52
A Newmark class defines a solver using Newmark algorithm.
Definition Newmark.h:45