Hermes2D  3.0
order_permutator.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_ORDER_PERMUTATOR_H
17 #define __H2D_REFINEMENT_ORDER_PERMUTATOR_H
18 
19 #include "hermes_common.h"
20 
21 namespace Hermes
22 {
23  namespace Hermes2D
24  {
25  namespace RefinementSelectors
26  {
28 
37  class HERMES_API OrderPermutator
38  {
39  protected:
41  unsigned short order_h;
43  unsigned short order_v;
45  unsigned short start_order_h;
47  unsigned short start_order_v;
49  unsigned short end_order_h;
51  unsigned short end_order_v;
53  bool iso_p;
55  unsigned short* tgt_quad_order;
56 
57  public:
59 
63  OrderPermutator(unsigned short start_quad_order = 0, unsigned short end_quad_order = 0, bool iso_p = false, unsigned short* tgt_quad_order = nullptr);
64 
66 
67  bool next();
68 
70  void reset();
71 
73 
74  unsigned short get_order_h() const;
75 
77 
78  unsigned short get_order_v() const;
79 
81 
82  unsigned short get_quad_order() const;
83 
85 
86  unsigned short get_start_quad_order() const;
87 
89 
90  unsigned short get_end_quad_order() const;
91  };
92  }
93  }
94 }
95 #endif
Definition: adapt.h:24
unsigned short order_h
The current horizontal order.
unsigned short start_order_v
The starting vertical order.
unsigned short order_v
The current verical order.
bool iso_p
True if orders is incresed in both the horizontal order and the vertical order are increased simultan...
unsigned short end_order_v
The ending vertical order.
unsigned short end_order_h
The ending horizontal order.
Hermes::Order permutator. Generates all permutations of orders from a set defined by a range of order...
unsigned short * tgt_quad_order
A pointer to which a current order is stored in encoded form. Ignored if nullptr. ...
unsigned short start_order_h
The starting horizontal order.