suanPan
NonlinearNM2D.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (C) 2017-2022 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 NONLINEARNM2D_H
30 #define NONLINEARNM2D_H
31 
32 #include "SectionNM2D.h"
33 
34 class NonlinearNM2D : public SectionNM2D {
35  static constexpr unsigned max_iteration = 20;
36  static const uvec sai, saj, sbi, sbj, sa, sb;
37 
38  const bool has_kinematic;
39 
40  const unsigned local_size = has_kinematic ? 8u : 5u;
41 
42  const uvec si{local_size - 2llu}, sj{local_size - 1llu};
43 
44  const span spa = span(0llu, local_size - 2llu);
45 
46  mat plastic_weight, kin_weight;
47 
48  [[nodiscard]] virtual double compute_h(double) const = 0;
49  [[nodiscard]] virtual double compute_dh(double) const = 0;
50 
51  [[nodiscard]] virtual double compute_f(const vec&) const = 0;
52  [[nodiscard]] virtual vec compute_df(const vec&) const = 0;
53  [[nodiscard]] virtual mat compute_ddf(const vec&) const = 0;
54 
55 protected:
56  void initialize_weight(const vec&, double);
57 
58 public:
59  NonlinearNM2D(unsigned, // tag
60  double,
61  double,
62  double,
63  double);
64 
65  int update_trial_status(const vec&) override;
66 
67  vector<vec> record(OutputType) override;
68 };
69 
70 #endif
71 
A SectionNM2D class.
Definition: SectionNM2D.h:39
A NonlinearNM2D class.
Definition: NonlinearNM2D.h:34
OutputType
Definition: OutputType.h:21
int update_trial_status(const vec &) override
Definition: NonlinearNM2D.cpp:39
NonlinearNM2D(unsigned, double, double, double, double)
Definition: NonlinearNM2D.cpp:35
void initialize_weight(const vec &, double)
Definition: NonlinearNM2D.cpp:30
vector< vec > record(OutputType) override
Definition: NonlinearNM2D.cpp:205