Hermes2D  2.0
precalc.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_PRECALC_H
17 #define __H2D_PRECALC_H
18 
19 #include "../function/function.h"
20 #include "../shapeset/shapeset.h"
21 
22 namespace Hermes
23 {
24  namespace Hermes2D
25  {
26  enum SpaceType;
33  class HERMES_API PrecalcShapeset : public Function<double>
34  {
35  public:
37  SpaceType get_space_type() const;
38 
41  PrecalcShapeset(Shapeset* shapeset);
42 
50  PrecalcShapeset(PrecalcShapeset* master_pss);
51 
53  virtual ~PrecalcShapeset();
54 
57  virtual void set_active_element(Element* e);
58 
63  void set_active_shape(int index);
64 
65  private:
66  virtual void set_quad_2d(Quad2D* quad_2d);
67 
69  virtual void free();
70 
73  virtual void handle_overflow_idx();
74 
75 
77  int get_active_shape() const;
78 
80  Shapeset* get_shapeset() const;
81 
83  void set_master_transform();
84 
86  virtual int get_edge_fn_order(int edge);
87 
89  virtual void push_transform(int son);
90 
91  virtual void pop_transform();
92 
93  Shapeset* shapeset;
94 
104  LightArray<std::map<uint64_t, LightArray<Node*>*>*> tables;
105 
106  int index;
107 
108  int max_index[H2D_NUM_MODES];
109 
110  PrecalcShapeset* master_pss;
111 
113  bool is_slave() const;
114 
115  virtual void precalculate(int order, int mask);
116 
117  void update_max_index();
118 
121  void force_transform(uint64_t sub_idx, Trf* ctm);
122 
123  friend class RefMap;
124  template<typename T> friend class KellyTypeAdapt;
125  template<typename T> friend class Adapt;
126  template<typename T> friend class Func;
127  template<typename T> friend class Solution;
128  template<typename T> friend class DiscontinuousFunc;
129  template<typename T> friend class DiscreteProblem;
130  template<typename T> friend class NeighborSearch;
131  friend class CurvMap;
132  };
133  }
134 }
135 #endif