suanPan
NonlinearNM3D.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 NONLINEARNM3D_H
30 #define NONLINEARNM3D_H
31 
32 #include "SectionNM3D.h"
33 
34 class NonlinearNM3D : public SectionNM3D {
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 ? 12u : 7u;
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  NonlinearNM3D(unsigned, // tag
60  double,
61  double,
62  double,
63  double,
64  double);
65 
66  int update_trial_status(const vec&) override;
67 
68  vector<vec> record(OutputType) override;
69 };
70 
71 #endif
72 
A SectionNM3D class.
Definition: SectionNM3D.h:40
A NonlinearNM3D class.
Definition: NonlinearNM3D.h:34
OutputType
Definition: OutputType.h:21
int update_trial_status(const vec &) override
Definition: NonlinearNM3D.cpp:39
vector< vec > record(OutputType) override
Definition: NonlinearNM3D.cpp:204
NonlinearNM3D(unsigned, double, double, double, double, double)
Definition: NonlinearNM3D.cpp:35
void initialize_weight(const vec &, double)
Definition: NonlinearNM3D.cpp:30