Hermes2D  3.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 "shapeset/shapeset_hc_all.h"
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 
38  HcurlProjBasedSelector(CandList cand_list = H2D_HP_ANISO, int max_order = H2DRS_DEFAULT_ORDER, HcurlShapeset* user_shapeset = nullptr);
39 
41  virtual ~HcurlProjBasedSelector();
42 
43  protected: //overloads
46  H2D_HCFE_VALUE0 = 0,
47  H2D_HCFE_VALUE1 = 1,
48  H2D_HCFE_CURL = 2,
49  H2D_HCFE_NUM = 3
50  };
51 
53  Scalar* precalc_rvals[H2D_MAX_ELEMENT_SONS][H2D_HCFE_NUM];
54 
56  static const int H2DRS_MAX_HCURL_ORDER;
57 
59 
61  virtual void get_current_order_range(Element* element, int& min_order, int& max_order);
62 
64 
65  virtual void precalc_ref_solution(int inx_son, MeshFunction<Scalar>* rsln, Element* element, int intr_gip_order, Scalar* rval[H2D_MAX_ELEMENT_SONS][MAX_NUMBER_FUNCTION_VALUES_FOR_SELECTORS]);
66 
68  virtual void free_ref_solution_data(int inx_son, Scalar* rval[H2D_MAX_ELEMENT_SONS][MAX_NUMBER_FUNCTION_VALUES_FOR_SELECTORS]);
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 std::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 std::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, int son, const typename ProjBasedSelector<Scalar>::ElemSubTrf& sub_trf, const typename ProjBasedSelector<Scalar>::ElemSubShapeFunc& sub_shape, Scalar* rval[H2D_MAX_ELEMENT_SONS][MAX_NUMBER_FUNCTION_VALUES_FOR_SELECTORS]);
85 
87 
88  virtual double evaluate_error_squared_subdomain(Element* sub_elem, const typename ProjBasedSelector<Scalar>::ElemGIP& sub_gip, int son, const typename ProjBasedSelector<Scalar>::ElemSubTrf& sub_trf, const typename ProjBasedSelector<Scalar>::ElemProj& elem_proj, Scalar* rval[H2D_MAX_ELEMENT_SONS][MAX_NUMBER_FUNCTION_VALUES_FOR_SELECTORS]);
89 
90  friend class ProjBasedSelector < Scalar > ;
91  };
92  }
93  }
94 }
95 #endif
Definition: adapt.h:24
LocalFuncExpansion
A function expansion of a function f used by this selector.
Stores one element of a mesh.
Definition: element.h:107
Represents a function defined on a mesh.
Definition: mesh_function.h:56
Integration points in the reference domain of an element of a candidate.
HcurlShapesetGradLeg HcurlShapeset
This is the default Hcurl shapeset typedef.
H-, ANISO- and P-candidates. Hermes::Orders are modified non-uniformly.
Definition: candidates.h:55
A general projection-based selector.
Definition: function.h:33
CandList
Predefined list of candidates.
Definition: candidates.h:46
2D transformation.
Definition: transformable.h:29
A transformation from a reference domain of a subdomain to a reference domain of an element of a cand...
static const int H2DRS_MAX_HCURL_ORDER
A maximum used order in this Hcurl-space selector.
#define H2D_MAX_ELEMENT_SONS
Macros.
Definition: global.h:30
#define H2DRS_DEFAULT_ORDER
A default order. Used to indicate an unkonwn order or a maximum support order.
Definition: global.h:103