16 #ifndef __H2D_REFMAP_H
17 #define __H2D_REFMAP_H
19 #include "../global.h"
20 #include "../shapeset/precalc.h"
21 #include "../mesh/mesh.h"
22 #include "../quadrature/quad_all.h"
23 #include "shapeset/shapeset_h1_all.h"
49 void set_quad_2d(
Quad2D* quad_2d);
52 Quad2D* get_quad_2d()
const;
56 virtual void set_active_element(
Element* e);
63 double3* get_tangent(
int edge,
int order = -1);
67 static void untransform(
Element* e,
double x,
double y,
double& xi1,
double& xi2);
74 static Element* element_on_physical_coordinates(
bool use_MeshHashGrid, MeshSharedPtr mesh,
double x,
double y,
double* x_reference =
nullptr,
double* y_reference =
nullptr);
81 static bool is_element_on_physical_coordinates(
Element* e,
double x,
double y,
double* x_reference =
nullptr,
double* y_reference =
nullptr);
86 double* get_phys_x(
int order);
91 double* get_phys_y(
int order);
103 return inv_ref_order;
110 return const_jacobian;
117 return &const_inv_ref_map;
125 throw Hermes::Exceptions::Exception(
"RefMap::get_jacobian() called with a const jacobian.");
126 if (order != this->jacobian_calculated)
127 this->calc_inv_ref_map(order);
128 return this->jacobian;
137 throw Hermes::Exceptions::Exception(
"RefMap::get_inv_ref_map() called with a const jacobian.");
138 if (order != this->inv_ref_map_calculated)
139 this->calc_inv_ref_map(order);
140 return this->inv_ref_map;
144 void inv_ref_map_at_point(
double xi1,
double xi2,
double& x,
double& y, double2x2& m);
146 #ifdef H2D_USE_SECOND_DERIVATIVES
147 double3x2* get_second_ref_map(
int order);
151 void second_ref_map_at_point(
double xi1,
double xi2,
double& x,
double& y, double3x2& mm);
155 virtual void push_transform(
int son);
158 virtual void pop_transform();
161 void force_transform(uint64_t sub_idx,
Trf* ctm);
163 static void set_element_iro_cache(
Element* element);
167 void reinit_storage();
176 double const_jacobian;
177 double2x2 const_inv_ref_map;
178 double3x2 const_second_ref_map;
179 double const_direct_ref_map[2][2];
182 double jacobian[H2D_MAX_INTEGRATION_POINTS_COUNT];
183 int jacobian_calculated;
184 double2x2 inv_ref_map[H2D_MAX_INTEGRATION_POINTS_COUNT];
185 int inv_ref_map_calculated;
186 double3x2 second_ref_map[H2D_MAX_INTEGRATION_POINTS_COUNT];
187 int second_ref_map_calculated;
188 double direct_ref_map[2][2][H2D_MAX_INTEGRATION_POINTS_COUNT];
189 int direct_ref_map_calculated;
193 double phys_x[H2D_MAX_INTEGRATION_POINTS_COUNT];
194 int phys_x_calculated;
195 double phys_y[H2D_MAX_INTEGRATION_POINTS_COUNT];
196 int phys_y_calculated;
202 void calc_inv_ref_map(
int order);
206 void calc_const_inv_ref_map();
208 #ifdef H2D_USE_SECOND_DERIVATIVES
209 void calc_second_ref_map(
int order);
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 unsigned short indices[70];
PrecalcShapeset variant for fast assembling.
Stores one element of a mesh.
Shape functions based on integrated Jacobi polynomials.
bool is_jacobian_const() const
double get_const_jacobian() const
#define H2D_MAX_NUMBER_EDGES
A maximum number of edges of an element.
int get_inv_ref_order() const
Returns the increase in the integration order due to the reference map.
double * get_jacobian(int order)
Represents the reference mapping.
double2x2 * get_inv_ref_map(int order)
double2x2 * get_const_inv_ref_map()