suanPan
Solver.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  ******************************************************************************/
30 #ifndef SOLVER_H
31 #define SOLVER_H
32 
33 #include <Domain/Tag.h>
34 
35 class Converger;
36 class Integrator;
37 
38 class Solver : public Tag {
39  shared_ptr<Converger> converger = nullptr;
40  shared_ptr<Integrator> modifier = nullptr;
41 
42 public:
43  explicit Solver(unsigned = 0);
44  Solver(const Solver&) = default;
45  Solver(Solver&&) = default;
46  Solver& operator=(const Solver&) = delete;
47  Solver& operator=(Solver&&) = delete;
48  ~Solver() override = default;
49 
50  virtual int initialize();
51 
52  virtual int analyze() = 0;
53 
54  void set_converger(const shared_ptr<Converger>&);
55  [[nodiscard]] const shared_ptr<Converger>& get_converger() const;
56 
57  void set_integrator(const shared_ptr<Integrator>&);
58  [[nodiscard]] const shared_ptr<Integrator>& get_integrator() const;
59 
60  [[nodiscard]] bool constant_matrix() const;
61 };
62 
63 #endif
64 
The Converger class handles converger test to indicate if the iteration converges according to variou...
Definition: Converger.h:44
The Integrator class is basically a wrapper of the DomainBase class with regard to some status changi...
Definition: Integrator.h:51
A Solver class defines solvers used in analysis.
Definition: Solver.h:38
Solver(const Solver &)=default
const shared_ptr< Integrator > & get_integrator() const
Definition: Solver.cpp:47
~Solver() override=default
const shared_ptr< Converger > & get_converger() const
Definition: Solver.cpp:43
Solver & operator=(Solver &&)=delete
virtual int initialize()
Definition: Solver.cpp:27
bool constant_matrix() const
Definition: Solver.cpp:49
virtual int analyze()=0
Solver & operator=(const Solver &)=delete
Solver(Solver &&)=default
void set_integrator(const shared_ptr< Integrator > &)
Definition: Solver.cpp:45
Solver(unsigned=0)
Definition: Solver.cpp:24
void set_converger(const shared_ptr< Converger > &)
Definition: Solver.cpp:41
A base Tag class.
Definition: Tag.h:38