16 #ifndef __H2D_REFMAP_H
17 #define __H2D_REFMAP_H
19 #include "../global.h"
20 #include "../shapeset/precalc.h"
21 #include "../quadrature/quad_all.h"
22 #include "shapeset/shapeset_h1_all.h"
54 void set_quad_2d(
Quad2D* quad_2d);
57 Quad2D* get_quad_2d()
const;
60 const Quad1D* get_quad_1d()
const;
64 virtual void set_active_element(
Element* e);
71 double3* get_tangent(
int edge,
int order = -1);
75 static void untransform(
Element* e,
double x,
double y,
double& xi1,
double& xi2);
82 static Element* element_on_physical_coordinates(
const Mesh* mesh,
double x,
double y,
double* x_reference = NULL,
double* y_reference = NULL);
87 double* get_phys_x(
int order);
92 double* get_phys_y(
int order);
96 bool is_jacobian_const()
const;
100 double get_const_jacobian()
const;
104 double* get_jacobian(
int order);
107 int get_inv_ref_order()
const;
112 double2x2* get_inv_ref_map(
int order);
116 double2x2* get_const_inv_ref_map();
122 double3x2* get_second_ref_map(
int order);
125 void inv_ref_map_at_point(
double xi1,
double xi2,
double& x,
double& y, double2x2& m);
128 void second_ref_map_at_point(
double xi1,
double xi2,
double& x,
double& y, double3x2& mm);
131 virtual void push_transform(
int son);
134 virtual void pop_transform();
140 void force_transform(uint64_t sub_idx,
Trf* ctm)
142 this->sub_idx = sub_idx;
144 this->ctm = stack + top;
146 if(is_const) calc_const_inv_ref_map();
157 double const_jacobian;
159 double2x2 const_inv_ref_map;
161 static const int H2D_MAX_TABLES = g_max_quad + 1 + 4 * g_max_quad + 4;
167 double* jacobian[H2D_MAX_TABLES];
168 double2x2* inv_ref_map[H2D_MAX_TABLES];
169 double3x2* second_ref_map[H2D_MAX_TABLES];
170 double* phys_x[H2D_MAX_TABLES];
171 double* phys_y[H2D_MAX_TABLES];
176 std::map<uint64_t, Node*> nodes;
182 void update_cur_node()
184 Node* updated_node =
new Node;
186 if(sub_idx > H2D_MAX_IDX) {
188 cur_node = handle_overflow();
191 if(nodes.insert(std::make_pair(sub_idx, updated_node)).second ==
false)
196 init_node(updated_node);
197 cur_node = nodes[sub_idx];
201 void calc_inv_ref_map(
int order);
205 void calc_const_inv_ref_map();
207 void calc_second_ref_map(
int order);
209 static bool is_parallelogram(
Element* e);
211 void calc_phys_x(
int order);
213 void calc_phys_y(
int order);
215 void calc_tangent(
int edge,
int eo);
219 int calc_inv_ref_order();
221 void init_node(Node* pp);
223 void free_node(Node* node);
225 Node* handle_overflow();
239 template<
typename T>
friend class Solution;
243 template<
typename T>
friend class Adapt;
248 template<
typename T>
friend class Global;
250 template<
typename T>
friend class Func;
251 template<
typename T>
friend class Geom;