Hermes2D  2.0
h1_proj_based_selector.h
1 // This file is part of Hermes2D.
2 //
3 // Hermes2D is free software: you can redistribute it and/or modify
4 // it under the terms of the GNU General Public License as published by
5 // the Free Software Foundation, either version 2 of the License, or
6 // (at your option) any later version.
7 //
8 // Hermes2D is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License
14 // along with Hermes2D. If not, see <http://www.gnu.org/licenses/>.
15 
16 #ifndef __H2D_REFINEMENT_SELECTORS_H1_PROJ_BASED_SELECTOR_H
17 #define __H2D_REFINEMENT_SELECTORS_H1_PROJ_BASED_SELECTOR_H
18 
19 #include "proj_based_selector.h"
20 namespace Hermes
21 {
22  namespace Hermes2D
23  {
24  namespace RefinementSelectors {
26 
30  template<typename Scalar>
31  class HERMES_API H1ProjBasedSelector : public ProjBasedSelector<Scalar> {
32  public: //API
34 
38  H1ProjBasedSelector(CandList cand_list = H2D_HP_ANISO, double conv_exp = 1.0, int max_order = H2DRS_DEFAULT_ORDER, H1Shapeset* user_shapeset = NULL);
39 
41  ~H1ProjBasedSelector();
42 
44  virtual Selector<Scalar>* clone();
45 
46  protected: //overloads
49  H2D_H1FE_VALUE = 0,
50  H2D_H1FE_DX = 1,
51  H2D_H1FE_DY = 2,
52  H2D_H1FE_NUM = 3
53  };
54 
55  static const int H2DRS_MAX_H1_ORDER;
56 
57  Scalar* precalc_rvals[H2D_MAX_ELEMENT_SONS][H2D_H1FE_NUM];
58 
60 
63  virtual void set_current_order_range(Element* element);
64 
66 
67  virtual Scalar** precalc_ref_solution(int inx_son, Solution<Scalar>* rsln, Element* element, int intr_gip_order);
68 
70 
71  virtual void precalc_shapes(const double3* gip_points, const int num_gip_points, const Trf* trfs, const int num_noni_trfs, const Hermes::vector<typename OptimumSelector<Scalar>::ShapeInx>& shapes, const int max_shape_inx, typename ProjBasedSelector<Scalar>::TrfShape& svals, ElementMode2D mode);
72 
74 
75  virtual void precalc_ortho_shapes(const double3* gip_points, const int num_gip_points, const Trf* trfs, const int num_noni_trfs, const Hermes::vector<typename OptimumSelector<Scalar>::ShapeInx>& shapes, const int max_shape_inx, typename ProjBasedSelector<Scalar>::TrfShape& svals, ElementMode2D mode);
76 
78 
79  virtual double** build_projection_matrix(double3* gip_points, int num_gip_points, const int* shape_inx, const int num_shapes, ElementMode2D mode);
80 
82 
83  virtual Scalar evaluate_rhs_subdomain(Element* sub_elem, const typename ProjBasedSelector<Scalar>::ElemGIP& sub_gip, const typename ProjBasedSelector<Scalar>::ElemSubTrf& sub_trf, const typename ProjBasedSelector<Scalar>::ElemSubShapeFunc& sub_shape);
84 
86 
87  virtual double evaluate_error_squared_subdomain(Element* sub_elem, const typename ProjBasedSelector<Scalar>::ElemGIP& sub_gip, const typename ProjBasedSelector<Scalar>::ElemSubTrf& sub_trf, const typename ProjBasedSelector<Scalar>::ElemProj& elem_proj);
88 
91  };
92  }
93  }
94 }
95 #endif