16 #ifndef __H2D_ADAPT_SOLVER_H
17 #define __H2D_ADAPT_SOLVER_H
20 #include "error_calculator.h"
21 #include "../solver/linear_solver.h"
22 #include "../solver/newton_solver.h"
23 #include "../solver/picard_solver.h"
24 #include "../refinement_selectors/selector.h"
25 #include <unordered_set>
35 virtual bool done(
double error,
unsigned short iteration) = 0;
42 virtual bool done(
double error,
unsigned short iteration);
43 double error_threshold;
50 virtual bool done(
double error,
unsigned short iteration);
51 unsigned short refinement_levels;
65 template<
typename Scalar,
typename SolverType>
67 public Hermes::Mixins::TimeMeasurable,
68 public Hermes::Mixins::Loggable,
69 public Hermes::Mixins::StateQueryable
86 std::vector<MeshFunctionSharedPtr<Scalar> > get_slns();
92 std::vector<MeshFunctionSharedPtr<Scalar> > get_ref_slns();
98 void switch_visualization(
bool on_off,
bool wait_for_keypress);
112 SolverType* get_solver();
113 std::vector<SpaceSharedPtr<Scalar> > get_initial_spaces();
117 std::vector<RefinementSelectors::Selector<Scalar>*> get_selectors();
121 virtual void set_verbose_output(
bool to_set);
126 virtual bool isOkay()
const;
127 inline std::string getClassName()
const {
return "AdaptSolver"; }
133 void deinit_solving();
139 void mark_elements_to_reassemble();
149 bool solve_method_running;
154 std::vector<SpaceSharedPtr<Scalar> > spaces;
157 std::vector<SpaceSharedPtr<Scalar> > ref_spaces;
158 std::vector<SpaceSharedPtr<Scalar> > prev_ref_spaces;
178 std::vector<RefinementSelectors::Selector<Scalar>*> selectors;
181 std::vector<MeshFunctionSharedPtr<Scalar> > ref_slns;
182 std::vector<MeshFunctionSharedPtr<Scalar> > slns;
183 std::vector<MeshFunctionSharedPtr<Scalar> > exact_slns;
186 std::vector<Views::ScalarView*> scalar_views;
187 std::vector<Views::OrderView*> order_views;
188 std::vector<Views::BaseView<Scalar>*> base_views;
197 unsigned short adaptivity_step;
201 std::unordered_set<unsigned int> elements_to_reassemble[H2D_MAX_COMPONENTS];
202 std::unordered_set<int> DOFs_to_reassemble[H2D_MAX_COMPONENTS];
205 CSCMatrix<Scalar>* prev_mat;
207 Vector<Scalar>* prev_rhs, *prev_dirichlet_lift_rhs;
213 bool wait_for_keypress;
216 unsigned int total_elements_prev_spaces;
219 std::vector<RefinementSelectors::Selector<Scalar>*> hOnlySelectors;
220 std::vector<RefinementSelectors::Selector<Scalar>*> pOnlySelectors;
223 unsigned char number_of_equations;
Used to pass the instances of Space around.
Evaluation of an error between a (coarse) solution and a reference solution.
::xsd::cxx::tree::string< char, simple_type > string
C++ type corresponding to the string XML Schema built-in type.
A parent of all refinement selectors. Abstract class.
::xsd::cxx::tree::error< char > error
Error condition.