Reference documentation for deal.II version Git 35565f205e 2019-09-24 08:33:37 +0200
\(\newcommand{\dealcoloneq}{\mathrel{\vcenter{:}}=}\)
Public Member Functions | Static Public Member Functions | List of all members
internal::EvaluatorTensorProduct< evaluate_symmetric_hierarchical, dim, n_rows, n_columns, Number, Number2 > Struct Template Reference

#include <deal.II/matrix_free/tensor_product_kernels.h>

Public Member Functions

 EvaluatorTensorProduct ()
 
 EvaluatorTensorProduct (const AlignedVector< Number > &shape_values)
 
 EvaluatorTensorProduct (const AlignedVector< Number2 > &shape_values, const AlignedVector< Number2 > &shape_gradients, const AlignedVector< Number2 > &shape_hessians, const unsigned int dummy1=0, const unsigned int dummy2=0)
 

Static Public Member Functions

template<int direction, bool contract_over_rows, bool add, int type, bool one_line = false>
static void apply (const Number2 *DEAL_II_RESTRICT shape_data, const Number *in, Number *out)
 

Detailed Description

template<int dim, int n_rows, int n_columns, typename Number, typename Number2>
struct internal::EvaluatorTensorProduct< evaluate_symmetric_hierarchical, dim, n_rows, n_columns, Number, Number2 >

Internal evaluator for 1d-3d shape function using the tensor product form of the basis functions.

This class implements an approach similar to the even-odd decomposition but with a different type of symmetry. In this case, we assume that a single shape function already shows the symmetry over the quadrature points, rather than the complete basis that is considered in the even-odd case. In particular, we assume that the shape functions are ordered as in the Legendre basis, with symmetric shape functions in the even slots (rows of the values array) and point-symmetric in the odd slots. Like the even-odd decomposition, the number of operations are N^2/2 rather than N^2 FMAs (fused multiply-add), where N is the number of 1D dofs. The difference is in the way the input and output quantities are symmetrized.

Template Parameters
dimSpace dimension in which this class is applied
n_rowsNumber of rows in the transformation matrix, which corresponds to the number of 1d shape functions in the usual tensor contraction setting
n_columnsNumber of columns in the transformation matrix, which corresponds to the number of 1d shape functions in the usual tensor contraction setting
NumberAbstract number type for input and output arrays
Number2Abstract 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 1844 of file tensor_product_kernels.h.

Constructor & Destructor Documentation

◆ EvaluatorTensorProduct() [1/3]

template<int dim, int n_rows, int n_columns, typename Number , typename Number2 >
internal::EvaluatorTensorProduct< evaluate_symmetric_hierarchical, dim, n_rows, n_columns, Number, Number2 >::EvaluatorTensorProduct ( )
inline

Empty constructor. Does nothing. Be careful when using 'values' and related methods because they need to be filled with the other constructor passing in at least an array for the values.

Definition at line 1861 of file tensor_product_kernels.h.

◆ EvaluatorTensorProduct() [2/3]

template<int dim, int n_rows, int n_columns, typename Number , typename Number2 >
internal::EvaluatorTensorProduct< evaluate_symmetric_hierarchical, dim, n_rows, n_columns, Number, Number2 >::EvaluatorTensorProduct ( const AlignedVector< Number > &  shape_values)
inline

Constructor, taking the data from ShapeInfo (using the even-odd variants stored there)

Definition at line 1871 of file tensor_product_kernels.h.

◆ EvaluatorTensorProduct() [3/3]

template<int dim, int n_rows, int n_columns, typename Number , typename Number2 >
internal::EvaluatorTensorProduct< evaluate_symmetric_hierarchical, dim, n_rows, n_columns, Number, Number2 >::EvaluatorTensorProduct ( const AlignedVector< Number2 > &  shape_values,
const AlignedVector< Number2 > &  shape_gradients,
const AlignedVector< Number2 > &  shape_hessians,
const unsigned int  dummy1 = 0,
const unsigned int  dummy2 = 0 
)
inline

Constructor, taking the data from ShapeInfo (using the even-odd variants stored there)

Definition at line 1881 of file tensor_product_kernels.h.

Member Function Documentation

◆ apply()

template<int dim, int n_rows, int n_columns, typename Number , typename Number2 >
template<int direction, bool contract_over_rows, bool add, int type, bool one_line>
void internal::EvaluatorTensorProduct< evaluate_symmetric_hierarchical, dim, n_rows, n_columns, Number, Number2 >::apply ( const Number2 *DEAL_II_RESTRICT  shape_data,
const Number *  in,
Number *  out 
)
inlinestatic

This function applies the tensor product kernel, corresponding to a 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 only correct if one_line is set to true.

Template Parameters
directionDirection that is evaluated
contract_over_rowsIf true, the tensor contraction sums over the rows in the given shape_data array, otherwise it sums over the columns
addIf true, the result is added to the output vector, else the computed values overwrite the content in the output
typeDetermines whether the evaluation is symmetric in even rows (type=0) or odd rows (type=1) of shape_data and skew-symmetric in odd rows (type=0) or even rows (type=1)
one_lineIf 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.
Parameters
shape_dataTransformation matrix with n_rows rows and n_columns columns, stored in row-major format
inPointer to the start of the input data vector
outPointer to the start of the output data vector

Definition at line 2006 of file tensor_product_kernels.h.


The documentation for this struct was generated from the following file: