b2api
B2000++ API Reference Manual, VERSION 4.6
 
Loading...
Searching...
No Matches
b2static_linear_p_refinement_solver.H
1//------------------------------------------------------------------------
2// b2static_linear_p_refinement_solver.H --
3//
4//
5// written by Mathias Doreille
6// Neda Ebrahimi Pour <neda.ebrahimipour@dlr.de>
7// Thomas Blome <thomas.blome@dlr.de>
8//
9// (c) 2004-2012 SMR Engineering & Development SA
10// 2502 Bienne, Switzerland
11//
12// (c) 2023 Deutsches Zentrum für Luft- und Raumfahrt (DLR) e.V.
13// Linder Höhe, 51147 Köln
14//
15// All Rights Reserved. Proprietary source code. The contents of
16// this file may not be disclosed to third parties, copied or
17// duplicated in any form, in whole or in part, without the prior
18// written permission of SMR.
19//------------------------------------------------------------------------
20
21#ifndef B2STATIC_LINEAR_P_REFINEMENT_SOLVER_H_
22#define B2STATIC_LINEAR_P_REFINEMENT_SOLVER_H_
23
24#include "b2static_linear_solver.H"
25
26namespace b2000::solver {
27
36template <typename T, typename MATRIX_FORMAT>
37class StaticLinearPRefinementSolver : public StaticLinearSolver<T, MATRIX_FORMAT> {
38public:
41 using StaticLinearSolver<T, MATRIX_FORMAT>::case_iterator_;
42
43 void solve() {
44 while (solve_iteration()) { ; }
45 }
46
48 if (case_iterator_.get() == nullptr) {
49 case_iterator_ =
50 StaticLinearSolver<T, MATRIX_FORMAT>::model_->get_case_list().get_case_iterator();
51 this->case_ = case_iterator_->next();
52 }
53 if (this->case_ == nullptr) {
54 // All the case are solved.
55 return false;
56 }
58 if (!StaticLinearSolver<T, MATRIX_FORMAT>::model_->get_solution().is_need_refinement()) {
59 // Go to the next case
60 this->case_ = case_iterator_->next();
61 }
62 return this->case_ != nullptr;
63 }
64
65 static type_t type;
66};
67
68template <typename T, typename MATRIX_FORMAT>
69typename StaticLinearPRefinementSolver<T, MATRIX_FORMAT>::type_t
70 StaticLinearPRefinementSolver<T, MATRIX_FORMAT>::type(
71 "StaticLinearPRefinementSolver", type_name<T, MATRIX_FORMAT>(),
72 StringList("LINEAR_P_REFINEMENT"), module, &Solver::type);
73
74} // namespace b2000::solver
75
76#endif // B2STATIC_LINEAR_P_REFINEMENT_SOLVER_H_
Definition b2object.H:415
Case * case_
This also.
Definition b2solver.H:93
Definition b2util.H:54
Definition b2static_linear_p_refinement_solver.H:37
void solve()
This function is usually called by the Model instance.
Definition b2static_linear_p_refinement_solver.H:43
bool solve_iteration()
This function is called by the Solver instance itself.
Definition b2static_linear_p_refinement_solver.H:47
Definition b2static_linear_solver.H:70