16 #ifndef __H2D_REFINEMENT_PROJ_BASED_SELECTOR_H
17 #define __H2D_REFINEMENT_PROJ_BASED_SELECTOR_H
19 #include "../global.h"
20 #include "optimum_selector.h"
22 using namespace Hermes::Algebra::DenseMatrixOperations;
27 namespace RefinementSelectors {
48 template<
typename Scalar>
66 double get_error_weight_h()
const;
67 double get_error_weight_p()
const;
68 double get_error_weight_aniso()
const;
71 typedef Hermes::vector<TrfShapeExp> TrfShape[H2D_TRF_NUM];
99 delete [] values; values = NULL;
100 if(other.values == NULL)
101 throw Exceptions::Exception(
"Unable to assign a non-empty values. Use references instead.");
112 void allocate(
int num_expansion,
int num_gip);
117 inline double* operator[](
int inx_expansion);
121 inline bool empty()
const;
127 template<
typename T>
friend class Adapt;
145 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, TrfShape& svals, ElementMode2D mode) {};
187 static const int H2DRS_VALCACHE_INVALID = 0;
188 static const int H2DRS_VALCACHE_VALID = 1;
189 static const int H2DRS_VALCACHE_USER = 2;
196 bool is_valid()
const {
return state != H2DRS_VALCACHE_INVALID; };
200 void mark(
int new_state = H2DRS_VALCACHE_VALID) { state = new_state; };
204 void set(T new_value) { value = new_value; };
208 T
get()
const {
return value; };
214 ValueCacheItem(
const T& value = 0,
const int state = H2DRS_VALCACHE_INVALID) : value(value), state(state) {};
238 Hermes::vector< ValueCacheItem<Scalar> > ortho_rhs_cache;
279 void calc_error_cand_element(
const ElementMode2D mode, double3* gip_points,
int num_gip_points,
const int num_sub,
Element** sub_domains,
Trf** sub_trfs, Scalar*** sub_rvals, Hermes::vector<TrfShapeExp>** sub_nonortho_svals, Hermes::vector<TrfShapeExp>** sub_ortho_svals,
const typename OptimumSelector<Scalar>::CandsInfo& info,
CandElemProjError errors_squared);
325 virtual Scalar** precalc_ref_solution(
int inx_son,
Solution<Scalar>* rsln,
Element* element,
int intr_gip_order) = 0;
334 virtual double** build_projection_matrix(double3* gip_points,
int num_gip_points,
const int* shape_inx,
const int num_shapes, ElementMode2D) = 0;