Hermes2D  3.0
element_to_refine.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_ELEMENT_TO_REFINE_H
17 #define __H2D_ELEMENT_TO_REFINE_H
18 
19 #include "global.h"
20 
21 namespace Hermes
22 {
23  namespace Hermes2D
24  {
35  };
36 
38 
40  class HERMES_API ElementToRefine {
41  public:
44 
46 
48  ElementToRefine(int id, unsigned short comp, bool space_only = false);
49 
51  ElementToRefine& operator=(const ElementToRefine& orig);
52 
54  bool valid;
56  bool space_only;
57 
59  int id;
61  unsigned short comp;
65  unsigned short refinement_polynomial_order[H2D_MAX_ELEMENT_SONS];
68  unsigned short best_refinement_polynomial_order_type[4][H2D_MAX_ELEMENT_SONS];
70  double errors[H2D_MAX_ELEMENT_SONS];
71 
73 
74  unsigned short get_num_sons() const;
75 
77 
80  static void copy_orders(unsigned short* dest, const unsigned short* src);
81  static void copy_errors(double* dest, const double* src);
82  private:
84  bool refinement_polynomial_order_changed[H2D_MAX_ELEMENT_SONS];
85  template<typename T> friend class Adapt;
86  template<typename T, typename S> friend class AdaptSolver;
87  };
88  }
89 }
90 #endif
Definition: adapt.h:24
unsigned short comp
An index of the component.
RefinementType
Possible refinements of an element.
Common definitions for Hermes2D.
ANISO-refienement. The element is split along the vertical axis. Quadrilaterals only.
RefinementType split
Proposed refinement. Possible values are defined in the enum RefinementType.
bool space_only
For refinement of Space only for the case when mesh is shared.
int id
An ID of the element.
ANISO-refienement. The element is split along the horizontal axis. Quadrilaterals only...
#define H2D_MAX_ELEMENT_SONS
Macros.
Definition: global.h:30