16 #ifndef __H2D_REFINEMENT_OPTIMUM_SELECTOR_H
17 #define __H2D_REFINEMENT_OPTIMUM_SELECTOR_H
21 #include "../shapeset/shapeset.h"
22 #include "candidates.h"
28 namespace RefinementSelectors
33 template<
typename Scalar>
34 class HERMES_API OptimumSelector :
public Selector < Scalar >
38 virtual ~OptimumSelector();
41 void set_dof_score_exponent(
double exponent);
51 OptimumSelector(
CandList cand_list,
int max_order, Shapeset* shapeset,
const Range& vertex_order,
const Range& edge_bubble_order);
65 CandsInfo() : uniform_orders(true), min_quad_order(-1), max_quad_order(-1) {};
69 bool is_empty()
const {
return (min_quad_order < 0 || max_quad_order < 0); };
88 void append_candidates_split(std::vector<Cand>& candidates,
const int start_quad_order,
const int last_order,
const RefinementType split,
bool iso_p);
100 virtual std::vector<Cand> create_candidates(
Element* e,
int quad_order);
124 virtual void select_best_candidate(std::vector<Cand>& candidates,
Element* e,
Cand*& best_candidate,
Cand* best_candidates_specific_type[4]);
149 virtual void evaluate_cands_score(std::vector<Cand>& candidates,
Element* e);
162 static bool compare_cand_score(
const Cand& a,
const Cand& b);
169 virtual void get_current_order_range(
Element* element,
int& min_order,
int& max_order) = 0;
175 H2DST_HORIZ_EDGE = 0x02,
176 H2DST_VERT_EDGE = 0x04,
177 H2DST_TRI_EDGE = 0x08,
207 ShapeInx(
int order_h,
int order_v,
int inx,
ShapeType type) : order_h(order_h), order_v(order_v), inx(inx), type(type) {};
236 void add_bubble_shape_index(
int order_h,
int order_v, std::map<int, bool>& used_shape_index, std::vector<ShapeInx>& indices,
ElementMode2D mode);
244 void build_shape_indices(
const ElementMode2D mode,
const Range& vertex_order,
const Range& edge_bubble_order);
252 int calc_num_shapes(
int mode,
int order_h,
int order_v,
int allowed_type_mask);
int order_v
A minimal vertical order of an element that can use this shape function.
Stores one element of a mesh.
CandsInfo()
Default constructor. Creates info that declares no candidates and uniform orders. ...
bool uniform_orders
True if all elements of all examined candidates have uniform orders.
#define H2DRS_MAX_ORDER
A maximum order suported by refinement selectors.
Information about candidates.
Represents a function defined on a mesh.
ShapeType type
A type of the shape function. It is used to calculate DOF in Optimum::evaluate_cands_dof().
RefinementType
Possible refinements of an element.
double dof_score_exponent
Score DOF exponent. Used in evaluate_cands_score.
CandList cand_list
Allowed candidate types.
ShapeInx(int order_h, int order_v, int inx, ShapeType type)
Constructor.
#define H2D_NUM_MODES
Internal.
ShapeType
A shape function type.
CandList
Predefined list of candidates.
int min_quad_order
Minimum quad order of all elements of all examined candidates.
int inx
An index of the shape function.
Shapeset * shapeset
A shapeset used to calculate error.
Should be exactly the same as is the count of enum ShapesetType.
int max_quad_order
Maximum quad order of all elements of all examined candidates. If less than zero, no candidate is gen...
int order_h
A minimal horizonal order of an element that can use this shape function.
bool is_empty() const
Returns true if there are no candidates.