suanPan
NonlinearViscosity.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 ******************************************************************************/
28#ifndef NONLINEARVISCOSITY_H
29#define NONLINEARVISCOSITY_H
30
32
34 const double alpha;
35
36 // cubic replacement
37 const double limit;
38};
39
41 const double a = (.5 * alpha - .5) * pow(limit, alpha - 3.);
42 const double b = (1.5 - .5 * alpha) * pow(limit, alpha - 1.);
43
44 [[nodiscard]] virtual double compute_du(double, double) const = 0;
45 [[nodiscard]] virtual double compute_dv(double, double) const = 0;
46 [[nodiscard]] virtual double compute_damping_coefficient(double, double) const = 0;
47
48public:
50 unsigned, // tag
51 double, // alpha
52 double // cut-off
53 );
54
55 int initialize(const shared_ptr<DomainBase>&) override;
56
57 int update_trial_status(const vec&) final;
58 int update_trial_status(const vec&, const vec&) override;
59
60 int clear_status() override;
61 int commit_status() override;
62 int reset_status() override;
63
64 vector<vec> record(OutputType) override;
65
66 void print() override;
67};
68
69#endif
70
OutputType
Definition: OutputType.h:23
A Material1D class.
Definition: Material1D.h:36
A 1D Viscosity class.
Definition: NonlinearViscosity.h:40
int commit_status() override
Definition: NonlinearViscosity.cpp:86
vector< vec > record(OutputType) override
Definition: NonlinearViscosity.cpp:104
void print() override
Definition: NonlinearViscosity.cpp:112
int update_trial_status(const vec &) final
Definition: NonlinearViscosity.cpp:35
int reset_status() override
Definition: NonlinearViscosity.cpp:95
int initialize(const shared_ptr< DomainBase > &) override
Definition: NonlinearViscosity.cpp:25
NonlinearViscosity(unsigned, double, double)
Definition: NonlinearViscosity.cpp:21
int clear_status() override
Definition: NonlinearViscosity.cpp:77
Definition: NonlinearViscosity.h:33
const double alpha
Definition: NonlinearViscosity.h:34
const double limit
Definition: NonlinearViscosity.h:37