suanPan
🧮 An Open Source, Parallel and Heterogeneous Finite Element Analysis Framework
Loading...
Searching...
No Matches
SubloadingUtil.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 ******************************************************************************/
17
18#ifndef SUBLOADINGUTIL_H
19#define SUBLOADINGUTIL_H
20
21#include <array>
22#include <cmath>
23#include <utility>
24
26 const double initial, linear, saturation, rate;
27
28 [[nodiscard]] std::pair<double, double> operator()(const double q, const bool check_positive) const {
29 const auto exp_term = saturation * std::exp(-rate * q);
30 const auto y = initial + saturation + linear * q - exp_term;
31 return y < 0. && check_positive ? std::make_pair(0., 0.) : std::make_pair(y, linear + rate * exp_term);
32 }
33};
34
36 const double rate, bound;
37
38public:
39 SubloadingSaturation(const double R, const double B)
40 : rate(R)
41 , bound(B) {}
42
43 [[nodiscard]] double r() const { return rate; }
44 [[nodiscard]] double b() const { return bound; }
45 [[nodiscard]] double rb() const { return r() * b(); }
46};
47
49 static constexpr double z_bound = 1E-15;
50 inline static const double rate_bound = -std::log(z_bound);
51
52protected:
53 static std::array<double, 2> yield_ratio(const double z) {
54 if(z < z_bound) return {rate_bound, 0.};
55
56 return {-log(z), -1. / z};
57 }
58};
59
60#endif
Definition SubloadingUtil.h:48
static std::array< double, 2 > yield_ratio(const double z)
Definition SubloadingUtil.h:53
Definition SubloadingUtil.h:35
double r() const
Definition SubloadingUtil.h:43
double b() const
Definition SubloadingUtil.h:44
SubloadingSaturation(const double R, const double B)
Definition SubloadingUtil.h:39
double rb() const
Definition SubloadingUtil.h:45
Definition SubloadingUtil.h:25
const double initial
Definition SubloadingUtil.h:26
const double linear
Definition SubloadingUtil.h:26
const double rate
Definition SubloadingUtil.h:26
std::pair< double, double > operator()(const double q, const bool check_positive) const
Definition SubloadingUtil.h:28
const double saturation
Definition SubloadingUtil.h:26