Represents an arbitrary function defined on an element. More...
#include <function.h>
Inherits Transformable.
Inherited by MeshFunction, and PrecalcShapeset.
Classes | |
| struct | Node |
Public Member Functions | |
| Function () | |
| Default constructor. | |
| virtual | ~Function () |
| Destructor. | |
| int | get_fn_order () const |
| Returns the polynomial degree of the function being represented by the class. | |
| int | get_num_components () const |
| Returns the number of components of the function being represented by the class. | |
| void | set_quad_order (int order, int mask=H2D_FN_DEFAULT) |
| Activates an integration rule of the specified order. Subsequent calls to get_values(), get_dx_values() etc. will be returning function values at these points. | |
| TYPE * | get_fn_values (int component=0) |
| Returns function values. | |
| TYPE * | get_dx_values (int component=0) |
| Returns the x partial derivative. | |
| TYPE * | get_dy_values (int component=0) |
| Returns the y partial derivative. | |
| void | get_dx_dy_values (TYPE *&dx, TYPE *&dy, int component=0) |
| Returns both x and y partial derivatives. This function provides the both often-used dx and dy values in one call. | |
| TYPE * | get_dxx_values (int component=0) |
| Returns the second x partial derivative. | |
| TYPE * | get_dyy_values (int component=0) |
| Returns the second y partial derivative. | |
| TYPE * | get_dxy_values (int component=0) |
| Returns the second mixed derivative. | |
| TYPE * | get_values (int a, int b) |
| For internal use. | |
| virtual void | set_quad_2d (Quad2D *quad_2d) |
| Selects the quadrature points in which the function will be evaluated. | |
| Quad2D * | get_quad_2d () const |
| Returns the current quadrature points. | |
| virtual void | push_transform (int son) |
| See Transformable::push_transform(). | |
| virtual void | pop_transform () |
| See Transformable::pop_transform(). | |
| virtual void | free ()=0 |
| Frees all precalculated tables. | |
Protected Member Functions | |
| virtual void | precalculate (int order, int mask)=0 |
| precalculates the current function at the current integration points. | |
| void | update_nodes_ptr () |
| void | force_transform (uint64_t sub_idx, Trf *ctm) |
| For internal use only. | |
| Node * | new_node (int mask, int num_points) |
| allocates a new Node structure | |
| void | free_nodes (void **nodes) |
| void | free_sub_tables (void **sub) |
| void | handle_overflow_idx () |
| void | replace_cur_node (Node *node) |
| void | H2D_CHECK_ORDER (Quad2D *quad, int order) |
Protected Attributes | |
| int | order |
| current function polynomial order | |
| int | num_components |
| number of vector components | |
| void ** | sub_tables |
| pointer to the current secondary Judy array | |
| void ** | nodes |
| pointer to the current tertiary Judy array FIXME | |
| void ** | pp_cur_node |
| void * | overflow_nodes |
| Node * | cur_node |
| Quad2D * | quads [4] |
| list of available quadratures | |
| int | cur_quad |
| active quadrature (index into 'quads') | |
| int | total_mem |
| total memory in bytes used by the tables | |
| int | max_mem |
| peak memory usage | |
Static Protected Attributes | |
| static int | idx2mask [6][2] |
| index to mask table | |
Represents an arbitrary function defined on an element.
The Function class is an abstraction of a function defined in integration points on an element. You first specify what quadrature tables you want to use (set_quad_2d()) and select an element (Transformable::set_active_element()). Then you select concrete integration points (set_quad_order()) and obtain the function values by calling one of the functions get_fn_values(), get_dx_values(), etc.
This class is a template for RealFunction and ScalarFunction, depending of which type the function values are. For example, shape functions are always real (see PrecalcShapeset), while the solution can be complex (see Solution).
The design goal for this class is to define a single common interface for functions used as integrands in the weak formulation. It should not matter whether you are integrating a shape function or, for example, a previous solution of the PDE in time-dependent problems. Ideally, you should also be able to apply the bilinear form not only to shape functions during assembling, but also to the solution when calculating energy norms etc. The last feature is unfortunately limited to real code, because a PDE solution can be complex (hence Solution inherits from ScalarFunction), but shape functions are real and for efficiency the bilinear form only takes RealFunction arguments.
Since this class inherits from Transformable, you can obtain function values in integration points transformed to sub-areas of the current element (see push_transform(), pop_transform()).
| void Function< TYPE >::force_transform | ( | uint64_t | sub_idx, | |
| Trf * | ctm | |||
| ) | [inline, protected] |
For internal use only.
Reimplemented in PrecalcShapeset, and MeshFunction.
| virtual void Function< TYPE >::free | ( | ) | [pure virtual] |
Frees all precalculated tables.
Implemented in Filter, PrecalcShapeset, and Solution.
| void Function< TYPE >::free_nodes | ( | void ** | nodes | ) | [inline, protected] |
| void Function< TYPE >::free_sub_tables | ( | void ** | sub | ) | [inline, protected] |
| void Function< TYPE >::get_dx_dy_values | ( | TYPE *& | dx, | |
| TYPE *& | dy, | |||
| int | component = 0 | |||
| ) | [inline] |
Returns both x and y partial derivatives. This function provides the both often-used dx and dy values in one call.
| dx | [out] Variable which receives the pointer to the first partial derivatives by x | |
| dy | [out] Variable which receives the pointer to the first partial derivatives by y | |
| component | [in] The component of the function (0 or 1). |
| TYPE* Function< TYPE >::get_dx_values | ( | int | component = 0 |
) | [inline] |
Returns the x partial derivative.
| component | [in] The component of the function (0 or 1). |
| TYPE* Function< TYPE >::get_dxx_values | ( | int | component = 0 |
) | [inline] |
Returns the second x partial derivative.
| component | [in] The component of the function (0 or 1). |
| TYPE* Function< TYPE >::get_dxy_values | ( | int | component = 0 |
) | [inline] |
Returns the second mixed derivative.
| component | [in] The component of the function (0 or 1). |
| TYPE* Function< TYPE >::get_dy_values | ( | int | component = 0 |
) | [inline] |
Returns the y partial derivative.
| component | [in] The component of the function (0 or 1). |
| TYPE* Function< TYPE >::get_dyy_values | ( | int | component = 0 |
) | [inline] |
Returns the second y partial derivative.
| component | [in] The component of the function (0 or 1). |
| int Function< TYPE >::get_fn_order | ( | ) | const [inline] |
Returns the polynomial degree of the function being represented by the class.
| TYPE* Function< TYPE >::get_fn_values | ( | int | component = 0 |
) | [inline] |
Returns function values.
| component | [in] The component of the function (0 or 1). |
| int Function< TYPE >::get_num_components | ( | ) | const [inline] |
Returns the number of components of the function being represented by the class.
Returns the current quadrature points.
| TYPE* Function< TYPE >::get_values | ( | int | a, | |
| int | b | |||
| ) | [inline] |
For internal use.
| void Function< TYPE >::H2D_CHECK_ORDER | ( | Quad2D * | quad, | |
| int | order | |||
| ) | [inline, protected] |
| void Function< TYPE >::handle_overflow_idx | ( | ) | [inline, protected] |
| Function< TYPE >::Node * Function< TYPE >::new_node | ( | int | mask, | |
| int | num_points | |||
| ) | [inline, protected] |
allocates a new Node structure
| void Function< TYPE >::pop_transform | ( | ) | [inline, virtual] |
| virtual void Function< TYPE >::precalculate | ( | int | order, | |
| int | mask | |||
| ) | [protected, pure virtual] |
precalculates the current function at the current integration points.
Implemented in SimpleFilter, DXDYFilter, VonMisesFilter, LinearFilter, PrecalcShapeset, and Solution.
| void Function< TYPE >::push_transform | ( | int | son | ) | [inline, virtual] |
Selects the quadrature points in which the function will be evaluated.
It is possible to switch back and forth between different quadrature points: no precalculated values are freed. The standard quadrature is always selected by default already.
| quad_2d | [in] The quadrature points. |
Reimplemented in Filter, PrecalcShapeset, and MeshFunction.
| void Function< TYPE >::set_quad_order | ( | int | order, | |
| int | mask = H2D_FN_DEFAULT | |||
| ) | [inline] |
Activates an integration rule of the specified order. Subsequent calls to get_values(), get_dx_values() etc. will be returning function values at these points.
| order | [in] Integration rule order. | |
| mask | [in] A combination of one or more of the constants H2D_FN_VAL, H2D_FN_DX, H2D_FN_DY, H2D_FN_DXX, H2D_FN_DYY, H2D_FN_DXY specifying the values which should be precalculated. The default is H2D_FN_VAL | H2D_FN_DX | H2D_FN_DY. You can also use H2D_FN_ALL to precalculate everything. |
| void Function< TYPE >::update_nodes_ptr | ( | ) | [inline, protected] |
active quadrature (index into 'quads')
{
{ H2D_FN_VAL_0, H2D_FN_VAL_1 }, { H2D_FN_DX_0, H2D_FN_DX_1 }, { H2D_FN_DY_0, H2D_FN_DY_1 },
{ H2D_FN_DXX_0, H2D_FN_DXX_1 }, { H2D_FN_DYY_0, H2D_FN_DYY_1 }, { H2D_FN_DXY_0, H2D_FN_DXY_1 }
}
index to mask table
pointer to the current tertiary Judy array FIXME
int Function< TYPE >::num_components [protected] |
number of vector components
void* Function< TYPE >::overflow_nodes [protected] |
void** Function< TYPE >::pp_cur_node [protected] |
list of available quadratures
void** Function< TYPE >::sub_tables [protected] |
pointer to the current secondary Judy array
total memory in bytes used by the tables
1.6.3