suanPan
Loading...
Searching...
No Matches
Solver.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright (C) 2017-2025 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
35class Converger;
36class Integrator;
37
38class Solver : public UniqueTag {
39 shared_ptr<Converger> converger = nullptr;
40 shared_ptr<Integrator> modifier = nullptr;
41
42 double step_amplifier = 1.0;
43
44protected:
45 [[nodiscard]] bool constant_matrix() const;
46
47public:
48 explicit Solver(unsigned = 0);
49
50 virtual int initialize();
51
52 virtual int analyze() = 0;
53
54 virtual void set_step_size(double) {}
55
56 void set_step_amplifier(double);
57 [[nodiscard]] double get_step_amplifier() const;
58
59 void set_converger(const shared_ptr<Converger>&);
60 [[nodiscard]] const shared_ptr<Converger>& get_converger() const;
61
62 void set_integrator(const shared_ptr<Integrator>&);
63 [[nodiscard]] const shared_ptr<Integrator>& get_integrator() const;
64};
65
66#endif
67
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
virtual void set_step_size(double)
Definition Solver.h:54
const shared_ptr< Integrator > & get_integrator() const
Definition Solver.cpp:65
const shared_ptr< Converger > & get_converger() const
Definition Solver.cpp:61
void set_step_amplifier(double)
Definition Solver.cpp:55
double get_step_amplifier() const
Definition Solver.cpp:57
virtual int initialize()
Definition Solver.cpp:41
bool constant_matrix() const
Definition Solver.cpp:25
virtual int analyze()=0
void set_integrator(const shared_ptr< Integrator > &)
Definition Solver.cpp:63
void set_converger(const shared_ptr< Converger > &)
Definition Solver.cpp:59
Definition Tag.h:77