22 #include "quadrature/quad.h"
23 #include "function/function.h"
24 #include "function/exact_solution.h"
25 #include "mesh/refmap.h"
26 #include "mesh/traverse.h"
32 static const char* ERR_UNDEFINED_NEIGHBORING_ELEMENTS =
33 "Neighboring elements are not defined and so are not function traces on their interface. "
34 "Did you forget setting H2D_ANY_INNER_EDGE in add_matrix/vector_form?";
36 #pragma region Geometry
44 T x[H2D_MAX_INTEGRATION_POINTS_COUNT];
46 T y[H2D_MAX_INTEGRATION_POINTS_COUNT];
61 T get_diam_approximation(
unsigned char n);
63 T get_area(
unsigned char n,
double* wt);
71 T nx[H2D_MAX_INTEGRATION_POINTS_COUNT];
72 T ny[H2D_MAX_INTEGRATION_POINTS_COUNT];
73 T tx[H2D_MAX_INTEGRATION_POINTS_COUNT];
74 T ty[H2D_MAX_INTEGRATION_POINTS_COUNT];
95 x[0] = y[0] = Hermes::Ord(1);
106 Hermes::Ord
get_area(
unsigned char n,
double* wt) {
return Hermes::Ord(1); };
116 x[0] = y[0] = tx[0] = ty[0] = nx[0] = ny[0] = Hermes::Ord(1);
162 T get_diam_approximation(
unsigned char n);
164 T get_area(
unsigned char n,
double* wt);
179 x[0] = y[0] = tx[0] = ty[0] = nx[0] = ny[0] = Hermes::Ord(1);
191 Hermes::Ord
get_area(
unsigned char n,
double* wt) {
return Hermes::Ord(1); };
195 HERMES_API GeomVol<double>*
init_geom_vol(RefMap *rm,
const int order);
199 HERMES_API GeomSurf<double>*
init_geom_surf(RefMap *rm,
unsigned char isurf,
int marker,
const int order, double3*& tan);
201 HERMES_API
void init_geom_surf_allocated(GeomSurf<double>& geom, RefMap *rm,
unsigned char isurf,
int marker,
const int order, double3*& tan);
205 template<
typename Scalar>
214 class HERMES_API
Func < double >
222 Func(
int np,
int nc);
225 double val[H2D_MAX_INTEGRATION_POINTS_COUNT];
226 double val0[H2D_MAX_INTEGRATION_POINTS_COUNT];
231 double dx[H2D_MAX_INTEGRATION_POINTS_COUNT];
232 double val1[H2D_MAX_INTEGRATION_POINTS_COUNT];
237 double dy[H2D_MAX_INTEGRATION_POINTS_COUNT];
238 double curl[H2D_MAX_INTEGRATION_POINTS_COUNT];
243 double laplace[H2D_MAX_INTEGRATION_POINTS_COUNT];
244 double div[H2D_MAX_INTEGRATION_POINTS_COUNT];
255 void subtract(
double* attribute,
double* other_attribute);
260 void add(
double* attribute,
double* other_attribute);
265 class HERMES_API
Func <
std::complex<double> >
273 Func(
int np,
int nc);
275 std::complex<double> val[H2D_MAX_INTEGRATION_POINTS_COUNT];
276 std::complex<double> val0[H2D_MAX_INTEGRATION_POINTS_COUNT];
278 std::complex<double> dx[H2D_MAX_INTEGRATION_POINTS_COUNT];
279 std::complex<double> val1[H2D_MAX_INTEGRATION_POINTS_COUNT];
281 std::complex<double> dy[H2D_MAX_INTEGRATION_POINTS_COUNT];
282 std::complex<double> curl[H2D_MAX_INTEGRATION_POINTS_COUNT];
284 std::complex<double> laplace[H2D_MAX_INTEGRATION_POINTS_COUNT];
285 std::complex<double> div[H2D_MAX_INTEGRATION_POINTS_COUNT];
293 void subtract(
Func<std::complex<double> >* func);
295 void subtract(std::complex<double> * attribute, std::complex<double> * other_attribute);
298 void add(
Func<std::complex<double> >* func);
300 void add(std::complex<double> * attribute, std::complex<double> * other_attribute);
307 Func(
const int order);
393 Ord dx_neighbor, dy_neighbor;
424 template<
typename Scalar>
428 template<
typename Scalar>
434 template<
typename Scalar>
437 template<
typename Scalar>
442 template<
typename Scalar>
446 template<
typename Scalar>
T * dx
First-order partial derivatives.
Function operating on previous nonlinear solutions in assembling (u_ext)
T * dx_neighbor
First-order partial derivatives.
HERMES_API void init_geom_surf_allocated(GeomSurf< double > &geom, RefMap *rm, unsigned char isurf, int marker, const int order, double3 *&tan)
Init element geometry for surface integrals.
Hermes::Ord get_diam_approximation(unsigned char n)
Element diameter approximation.
Stores one element of a mesh.
bool reverse_neighbor_side
True if values from the neighbor have to be retrieved in reverse order.
Caches precalculated shape function values.
int id
ID number of the element.
This class represents a function with jump discontinuity on an interface of two elements.
int elem_marker
Element marker (for both volumetric and surface forms).
Geometry (coordinates, normals, tangents) of either an element or an edge.
int elem_marker
Element marker (for both volumetric and surface forms).
int nc
Number of components. Currently accepted values are 1 (H1, L2 space) and 2 (Hcurl, Hdiv space).
Represents a function defined on a mesh.
T * val_neighbor
Function values. If T == Hermes::Ord and orders vary with direction, this returns max(h_order...
HERMES_API void init_geom_vol_allocated(GeomVol< double > &geom, RefMap *rm, const int order)
Init element geometry for volumetric integrals.
Hermes::Ord get_area(unsigned char n, double *wt)
Element area.
Common definitions for Hermes2D.
Func< T > * fn_neighbor
Neighbor element's component.
Func< T > * fn_central
Central element's component.
HERMES_API Func< double > * init_fn(PrecalcShapeset *fu, RefMap *rm, const int order)
Init the shape function for the evaluation of the volumetric/surface integral (transformation of valu...
unsigned char isurf
Internal number of an edge of the element.
T * val
Function values. If T == Hermes::Ord and orders vary with direction, this returns max(h_order...
int edge_marker
Edge marker.
HERMES_API Func< Scalar > * preallocate_fn(pj_pool_t *memoryPool=nullptr)
Preallocate the Func (all we need is np & nc).
unsigned char isurf
Internal number of an edge of the element.
int np
Number of integration points used by this intance.
HERMES_API GeomSurf< double > * init_geom_surf(RefMap *rm, unsigned char isurf, int marker, const int order, double3 *&tan)
Init element geometry for surface integrals.
HERMES_API void init_fn_preallocated(Func< double > *u, PrecalcShapeset *fu, RefMap *rm, const int order)
Init the shape function for the evaluation of the volumetric/surface integral (transformation of valu...
int np
Number of integration points used by this intance.
int elem_marker
Element marker (for both volumetric and surface forms).
int edge_marker
Edge marker.
InterfaceGeom()
Constructor.
HERMES_API GeomVol< double > * init_geom_vol(RefMap *rm, const int order)
Init element geometry for volumetric integrals.
Calculated function values (from the class Function) on an element for assembling.
Hermes::Ord get_area(unsigned char n, double *wt)
Element area.
Func< Ord > * fn_central
Central element's component.
Represents the reference mapping.
unsigned char np
For InterfaceGeom purposes.
bool reverse_neighbor_side
True if values from the neighbor have to be retrieved in reverse order.
Hermes::Ord get_diam_approximation(unsigned char n)
Element diameter approximation.
int nc
Number of components. Currently accepted values are 1 (H1, L2 space) and 2 (Hcurl, Hdiv space).
HERMES_API Func< Scalar > * init_zero_fn(ElementMode2D mode, int order, Quad2D *quad_2d=nullptr, int nc=1)
Func< Ord > * fn_neighbor
Neighbor element's component.