Hermes2D  3.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 #include "shapeset/shapeset_h1_all.h"
21 
22 namespace Hermes
23 {
24  namespace Hermes2D
25  {
26  namespace RefinementSelectors {
28 
32  template<typename Scalar>
33  class HERMES_API H1ProjBasedSelector : public ProjBasedSelector < Scalar > {
34  public: //API
36 
39  H1ProjBasedSelector(CandList cand_list = H2D_HP_ANISO, int max_order = H2DRS_DEFAULT_ORDER, H1Shapeset* user_shapeset = nullptr);
40 
42  ~H1ProjBasedSelector();
43 
44  protected: //overloads
47  H2D_H1FE_VALUE = 0,
48  H2D_H1FE_DX = 1,
49  H2D_H1FE_DY = 2,
50  H2D_H1FE_NUM = 3
51  };
52 
54 
57  virtual void get_current_order_range(Element* element, int& min_order, int& max_order);
58 
60 
61  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]);
62 
64  virtual void free_ref_solution_data(int inx_son, Scalar* rval[H2D_MAX_ELEMENT_SONS][MAX_NUMBER_FUNCTION_VALUES_FOR_SELECTORS]);
65 
67 
68  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);
69 
71 
72  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);
73 
75 
76  virtual double** build_projection_matrix(double3* gip_points, int num_gip_points, const int* shape_inx, const int num_shapes, ElementMode2D mode);
77 
79 
80  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]);
81 
83 
84  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]);
85 
88  };
89  }
90  }
91 }
92 #endif
bool user_shapeset
If the shapeset is not from the user, we shall delete it in the destructor.
H1ShapesetJacobi H1Shapeset
Experimental.
Definition: adapt.h:24
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.
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...
#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
LocalFuncExpansion
A function expansion of a function f used by this selector.