deal.II version GIT relicensing-2287-g6548a49e0a 2024-12-20 18:30:00+00:00
|
#include <deal.II/matrix_free/tensor_product_kernels.h>
Public Member Functions | |
EvaluatorTensorProduct () | |
EvaluatorTensorProduct (const AlignedVector< Number2 > &shape_values, const AlignedVector< Number2 > &shape_gradients, const AlignedVector< Number2 > &shape_hessians, const unsigned int=0, const unsigned int=0) | |
EvaluatorTensorProduct (const Number2 *shape_values, const Number2 *shape_gradients, const Number2 *shape_hessians, const unsigned int dummy1=0, const unsigned int dummy2=0) | |
template<int direction, bool contract_over_rows, bool add, int stride = 1> | |
void | values (const Number in[], Number out[]) const |
template<int direction, bool contract_over_rows, bool add, int stride = 1> | |
void | gradients (const Number in[], Number out[]) const |
template<int direction, bool contract_over_rows, bool add> | |
void | hessians (const Number in[], Number out[]) const |
template<int direction, bool contract_over_rows, bool add> | |
void | values_one_line (const Number in[], Number out[]) const |
template<int direction, bool contract_over_rows, bool add> | |
void | gradients_one_line (const Number in[], Number out[]) const |
template<int direction, bool contract_over_rows, bool add> | |
void | hessians_one_line (const Number in[], Number out[]) const |
Static Public Member Functions | |
template<int direction, bool contract_over_rows, bool add, bool one_line = false, EvaluatorQuantity quantity = EvaluatorQuantity::value, int stride = 1> | |
static void | apply (const Number2 *DEAL_II_RESTRICT shape_data, const Number *in, Number *out) |
Static Public Attributes | |
static constexpr unsigned int | n_rows_of_product |
static constexpr unsigned int | n_columns_of_product |
Private Attributes | |
const Number2 * | shape_values |
const Number2 * | shape_gradients |
const Number2 * | shape_hessians |
Generic evaluator framework that valuates the given shape data in general dimensions using the tensor product form. Depending on the particular layout in the matrix entries, this corresponds to a usual matrix-matrix product or a matrix-matrix product including some symmetries. The actual work is implemented by functions of type apply_matrix_vector_product working on a single dimension, controlled by suitable strides, using the kernel specified via variant.
dim | Space dimension in which this class is applied |
n_rows | Number of rows in the transformation matrix, which corresponds to the number of 1d shape functions in the usual tensor contraction setting |
n_columns | Number of columns in the transformation matrix, which corresponds to the number of 1d shape functions in the usual tensor contraction setting |
Number | Abstract number type for input and output arrays |
Number2 | Abstract number type for coefficient arrays (defaults to same type as the input/output arrays); must implement operator* with Number and produce Number as an output to be a valid type |
Definition at line 1573 of file tensor_product_kernels.h.
|
inline |
Empty constructor. Does nothing. Be careful when using 'values' and related methods because they need to be filled with the other pointer
Definition at line 1584 of file tensor_product_kernels.h.
|
inline |
Constructor, taking the data from ShapeInfo
Definition at line 1593 of file tensor_product_kernels.h.
|
inline |
Constructor, taking the data from ShapeInfo via raw pointers
Definition at line 1633 of file tensor_product_kernels.h.
|
inline |
This interpolates values with sum factorization, according to the following parameters:
direction | The direction along which the one-dimensional operations should be performed, using 0 as the fastest running direction x, 1 for y, and so on. |
contract_over_rows | Describes whether the interpolation is over the rows or the columns in the underlying interpolation matrix. With the chosen convention in the data fields, contract_over_rows==true means interpolation from DoF values to quadrature points, whereas using the argument false will perform summation over quadrature points to produce integrals for each test function. |
add | Specify whether to add into the output array or overwrite the previous content. |
stride | This parameter can specify an additional stride in the array associated with quadrature points (in for dof_to_quad==false , otherwise out ) from consecutive points in the x-direction. This is used to place results from different interpolation steps next to each other in memory. |
in | Input array for the operation, needs to be backed up by a sufficiently large memory region. |
out | Array holding the result of the sum factorization operation. |
Definition at line 1673 of file tensor_product_kernels.h.
|
inline |
This interpolates gradients with sum factorization, based on the second argument given to the constructor of this class. For the documentation of the template and function parameters, see the values function.
Definition at line 1687 of file tensor_product_kernels.h.
|
inline |
This interpolates hessians with sum factorization, based on the third argument given to the constructor of this class. For the documentation of the template and function parameters, see the values function.
Definition at line 1703 of file tensor_product_kernels.h.
|
inline |
A variant of interpolation with sum factorization that only applies the operation to a single 1d line, leaving all other entries untouched, rather than expanding the loop over all other directions of a tensor product mesh. For the documentation of the template and function parameters, see the other values function.
Definition at line 1723 of file tensor_product_kernels.h.
|
inline |
A variant of interpolation with sum factorization that only applies the gradient operation to a single 1d line, leaving all other entries untouched, rather than expanding the loop over all other directions of a tensor product mesh. For the documentation of the template and function parameters, see the values function.
Definition at line 1739 of file tensor_product_kernels.h.
|
inline |
A variant of interpolation with sum factorization that only applies the Hessian operation to a single 1d line, leaving all other entries untouched, rather than expanding the loop over all other directions of a tensor product mesh. For the documentation of the template and function parameters, see the values function.
Definition at line 1758 of file tensor_product_kernels.h.
|
inlinestatic |
This function applies the tensor product kernel with sum factorization, corresponding to a matrix-vector multiplication of 1d stripes, along the given direction
of the tensor data in the input array. This function allows the in
and out
arrays to alias for the case n_rows == n_columns, i.e., it is safe to perform the contraction in place where in
and out
point to the same address. For the case n_rows != n_columns
, the output is in general not correct.
direction | Direction that is evaluated |
contract_over_rows | If true, the tensor contraction sums over the rows in the given shape_data array, otherwise it sums over the columns |
add | If true, the result is added to the output vector, else the computed values overwrite the content in the output |
one_line | If true, the kernel is only applied along a single 1d stripe within a dim-dimensional tensor, not the full n_rows^dim points as in the false case. |
quantity | Specify whether values, gradients or Hessians should be interpolated, allowing specialized algorithms for some class template parameters of variant to find the right path. |
stride | This parameter enables to place the result of the tensor product evaluation in the output array (if contract_over_rows == true ) or input array (if contract_over_rows == false ) with additional strides between adjacent points in x direction, which is used to group all components of a gradient adjacent in memory. If the stride is one, the data will form a contiguous range in memory. |
shape_data | Transformation matrix with n_rows rows and n_columns columns, stored in row-major format. |
in | Pointer to the start of the input data vector. |
out | Pointer to the start of the output data vector. |
Definition at line 1838 of file tensor_product_kernels.h.
|
staticconstexpr |
Definition at line 1575 of file tensor_product_kernels.h.
|
staticconstexpr |
Definition at line 1577 of file tensor_product_kernels.h.
|
private |
Definition at line 1818 of file tensor_product_kernels.h.
|
private |
Definition at line 1819 of file tensor_product_kernels.h.
|
private |
Definition at line 1820 of file tensor_product_kernels.h.