Hermes2D  2.0
hcurl_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_HCURL_PROJ_BASED_SELECTOR_H
17 #define __H2D_REFINEMENT_SELECTORS_HCURL_PROJ_BASED_SELECTOR_H
18 
19 #include "proj_based_selector.h"
20 #include <complex>
21 namespace Hermes
22 {
23  namespace Hermes2D
24  {
25  namespace RefinementSelectors {
27 
31  template<typename Scalar>
32  class HERMES_API HcurlProjBasedSelector : public ProjBasedSelector<Scalar> {
33  public: //API
35 
39  HcurlProjBasedSelector(CandList cand_list = H2D_HP_ANISO, double conv_exp = 1.0, int max_order = H2DRS_DEFAULT_ORDER, HcurlShapeset* user_shapeset = NULL);
40 
42  virtual Selector<Scalar>* clone();
43 
45  virtual ~HcurlProjBasedSelector();
46 
47  protected: //overloads
50  H2D_HCFE_VALUE0 = 0,
51  H2D_HCFE_VALUE1 = 1,
52  H2D_HCFE_CURL = 2,
53  H2D_HCFE_NUM = 3
54  };
55 
56  Scalar* precalc_rvals[H2D_MAX_ELEMENT_SONS][H2D_HCFE_NUM];
57  Scalar** precalc_rvals_curl;
58 
59  static const int H2DRS_MAX_HCURL_ORDER;
60 
62 
64  virtual void set_current_order_range(Element* element);
65 
67 
68  virtual Scalar** precalc_ref_solution(int inx_son, Solution<Scalar>* rsln, Element* element, int intr_gip_order);
69 
71 
72  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);
73 
75 
76  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);
77 
79 
80  virtual double** build_projection_matrix(double3* gip_points, int num_gip_points, const int* shape_inx, const int num_shapes, ElementMode2D mode);
81 
83 
84  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);
85 
87 
88  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);
89  };
90  }
91  }
92 }
93 #endif