Hermes2D  3.0
l2_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_L2_PROJ_BASED_SELECTOR_H
17 #define __H2D_REFINEMENT_SELECTORS_L2_PROJ_BASED_SELECTOR_H
18 
19 #include "proj_based_selector.h"
20 #include "shapeset/shapeset_l2_all.h"
21 namespace Hermes
22 {
23  namespace Hermes2D
24  {
25  namespace RefinementSelectors {
27 
31  template<typename Scalar>
32  class HERMES_API L2ProjBasedSelector : public ProjBasedSelector < Scalar > {
33  public: //API
35 
38  L2ProjBasedSelector(CandList cand_list = H2D_HP_ANISO, int max_order = H2DRS_DEFAULT_ORDER, L2Shapeset* user_shapeset = nullptr);
40  ~L2ProjBasedSelector();
41 
42  protected: //overloads
45  H2D_L2FE_VALUE = 0,
46  H2D_L2FE_NUM = 1
47  };
48 
50 
54  virtual void get_current_order_range(Element* element, int& min_order, int& max_order);
55 
57 
58  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]);
59 
61  virtual void free_ref_solution_data(int inx_son, Scalar* rval[H2D_MAX_ELEMENT_SONS][MAX_NUMBER_FUNCTION_VALUES_FOR_SELECTORS]);
62 
64 
65  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);
66 
68 
69  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);
70 
72 
73  virtual double** build_projection_matrix(double3* gip_points, int num_gip_points, const int* shape_inx, const int num_shapes, ElementMode2D mode);
74 
76 
77  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]);
78 
80 
81  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]);
82 
85  };
86  }
87  }
88 }
89 #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.
H-, ANISO- and P-candidates. Hermes::Orders are modified non-uniformly.
Definition: candidates.h:55
bool user_shapeset
If the shapeset is not from the user, we shall delete it in the destructor.
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
L2ShapesetLegendre L2Shapeset
This is the default shapeset typedef.