suanPan
GCMQ.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  ******************************************************************************/
34 #ifndef GCMQ_H
35 #define GCMQ_H
36 
37 #include "SGCMQ.h"
38 
39 class IntegrationPlan;
40 
41 class GCMQ final : public SGCMQ {
42  struct ResultantConverter final {
43  enum class Edge {
44  A,
45  B,
46  C,
47  D
48  };
49 
50  mat converter_a, converter_b;
51  mat direction_cosine;
52  ResultantConverter(Edge, double, const mat&, const IntegrationPlan&, const mat&);
53  [[nodiscard]] double F(const vec&) const;
54  [[nodiscard]] double V(const vec&) const;
55  [[nodiscard]] double M(const vec&) const;
56  };
57 
58  static constexpr int enhanced_mode = 2;
59 
60  vector<ResultantConverter> edge;
61 
62  const mat mat_stiffness, iso_mapping;
63 
64  mat HT, NT, MT, N, M; // constant matrices
65 
66  mat initial_viwt, trial_viwt, current_viwt;
67  vec trial_vif, current_vif;
68  vec trial_zeta, current_zeta; // enhanced strain
69  vec trial_beta, current_beta; // strain
70  vec trial_alpha, current_alpha; // stress
71  vec trial_q, current_q;
72 
73  vec pre_disp;
74 
75  static mat form_transformation(const mat&);
76  static mat form_enhanced_strain(const vec&, int);
77 
78 public:
79  using SGCMQ::SGCMQ;
80 
81  int initialize(const shared_ptr<DomainBase>&) override;
82 
83  int update_status() override;
84 
85  int commit_status() override;
86  int clear_status() override;
87  int reset_status() override;
88 
89  [[nodiscard]] mat compute_shape_function(const mat&, unsigned) const override;
90 
91  vector<vec> record(OutputType) override;
92 
93  void print() override;
94 
95 #ifdef SUANPAN_VTK
96  mat GetData(OutputType) override;
97 #endif
98 };
99 
100 #endif
101 
OutputType
Definition: OutputType.h:21
A GCMQ class.
Definition: GCMQ.h:41
int commit_status() override
Definition: GCMQ.cpp:241
int update_status() override
Definition: GCMQ.cpp:211
int initialize(const shared_ptr< DomainBase > &) override
Definition: GCMQ.cpp:132
vector< vec > record(OutputType) override
Definition: GCMQ.cpp:283
mat compute_shape_function(const mat &, unsigned) const override
Definition: GCMQ.cpp:281
void print() override
Definition: GCMQ.cpp:318
int reset_status() override
Definition: GCMQ.cpp:268
int clear_status() override
Definition: GCMQ.cpp:254
An IntegrationPlan class.
Definition: IntegrationPlan.h:77
A SGCMQ class.
Definition: SGCMQ.h:39
SGCMQ(unsigned, uvec &&, unsigned, double=1., char='I')
Definition: SGCMQ.cpp:154