suanPan
Maxwell.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright (C) 2017-2023 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 MAXWELL_H
29 #define MAXWELL_H
30 
32 
33 class Maxwell final : public Material1D {
34  static constexpr unsigned max_iteration = 20;
35 
36  const double* incre_time = nullptr;
37 
38  unsigned counter = 0, delay_counter = 0;
39  const unsigned damper_tag, spring_tag;
40  const unsigned proceed;
41 
42  const bool use_matrix;
43 
44  double beta;
45 
46  unique_ptr<Material> damper, spring;
47 
48 public:
49  Maxwell(unsigned, // tag
50  unsigned, // damper tag
51  unsigned, // spring tag
52  bool = false, // if to use matrix
53  unsigned = 0, // if to process when fails to converge
54  double = 0. // beta
55  );
56  Maxwell(const Maxwell&);
57  Maxwell(Maxwell&&) = delete;
58  Maxwell& operator=(const Maxwell&) = delete;
59  Maxwell& operator=(Maxwell&&) = delete;
60  ~Maxwell() override = default;
61 
62  int initialize(const shared_ptr<DomainBase>&) override;
63 
64  unique_ptr<Material> get_copy() override;
65 
66  int update_trial_status(const vec&) override;
67  int update_trial_status(const vec&, const vec&) override;
68 
69  int clear_status() override;
70  int commit_status() override;
71  int reset_status() override;
72 
73  vector<vec> record(OutputType) override;
74 
75  void print() override;
76 };
77 
78 #endif
79 
OutputType
Definition: OutputType.h:21
A Material1D class.
Definition: Material1D.h:36
A 1D Maxwell material class.
Definition: Maxwell.h:33
unique_ptr< Material > get_copy() override
Definition: Maxwell.cpp:58
Maxwell(Maxwell &&)=delete
int commit_status() override
Definition: Maxwell.cpp:161
void print() override
Definition: Maxwell.cpp:194
vector< vec > record(OutputType) override
Definition: Maxwell.cpp:179
Maxwell & operator=(const Maxwell &)=delete
Maxwell(unsigned, unsigned, unsigned, bool=false, unsigned=0, double=0.)
Definition: Maxwell.cpp:23
int clear_status() override
Definition: Maxwell.cpp:152
int initialize(const shared_ptr< DomainBase > &) override
Definition: Maxwell.cpp:42
int reset_status() override
Definition: Maxwell.cpp:170
~Maxwell() override=default
int update_trial_status(const vec &) override
Definition: Maxwell.cpp:60
Maxwell & operator=(Maxwell &&)=delete