Hermes2D  2.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 "refinement_type.h"
20 namespace Hermes
21 {
22  namespace Hermes2D
23  {
24  namespace RefinementSelectors{
25  template<typename Scalar> class Selector;
26  template<typename Scalar> class HOnlySelector;
27  template<typename Scalar> class POnlySelector;
28  template<typename Scalar> class OptimumSelector;
29  };
30 
32 
34  class HERMES_API ElementToRefine {
35  public:
38 
40 
42  ElementToRefine(int id, int comp);
43 
45  ElementToRefine(const ElementToRefine &orig);
46 
48  ElementToRefine& operator=(const ElementToRefine& orig);
49  private:
50  int id;
51  int comp;
52  int split;
53  int p[H2D_MAX_ELEMENT_SONS];
54  int q[H2D_MAX_ELEMENT_SONS];
55 
57 
58  int get_num_sons() const;
59 
61 
64  static void copy_orders(int* dest, const int* src);
65  template<typename T> friend class Adapt;
66  template<typename T> friend class RefinementSelectors::Selector;
67  template<typename T> friend class RefinementSelectors::HOnlySelector;
68  template<typename T> friend class RefinementSelectors::POnlySelector;
69  template<typename T> friend class RefinementSelectors::OptimumSelector;
70  };
71  }
72 }
73 #endif