suanPan
🧮 An Open Source, Parallel and Heterogeneous Finite Element Analysis Framework
Loading...
Searching...
No Matches
NonlinearViscosity.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 ******************************************************************************/
28#ifndef NONLINEARVISCOSITY_H
29#define NONLINEARVISCOSITY_H
30
32
34 const double alpha;
35 const double limit; // cubic replacement
36};
37
39 const double a = (.5 * alpha - .5) * pow(limit, alpha - 3.);
40 const double b = (1.5 - .5 * alpha) * pow(limit, alpha - 1.);
41
42 [[nodiscard]] virtual double compute_du(double, double) const = 0;
43 [[nodiscard]] virtual double compute_dv(double, double) const = 0;
44 [[nodiscard]] virtual double compute_damping_coefficient(double, double) const = 0;
45
46public:
48 unsigned, // tag
49 double, // alpha
50 double // cut-off
51 );
52
53 int initialize(const shared_ptr<DomainBase>&) override;
54
55 int update_trial_status(const vec&) final;
56 int update_trial_status(const vec&, const vec&) override;
57
58 int clear_status() override;
59 int commit_status() override;
60 int reset_status() override;
61
62 [[nodiscard]] std::vector<vec> record(OutputType) const override;
63
64 void print() override;
65};
66
67#endif
68
OutputType
Definition OutputType.h:23
A Material1D class.
Definition Material1D.h:34
A 1D Viscosity class.
Definition NonlinearViscosity.h:38
int commit_status() override
Definition NonlinearViscosity.cpp:87
std::vector< vec > record(OutputType) const override
Definition NonlinearViscosity.cpp:105
void print() override
Definition NonlinearViscosity.cpp:112
int update_trial_status(const vec &) final
Definition NonlinearViscosity.cpp:36
int reset_status() override
Definition NonlinearViscosity.cpp:96
int initialize(const shared_ptr< DomainBase > &) override
Definition NonlinearViscosity.cpp:26
int clear_status() override
Definition NonlinearViscosity.cpp:78
Definition NonlinearViscosity.h:33
const double alpha
Definition NonlinearViscosity.h:34
const double limit
Definition NonlinearViscosity.h:35