From: Jean-Paul Pelteret Date: Wed, 11 Aug 2021 18:35:38 +0000 (+0200) Subject: Categorise functions in FEInterfaceValuesViews X-Git-Tag: v9.4.0-rc1~1083^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=587ac18490879c503af960e1d2001323f7c9ee28;p=dealii.git Categorise functions in FEInterfaceValuesViews --- diff --git a/include/deal.II/fe/fe_interface_values.h b/include/deal.II/fe/fe_interface_values.h index d5b228d2d0..c2e95aa5bc 100644 --- a/include/deal.II/fe/fe_interface_values.h +++ b/include/deal.II/fe/fe_interface_values.h @@ -146,6 +146,11 @@ namespace FEInterfaceViews Scalar(const FEInterfaceValues &fe_interface, const unsigned int component); + /** + * @name Functions to evaluate quantities + */ + //@{ + /** * Return the value of the shape function * with interface dof index @p interface_dof_index in @@ -171,74 +176,88 @@ namespace FEInterfaceViews const unsigned int q_point) const; /** - * Return the jump $\jump{u}=u_1 - u_2$ on the interface for the shape - * function - * @p interface_dof_index in the quadrature point @p q_point - * of the component selected by this view. - */ - value_type - jump_in_values(const unsigned int interface_dof_index, - const unsigned int q_point) const; - - /** - * The same as above. + * Return the values of the selected scalar component of the finite + * element function characterized by fe_function at the + * quadrature points of the cell interface selected the last time + * the reinit function of the FEInterfaceValues object was called. * - * @deprecated Use the jump_in_values() function instead. - */ - DEAL_II_DEPRECATED - value_type - jump(const unsigned int interface_dof_index, - const unsigned int q_point) const; - - /** - * Return the average value $\average{u}=\frac{1}{2}(u_1 + u_2)$ on the - * interface for the shape - * function @p interface_dof_index in the quadrature point @p q_point - * of the component selected by this view. + * The argument @p here_or_there selects between the value on cell 0 (here, @p true) + * and cell 1 (there, @p false). You can also interpret it as "upstream" (@p true) + * and "downstream" (@p false) as defined by the direction of the normal + * vector in this quadrature point. If @p here_or_there is true, the values + * from the first cell of the interface is used. + * + * The data type stored by the output vector must be what you get when you + * multiply the values of shape functions (i.e., @p value_type) times the + * type used to store the values of the unknowns $U_j$ of your finite + * element vector $U$ (represented by the @p fe_function argument). + * + * @dealiiRequiresUpdateFlags{update_values} */ - value_type - average_of_values(const unsigned int interface_dof_index, - const unsigned int q_point) const; + template + void + get_function_values( + const bool here_or_there, + const InputVector &fe_function, + std::vector> + &values) const; /** - * The same as above. + * Same as above, but using a vector of local degree-of-freedom values. In + * other words, instead of extracting the nodal values of the degrees of + * freedom located on the current cell interface from a global vector + * associated with a DoFHandler object (as the function above does), this + * function instead takes these local nodal values through its first + * argument. * - * @deprecated Use the average_of_values() function instead. + * @param[in] here_or_there Same as the one in the above function. + * + * @param[in] local_dof_values A vector of local nodal values. This vector + * must have a length equal to number of DoFs on the current cell, and + * must be ordered in the same order as degrees of freedom are numbered on + * the reference cell. + * + * @param[out] values A vector of values of the given finite element field, + * at the quadrature points on the current object. + * + * @tparam InputVector The @p InputVector type must allow creation + * of an ArrayView object from it; this is satisfied by the + * `std::vector` class, among others. */ - DEAL_II_DEPRECATED - value_type - average_value(const unsigned int interface_dof_index, - const unsigned int q_point) const; + template + void + get_function_values_from_local_dof_values( + const bool here_or_there, + const InputVector &local_dof_values, + std::vector> + &values) const; + + //@} /** - * The same as above. - * - * @deprecated Use the average_of_values() function instead. + * @name Functions to evaluate jumps in quantities */ - DEAL_II_DEPRECATED - value_type - average(const unsigned int interface_dof_index, - const unsigned int q_point) const; + //@{ /** - * Return the average of the gradient $\average{\nabla u}$ on the interface - * for the shape - * function @p interface_dof_index in the quadrature point @p q_point + * Return the jump $\jump{u}=u_1 - u_2$ on the interface for the shape + * function + * @p interface_dof_index in the quadrature point @p q_point * of the component selected by this view. */ - gradient_type - average_of_gradients(const unsigned int interface_dof_index, - const unsigned int q_point) const; + value_type + jump_in_values(const unsigned int interface_dof_index, + const unsigned int q_point) const; /** * The same as above. * - * @deprecated Use the average_of_gradients() function instead. + * @deprecated Use the jump_in_values() function instead. */ DEAL_II_DEPRECATED - gradient_type - average_gradient(const unsigned int interface_dof_index, - const unsigned int q_point) const; + value_type + jump(const unsigned int interface_dof_index, + const unsigned int q_point) const; /** * Return the jump of the gradient $\jump{nabla u}$ on the interface for @@ -260,27 +279,6 @@ namespace FEInterfaceViews jump_gradient(const unsigned int interface_dof_index, const unsigned int q_point) const; - /** - * Return the average of the Hessian $\average{\nabla^2 u} = - * \frac{1}{2}\nabla^2 u_{\text{cell0}} + \frac{1}{2} \nabla^2 - * u_{\text{cell1}}$ on the interface - * for the shape function @p interface_dof_index at the quadrature point @p - * q_point of the component selected by this view. - */ - hessian_type - average_of_hessians(const unsigned int interface_dof_index, - const unsigned int q_point) const; - - /** - * The same as above. - * - * @deprecated Use the average_of_hessians() function instead. - */ - DEAL_II_DEPRECATED - hessian_type - average_hessian(const unsigned int interface_dof_index, - const unsigned int q_point) const; - /** * Return the jump in the gradient $\jump{\nabla u}=\nabla u_{\text{cell0}} * - \nabla u_{\text{cell1}}$ on the interface for the shape function @p @@ -321,63 +319,6 @@ namespace FEInterfaceViews jump_3rd_derivative(const unsigned int interface_dof_index, const unsigned int q_point) const; - /** - * Return the values of the selected scalar component of the finite - * element function characterized by fe_function at the - * quadrature points of the cell interface selected the last time - * the reinit function of the FEInterfaceValues object was called. - * - * The argument @p here_or_there selects between the value on cell 0 (here, @p true) - * and cell 1 (there, @p false). You can also interpret it as "upstream" (@p true) - * and "downstream" (@p false) as defined by the direction of the normal - * vector in this quadrature point. If @p here_or_there is true, the values - * from the first cell of the interface is used. - * - * The data type stored by the output vector must be what you get when you - * multiply the values of shape functions (i.e., @p value_type) times the - * type used to store the values of the unknowns $U_j$ of your finite - * element vector $U$ (represented by the @p fe_function argument). - * - * @dealiiRequiresUpdateFlags{update_values} - */ - template - void - get_function_values( - const bool here_or_there, - const InputVector &fe_function, - std::vector> - &values) const; - - /** - * Same as above, but using a vector of local degree-of-freedom values. In - * other words, instead of extracting the nodal values of the degrees of - * freedom located on the current cell interface from a global vector - * associated with a DoFHandler object (as the function above does), this - * function instead takes these local nodal values through its first - * argument. - * - * @param[in] here_or_there Same as the one in the above function. - * - * @param[in] local_dof_values A vector of local nodal values. This vector - * must have a length equal to number of DoFs on the current cell, and - * must be ordered in the same order as degrees of freedom are numbered on - * the reference cell. - * - * @param[out] values A vector of values of the given finite element field, - * at the quadrature points on the current object. - * - * @tparam InputVector The @p InputVector type must allow creation - * of an ArrayView object from it; this is satisfied by the - * `std::vector` class, among others. - */ - template - void - get_function_values_from_local_dof_values( - const bool here_or_there, - const InputVector &local_dof_values, - std::vector> - &values) const; - /** * Return the jump in the values of the selected scalar component of the * finite element function characterized by fe_function at the @@ -412,40 +353,6 @@ namespace FEInterfaceViews std::vector> &values) const; - /** - * Return the average of the values of the selected scalar component of the - * finite element function characterized by fe_function at the - * quadrature points of the cell interface selected the last time - * the reinit function of the FEInterfaceValues object was called. - * - * The data type stored by the output vector must be what you get when you - * multiply the values of shape functions (i.e., @p value_type) times the - * type used to store the values of the unknowns $U_j$ of your finite - * element vector $U$ (represented by the @p fe_function argument). - * - * @dealiiRequiresUpdateFlags{update_values} - */ - template - void - get_average_of_function_values( - const InputVector &fe_function, - std::vector> - &values) const; - - /** - * This function relates to get_average_of_function_values() in the same way - * as get_function_values_from_local_dof_values() relates to - * get_function_values(). See the documentation of - * get_function_values_from_local_dof_values() for more - * information. - */ - template - void - get_average_of_function_values_from_local_dof_values( - const InputVector &local_dof_values, - std::vector> - &values) const; - /** * Return the jump in the gradients of the selected scalar components of the * finite element function characterized by fe_function at the @@ -481,95 +388,176 @@ namespace FEInterfaceViews &gradients) const; /** - * Return the average of the gradients of the selected scalar components of - * the finite element function characterized by fe_function at the - * quadrature points of the cell interface selected the last time + * Return the jump in the Hessians of the selected scalar component of the + * finite element function characterized by fe_function at the + * quadrature points of the cell, face or subface selected the last time * the reinit function of the FEInterfaceValues object was called. * * The data type stored by the output vector must be what you get when you - * multiply the gradients of shape functions (i.e., @p gradient_type) - * times the type used to store the values of the unknowns $U_j$ of your - * finite element vector $U$ (represented by the @p fe_function argument). + * multiply the Hessians of shape functions (i.e., @p hessian_type) times + * the type used to store the values of the unknowns $U_j$ of your finite + * element vector $U$ (represented by the @p fe_function argument). * - * @dealiiRequiresUpdateFlags{update_gradients} + * @dealiiRequiresUpdateFlags{update_hessians} */ template void - get_average_of_function_gradients( + get_jump_in_function_hessians( const InputVector &fe_function, - std::vector> - &gradients) const; + std::vector> + &hessians) const; /** - * This function relates to get_average_of_function_gradients() in the same - * way as get_function_values_from_local_dof_values() relates to + * This function relates to get_jump_in_function_hessians() in the same way + * as get_function_values_from_local_dof_values() relates to * get_function_values(). See the documentation of * get_function_values_from_local_dof_values() for more * information. */ template void - get_average_of_function_gradients_from_local_dof_values( + get_jump_in_function_hessians_from_local_dof_values( const InputVector &local_dof_values, - std::vector> - &gradients) const; + std::vector> + &hessians) const; /** - * Return the average of the Hessians of the selected scalar component of - * the finite element function characterized by fe_function at the - * quadrature points of the cell, face or subface selected the last time + * Return the jump in the third derivatives of the selected scalar component + * of the finite element function characterized by fe_function at + * the quadrature points of the cell, face or subface selected the last time * the reinit function of the FEInterfaceValues object was called. * * The data type stored by the output vector must be what you get when you - * multiply the Hessians of shape functions (i.e., @p hessian_type) times - * the type used to store the values of the unknowns $U_j$ of your finite - * element vector $U$ (represented by the @p fe_function argument). + * multiply the third derivatives of shape functions (i.e., @p + * third_derivative_type) times the type used to store the values of the + * unknowns $U_j$ of your finite element vector $U$ (represented by the @p + * fe_function argument). * - * @dealiiRequiresUpdateFlags{update_hessians} + * @dealiiRequiresUpdateFlags{update_third_derivatives} */ template void - get_average_of_function_hessians( + get_jump_in_function_third_derivatives( const InputVector &fe_function, - std::vector> - &hessians) const; + std::vector< + solution_third_derivative_type> + &third_derivatives) const; /** - * This function relates to get_average_of_function_hessians() in the same - * way as get_function_values_from_local_dof_values() relates to - * get_function_values(). See the documentation of + * This function relates to get_jump_in_function_third_derivatives() in the + * same way as get_function_values_from_local_dof_values() relates + * to get_function_values(). See the documentation of * get_function_values_from_local_dof_values() for more * information. */ template void - get_average_of_function_hessians_from_local_dof_values( + get_jump_in_function_third_derivatives_from_local_dof_values( const InputVector &local_dof_values, - std::vector> - &hessians) const; + std::vector< + solution_third_derivative_type> + &third_derivatives) const; + + //@} /** - * Return the jump in the Hessians of the selected scalar component of the + * @name Functions to evaluate the average of quantities + */ + //@{ + + /** + * Return the average value $\average{u}=\frac{1}{2}(u_1 + u_2)$ on the + * interface for the shape + * function @p interface_dof_index in the quadrature point @p q_point + * of the component selected by this view. + */ + value_type + average_of_values(const unsigned int interface_dof_index, + const unsigned int q_point) const; + + /** + * The same as above. + * + * @deprecated Use the average_of_values() function instead. + */ + DEAL_II_DEPRECATED + value_type + average_value(const unsigned int interface_dof_index, + const unsigned int q_point) const; + + /** + * The same as above. + * + * @deprecated Use the average_of_values() function instead. + */ + DEAL_II_DEPRECATED + value_type + average(const unsigned int interface_dof_index, + const unsigned int q_point) const; + + /** + * Return the average of the gradient $\average{\nabla u}$ on the interface + * for the shape + * function @p interface_dof_index in the quadrature point @p q_point + * of the component selected by this view. + */ + gradient_type + average_of_gradients(const unsigned int interface_dof_index, + const unsigned int q_point) const; + + /** + * The same as above. + * + * @deprecated Use the average_of_gradients() function instead. + */ + DEAL_II_DEPRECATED + gradient_type + average_gradient(const unsigned int interface_dof_index, + const unsigned int q_point) const; + + /** + * Return the average of the Hessian $\average{\nabla^2 u} = + * \frac{1}{2}\nabla^2 u_{\text{cell0}} + \frac{1}{2} \nabla^2 + * u_{\text{cell1}}$ on the interface + * for the shape function @p interface_dof_index at the quadrature point @p + * q_point of the component selected by this view. + */ + hessian_type + average_of_hessians(const unsigned int interface_dof_index, + const unsigned int q_point) const; + + /** + * The same as above. + * + * @deprecated Use the average_of_hessians() function instead. + */ + DEAL_II_DEPRECATED + hessian_type + average_hessian(const unsigned int interface_dof_index, + const unsigned int q_point) const; + + /** + * Return the average of the values of the selected scalar component of the * finite element function characterized by fe_function at the - * quadrature points of the cell, face or subface selected the last time + * quadrature points of the cell interface selected the last time * the reinit function of the FEInterfaceValues object was called. * * The data type stored by the output vector must be what you get when you - * multiply the Hessians of shape functions (i.e., @p hessian_type) times - * the type used to store the values of the unknowns $U_j$ of your finite + * multiply the values of shape functions (i.e., @p value_type) times the + * type used to store the values of the unknowns $U_j$ of your finite * element vector $U$ (represented by the @p fe_function argument). * - * @dealiiRequiresUpdateFlags{update_hessians} + * @dealiiRequiresUpdateFlags{update_values} */ template void - get_jump_in_function_hessians( + get_average_of_function_values( const InputVector &fe_function, - std::vector> - &hessians) const; + std::vector> + &values) const; /** - * This function relates to get_jump_in_function_hessians() in the same way + * This function relates to get_average_of_function_values() in the same way * as get_function_values_from_local_dof_values() relates to * get_function_values(). See the documentation of * get_function_values_from_local_dof_values() for more @@ -577,47 +565,80 @@ namespace FEInterfaceViews */ template void - get_jump_in_function_hessians_from_local_dof_values( + get_average_of_function_values_from_local_dof_values( const InputVector &local_dof_values, - std::vector> - &hessians) const; + std::vector> + &values) const; /** - * Return the jump in the third derivatives of the selected scalar component - * of the finite element function characterized by fe_function at - * the quadrature points of the cell, face or subface selected the last time + * Return the average of the gradients of the selected scalar components of + * the finite element function characterized by fe_function at the + * quadrature points of the cell interface selected the last time * the reinit function of the FEInterfaceValues object was called. * * The data type stored by the output vector must be what you get when you - * multiply the third derivatives of shape functions (i.e., @p - * third_derivative_type) times the type used to store the values of the - * unknowns $U_j$ of your finite element vector $U$ (represented by the @p - * fe_function argument). + * multiply the gradients of shape functions (i.e., @p gradient_type) + * times the type used to store the values of the unknowns $U_j$ of your + * finite element vector $U$ (represented by the @p fe_function argument). * - * @dealiiRequiresUpdateFlags{update_third_derivatives} + * @dealiiRequiresUpdateFlags{update_gradients} */ template void - get_jump_in_function_third_derivatives( + get_average_of_function_gradients( const InputVector &fe_function, - std::vector< - solution_third_derivative_type> - &third_derivatives) const; + std::vector> + &gradients) const; /** - * This function relates to get_jump_in_function_third_derivatives() in the - * same way as get_function_values_from_local_dof_values() relates - * to get_function_values(). See the documentation of + * This function relates to get_average_of_function_gradients() in the same + * way as get_function_values_from_local_dof_values() relates to + * get_function_values(). See the documentation of * get_function_values_from_local_dof_values() for more * information. */ template void - get_jump_in_function_third_derivatives_from_local_dof_values( + get_average_of_function_gradients_from_local_dof_values( const InputVector &local_dof_values, - std::vector< - solution_third_derivative_type> - &third_derivatives) const; + std::vector> + &gradients) const; + + /** + * Return the average of the Hessians of the selected scalar component of + * the finite element function characterized by fe_function at the + * quadrature points of the cell, face or subface selected the last time + * the reinit function of the FEInterfaceValues object was called. + * + * The data type stored by the output vector must be what you get when you + * multiply the Hessians of shape functions (i.e., @p hessian_type) times + * the type used to store the values of the unknowns $U_j$ of your finite + * element vector $U$ (represented by the @p fe_function argument). + * + * @dealiiRequiresUpdateFlags{update_hessians} + */ + template + void + get_average_of_function_hessians( + const InputVector &fe_function, + std::vector> + &hessians) const; + + /** + * This function relates to get_average_of_function_hessians() in the same + * way as get_function_values_from_local_dof_values() relates to + * get_function_values(). See the documentation of + * get_function_values_from_local_dof_values() for more + * information. + */ + template + void + get_average_of_function_hessians_from_local_dof_values( + const InputVector &local_dof_values, + std::vector> + &hessians) const; + + //@} private: /** @@ -664,12 +685,56 @@ namespace FEInterfaceViews using third_derivative_type = typename FEValuesViews::Vector::third_derivative_type; + /** + * An alias for the data type of the product of a @p Number and the + * values of the view this class provides. This is the data type of + * vector components of a finite element field whose degrees of + * freedom are described by a vector with elements of type @p Number. + */ + template + using solution_value_type = typename ProductType::type; + + /** + * An alias for the data type of the product of a @p Number and the + * gradients of the view this class provides. This is the data type of + * vector components of a finite element field whose degrees of + * freedom are described by a vector with elements of type @p Number. + */ + template + using solution_gradient_type = + typename ProductType::type; + + /** + * An alias for the data type of the product of a @p Number and the + * Hessians of the view this class provides. This is the data type of + * vector components of a finite element field whose degrees of + * freedom are described by a vector with elements of type @p Number. + */ + template + using solution_hessian_type = + typename ProductType::type; + + /** + * An alias for the data type of the product of a @p Number and the + * third derivatives of the view this class provides. This is the data type + * of vector components of a finite element field whose degrees of + * freedom are described by a vector with elements of type @p Number. + */ + template + using solution_third_derivative_type = + typename ProductType::type; + /** * Constructor for an object that represents a vector component */ Vector(const FEInterfaceValues &fe_interface, const unsigned int first_vector_component); + /** + * @name Functions to evaluate quantities + */ + //@{ + /** * Return the value of the vector components selected by this view * with interface dof index @p interface_dof_index in @@ -695,61 +760,87 @@ namespace FEInterfaceViews const unsigned int q_point) const; /** - * Return the jump vector $[\mathbf{u}]=\mathbf{u_1} - \mathbf{u_2}$ on the - * interface for the shape function - * @p interface_dof_index in the quadrature point @p q_point. - */ - value_type - jump_in_values(const unsigned int interface_dof_index, - const unsigned int q_point) const; - - /** - * The same as above. - * - * @deprecated Use the jump_in_values() function instead. + * Return the values of the selected vector component of the finite + * element function characterized by fe_function at the + * quadrature points of the cell interface selected the last time + * the reinit function of the FEInterfaceValues object was called. + * + * The argument @p here_or_there selects between the value on cell 0 (here, @p true) + * and cell 1 (there, @p false). You can also interpret it as "upstream" (@p true) + * and "downstream" (@p false) as defined by the direction of the normal + * vector in this quadrature point. If @p here_or_there is true, the values + * from the first cell of the interface is used. + * + * The data type stored by the output vector must be what you get when you + * multiply the values of shape functions (i.e., @p value_type) times the + * type used to store the values of the unknowns $U_j$ of your finite + * element vector $U$ (represented by the @p fe_function argument). + * + * @dealiiRequiresUpdateFlags{update_values} */ - DEAL_II_DEPRECATED - value_type - jump(const unsigned int interface_dof_index, - const unsigned int q_point) const; + template + void + get_function_values( + const bool here_or_there, + const InputVector &fe_function, + std::vector> + &values) const; /** - * Return the average vector $\average{\mathbf{u}}=\frac{1}{2}(\matbf{u_1} + - * \mathbf{u_2})$ on the interface for the shape - * function @p interface_dof_index in the quadrature point @p q_point. + * Same as above, but using a vector of local degree-of-freedom values. In + * other words, instead of extracting the nodal values of the degrees of + * freedom located on the current cell interface from a global vector + * associated with a DoFHandler object (as the function above does), this + * function instead takes these local nodal values through its first + * argument. + * + * @param[in] here_or_there Same as the one in the above function. + * + * @param[in] local_dof_values A vector of local nodal values. This vector + * must have a length equal to number of DoFs on the current cell, and + * must be ordered in the same order as degrees of freedom are numbered on + * the reference cell. + * + * @param[out] values A vector of values of the given finite element field, + * at the quadrature points on the current object. + * + * @tparam InputVector The @p InputVector type must allow creation + * of an ArrayView object from it; this is satisfied by the + * `std::vector` class, among others. */ - value_type - average_of_values(const unsigned int interface_dof_index, - const unsigned int q_point) const; + template + void + get_function_values_from_local_dof_values( + const bool here_or_there, + const InputVector &local_dof_values, + std::vector> + &values) const; + + //@} /** - * The same as above. - * - * @deprecated Use the average_of_values() function instead. + * @name Functions to evaluate jumps in quantities */ - DEAL_II_DEPRECATED - value_type - average(const unsigned int interface_dof_index, - const unsigned int q_point) const; + //@{ /** - * Return the average of the gradient (a tensor of rank 2) $\average{\nabla - * \mathbf{u}}$ on the interface for the shape - * function @p interface_dof_index in the quadrature point @p q_point. + * Return the jump vector $[\mathbf{u}]=\mathbf{u_1} - \mathbf{u_2}$ on the + * interface for the shape function + * @p interface_dof_index in the quadrature point @p q_point. */ - gradient_type - average_of_gradients(const unsigned int interface_dof_index, - const unsigned int q_point) const; + value_type + jump_in_values(const unsigned int interface_dof_index, + const unsigned int q_point) const; /** * The same as above. * - * @deprecated Use the average_of_gradients() function instead. + * @deprecated Use the jump_in_values() function instead. */ DEAL_II_DEPRECATED - gradient_type - average_gradient(const unsigned int interface_dof_index, - const unsigned int q_point) const; + value_type + jump(const unsigned int interface_dof_index, + const unsigned int q_point) const; /** * Return the jump of the gradient (a tensor of rank 2) $\jump{\nabla @@ -769,26 +860,6 @@ namespace FEInterfaceViews jump_gradient(const unsigned int interface_dof_index, const unsigned int q_point) const; - /** - * Return the average of the Hessian $\average{\nabla^2 u} = - * \frac{1}{2}\nabla^2 u_{\text{cell0}} + \frac{1}{2} \nabla^2 - * u_{\text{cell1}}$ on the interface - * for the shape function @p interface_dof_index at the quadrature point @p - * q_point of the component selected by this view. - */ - hessian_type - average_of_hessians(const unsigned int interface_dof_index, - const unsigned int q_point) const; - - /** - * The same as above. - * - * @deprecated Use the average_of_hessians() function instead. - */ - hessian_type - average_hessian(const unsigned int interface_dof_index, - const unsigned int q_point) const; - /** * Return the jump in the gradient $\jump{\nabla u}=\nabla u_{\text{cell0}} * - \nabla u_{\text{cell1}}$ on the interface for the shape function @p @@ -829,56 +900,11 @@ namespace FEInterfaceViews const unsigned int q_point) const; /** - * An alias for the data type of the product of a @p Number and the - * values of the view this class provides. This is the data type of - * vector components of a finite element field whose degrees of - * freedom are described by a vector with elements of type @p Number. - */ - template - using solution_value_type = typename ProductType::type; - - /** - * An alias for the data type of the product of a @p Number and the - * gradients of the view this class provides. This is the data type of - * vector components of a finite element field whose degrees of - * freedom are described by a vector with elements of type @p Number. - */ - template - using solution_gradient_type = - typename ProductType::type; - - /** - * An alias for the data type of the product of a @p Number and the - * Hessians of the view this class provides. This is the data type of - * vector components of a finite element field whose degrees of - * freedom are described by a vector with elements of type @p Number. - */ - template - using solution_hessian_type = - typename ProductType::type; - - /** - * An alias for the data type of the product of a @p Number and the - * third derivatives of the view this class provides. This is the data type - * of vector components of a finite element field whose degrees of - * freedom are described by a vector with elements of type @p Number. - */ - template - using solution_third_derivative_type = - typename ProductType::type; - - /** - * Return the values of the selected vector component of the finite - * element function characterized by fe_function at the + * Return the jump in the values of the selected vector component of the + * finite element function characterized by fe_function at the * quadrature points of the cell interface selected the last time * the reinit function of the FEInterfaceValues object was called. * - * The argument @p here_or_there selects between the value on cell 0 (here, @p true) - * and cell 1 (there, @p false). You can also interpret it as "upstream" (@p true) - * and "downstream" (@p false) as defined by the direction of the normal - * vector in this quadrature point. If @p here_or_there is true, the values - * from the first cell of the interface is used. - * * The data type stored by the output vector must be what you get when you * multiply the values of shape functions (i.e., @p value_type) times the * type used to store the values of the unknowns $U_j$ of your finite @@ -888,64 +914,47 @@ namespace FEInterfaceViews */ template void - get_function_values( - const bool here_or_there, + get_jump_in_function_values( const InputVector &fe_function, std::vector> &values) const; /** - * Same as above, but using a vector of local degree-of-freedom values. In - * other words, instead of extracting the nodal values of the degrees of - * freedom located on the current cell interface from a global vector - * associated with a DoFHandler object (as the function above does), this - * function instead takes these local nodal values through its first - * argument. - * - * @param[in] here_or_there Same as the one in the above function. - * - * @param[in] local_dof_values A vector of local nodal values. This vector - * must have a length equal to number of DoFs on the current cell, and - * must be ordered in the same order as degrees of freedom are numbered on - * the reference cell. - * - * @param[out] values A vector of values of the given finite element field, - * at the quadrature points on the current object. - * - * @tparam InputVector The @p InputVector type must allow creation - * of an ArrayView object from it; this is satisfied by the - * `std::vector` class, among others. + * This function relates to get_jump_in_function_values() in the same way + * as get_function_values_from_local_dof_values() relates to + * get_function_values(). See the documentation of + * get_function_values_from_local_dof_values() for more + * information. */ template void - get_function_values_from_local_dof_values( - const bool here_or_there, + get_jump_in_function_values_from_local_dof_values( const InputVector &local_dof_values, std::vector> &values) const; /** - * Return the jump in the values of the selected vector component of the + * Return the jump in the gradients of the selected vector components of the * finite element function characterized by fe_function at the * quadrature points of the cell interface selected the last time * the reinit function of the FEInterfaceValues object was called. * * The data type stored by the output vector must be what you get when you - * multiply the values of shape functions (i.e., @p value_type) times the - * type used to store the values of the unknowns $U_j$ of your finite - * element vector $U$ (represented by the @p fe_function argument). + * multiply the gradients of shape functions (i.e., @p gradient_type) + * times the type used to store the values of the unknowns $U_j$ of your + * finite element vector $U$ (represented by the @p fe_function argument). * - * @dealiiRequiresUpdateFlags{update_values} + * @dealiiRequiresUpdateFlags{update_gradients} */ template void - get_jump_in_function_values( + get_jump_in_function_gradients( const InputVector &fe_function, - std::vector> - &values) const; + std::vector> + &gradients) const; /** - * This function relates to get_jump_in_function_values() in the same way + * This function relates to get_jump_in_function_gradients() in the same way * as get_function_values_from_local_dof_values() relates to * get_function_values(). See the documentation of * get_function_values_from_local_dof_values() for more @@ -953,33 +962,33 @@ namespace FEInterfaceViews */ template void - get_jump_in_function_values_from_local_dof_values( + get_jump_in_function_gradients_from_local_dof_values( const InputVector &local_dof_values, - std::vector> - &values) const; + std::vector> + &gradients) const; /** - * Return the average of the values of the selected vector component of the + * Return the jump in the Hessians of the selected vector component of the * finite element function characterized by fe_function at the - * quadrature points of the cell interface selected the last time + * quadrature points of the cell, face or subface selected the last time * the reinit function of the FEInterfaceValues object was called. * * The data type stored by the output vector must be what you get when you - * multiply the values of shape functions (i.e., @p value_type) times the - * type used to store the values of the unknowns $U_j$ of your finite + * multiply the Hessians of shape functions (i.e., @p hessian_type) times + * the type used to store the values of the unknowns $U_j$ of your finite * element vector $U$ (represented by the @p fe_function argument). * - * @dealiiRequiresUpdateFlags{update_values} + * @dealiiRequiresUpdateFlags{update_hessians} */ template void - get_average_of_function_values( + get_jump_in_function_hessians( const InputVector &fe_function, - std::vector> - &values) const; + std::vector> + &hessians) const; /** - * This function relates to get_average_of_function_values() in the same way + * This function relates to get_jump_in_function_hessians() in the same way * as get_function_values_from_local_dof_values() relates to * get_function_values(). See the documentation of * get_function_values_from_local_dof_values() for more @@ -987,33 +996,135 @@ namespace FEInterfaceViews */ template void - get_average_of_function_values_from_local_dof_values( + get_jump_in_function_hessians_from_local_dof_values( const InputVector &local_dof_values, - std::vector> - &values) const; + std::vector> + &hessians) const; /** - * Return the jump in the gradients of the selected vector components of the - * finite element function characterized by fe_function at the - * quadrature points of the cell interface selected the last time + * Return the jump in the third derivatives of the selected vector component + * of the finite element function characterized by fe_function at + * the quadrature points of the cell, face or subface selected the last time * the reinit function of the FEInterfaceValues object was called. * * The data type stored by the output vector must be what you get when you - * multiply the gradients of shape functions (i.e., @p gradient_type) - * times the type used to store the values of the unknowns $U_j$ of your - * finite element vector $U$ (represented by the @p fe_function argument). + * multiply the third derivatives of shape functions (i.e., @p + * third_derivative_type) times the type used to store the values of the + * unknowns $U_j$ of your finite element vector $U$ (represented by the @p + * fe_function argument). + * + * @dealiiRequiresUpdateFlags{update_third_derivatives} + */ + template + void + get_jump_in_function_third_derivatives( + const InputVector &fe_function, + std::vector< + solution_third_derivative_type> + &third_derivatives) const; + + /** + * This function relates to get_jump_in_function_third_derivatives() in the + * same way as get_function_values_from_local_dof_values() relates + * to get_function_values(). See the documentation of + * get_function_values_from_local_dof_values() for more + * information. + */ + template + void + get_jump_in_function_third_derivatives_from_local_dof_values( + const InputVector &local_dof_values, + std::vector< + solution_third_derivative_type> + &third_derivatives) const; + + //@} + + /** + * @name Functions to evaluate the average of quantities + */ + //@{ + + /** + * Return the average vector $\average{\mathbf{u}}=\frac{1}{2}(\matbf{u_1} + + * \mathbf{u_2})$ on the interface for the shape + * function @p interface_dof_index in the quadrature point @p q_point. + */ + value_type + average_of_values(const unsigned int interface_dof_index, + const unsigned int q_point) const; + + /** + * The same as above. + * + * @deprecated Use the average_of_values() function instead. + */ + DEAL_II_DEPRECATED + value_type + average(const unsigned int interface_dof_index, + const unsigned int q_point) const; + + /** + * Return the average of the gradient (a tensor of rank 2) $\average{\nabla + * \mathbf{u}}$ on the interface for the shape + * function @p interface_dof_index in the quadrature point @p q_point. + */ + gradient_type + average_of_gradients(const unsigned int interface_dof_index, + const unsigned int q_point) const; + + /** + * The same as above. + * + * @deprecated Use the average_of_gradients() function instead. + */ + DEAL_II_DEPRECATED + gradient_type + average_gradient(const unsigned int interface_dof_index, + const unsigned int q_point) const; + + /** + * Return the average of the Hessian $\average{\nabla^2 u} = + * \frac{1}{2}\nabla^2 u_{\text{cell0}} + \frac{1}{2} \nabla^2 + * u_{\text{cell1}}$ on the interface + * for the shape function @p interface_dof_index at the quadrature point @p + * q_point of the component selected by this view. + */ + hessian_type + average_of_hessians(const unsigned int interface_dof_index, + const unsigned int q_point) const; + + /** + * The same as above. + * + * @deprecated Use the average_of_hessians() function instead. + */ + hessian_type + average_hessian(const unsigned int interface_dof_index, + const unsigned int q_point) const; + + /** + * Return the average of the values of the selected vector component of the + * finite element function characterized by fe_function at the + * quadrature points of the cell interface selected the last time + * the reinit function of the FEInterfaceValues object was called. * - * @dealiiRequiresUpdateFlags{update_gradients} + * The data type stored by the output vector must be what you get when you + * multiply the values of shape functions (i.e., @p value_type) times the + * type used to store the values of the unknowns $U_j$ of your finite + * element vector $U$ (represented by the @p fe_function argument). + * + * @dealiiRequiresUpdateFlags{update_values} */ template void - get_jump_in_function_gradients( + get_average_of_function_values( const InputVector &fe_function, - std::vector> - &gradients) const; + std::vector> + &values) const; /** - * This function relates to get_jump_in_function_gradients() in the same way + * This function relates to get_average_of_function_values() in the same way * as get_function_values_from_local_dof_values() relates to * get_function_values(). See the documentation of * get_function_values_from_local_dof_values() for more @@ -1021,10 +1132,10 @@ namespace FEInterfaceViews */ template void - get_jump_in_function_gradients_from_local_dof_values( + get_average_of_function_values_from_local_dof_values( const InputVector &local_dof_values, - std::vector> - &gradients) const; + std::vector> + &values) const; /** * Return the average of the gradients of the selected vector components of @@ -1094,77 +1205,7 @@ namespace FEInterfaceViews std::vector> &hessians) const; - /** - * Return the jump in the Hessians of the selected vector component of the - * finite element function characterized by fe_function at the - * quadrature points of the cell, face or subface selected the last time - * the reinit function of the FEInterfaceValues object was called. - * - * The data type stored by the output vector must be what you get when you - * multiply the Hessians of shape functions (i.e., @p hessian_type) times - * the type used to store the values of the unknowns $U_j$ of your finite - * element vector $U$ (represented by the @p fe_function argument). - * - * @dealiiRequiresUpdateFlags{update_hessians} - */ - template - void - get_jump_in_function_hessians( - const InputVector &fe_function, - std::vector> - &hessians) const; - - /** - * This function relates to get_jump_in_function_hessians() in the same way - * as get_function_values_from_local_dof_values() relates to - * get_function_values(). See the documentation of - * get_function_values_from_local_dof_values() for more - * information. - */ - template - void - get_jump_in_function_hessians_from_local_dof_values( - const InputVector &local_dof_values, - std::vector> - &hessians) const; - - /** - * Return the jump in the third derivatives of the selected vector component - * of the finite element function characterized by fe_function at - * the quadrature points of the cell, face or subface selected the last time - * the reinit function of the FEInterfaceValues object was called. - * - * The data type stored by the output vector must be what you get when you - * multiply the third derivatives of shape functions (i.e., @p - * third_derivative_type) times the type used to store the values of the - * unknowns $U_j$ of your finite element vector $U$ (represented by the @p - * fe_function argument). - * - * @dealiiRequiresUpdateFlags{update_third_derivatives} - */ - template - void - get_jump_in_function_third_derivatives( - const InputVector &fe_function, - std::vector< - solution_third_derivative_type> - &third_derivatives) const; - - /** - * This function relates to get_jump_in_function_third_derivatives() in the - * same way as get_function_values_from_local_dof_values() relates - * to get_function_values(). See the documentation of - * get_function_values_from_local_dof_values() for more - * information. - */ - template - void - get_jump_in_function_third_derivatives_from_local_dof_values( - const InputVector &local_dof_values, - std::vector< - solution_third_derivative_type> - &third_derivatives) const; - + //@} private: /** @@ -1500,7 +1541,7 @@ public: */ /** - * @name Functions to evaluate data of the shape functions + * @name Functions to evaluate shape functions * @{ */ @@ -1531,6 +1572,15 @@ public: const unsigned int q_point, const unsigned int component = 0) const; + /** + * @} + */ + + /** + * @name Functions to evaluate jumps in shape functions + * @{ + */ + /** * Return the jump $\jump{u}=u_{\text{cell0}} - u_{\text{cell1}}$ on the * interface @@ -1561,6 +1611,91 @@ public: const unsigned int q_point, const unsigned int component = 0) const; + /** + * Return the jump in the gradient $\jump{\nabla u}=\nabla u_{\text{cell0}} - + * \nabla u_{\text{cell1}}$ on the interface for the shape function @p + * interface_dof_index at the quadrature point @p q_point of component @p + * component. + * + * If this is a boundary face (at_boundary() returns true), then + * $\jump{\nabla u}=\nabla u_{\text{cell0}}$. + */ + Tensor<1, spacedim> + jump_in_shape_gradients(const unsigned int interface_dof_index, + const unsigned int q_point, + const unsigned int component = 0) const; + + /** + * The same as above. + * + * @deprecated Use the jump_in_shape_gradients() function instead. + */ + DEAL_II_DEPRECATED + Tensor<1, spacedim> + jump_gradient(const unsigned int interface_dof_index, + const unsigned int q_point, + const unsigned int component = 0) const; + + /** + * Return the jump in the Hessian $\jump{\nabla^2 u} = \nabla^2 + * u_{\text{cell0}} - \nabla^2 u_{\text{cell1}}$ on the interface for the + * shape function + * @p interface_dof_index at the quadrature point @p q_point of component + * @p component. + * + * If this is a boundary face (at_boundary() returns true), then + * $\jump{\nabla^2 u} = \nabla^2 u_{\text{cell0}}$. + */ + Tensor<2, spacedim> + jump_in_shape_hessians(const unsigned int interface_dof_index, + const unsigned int q_point, + const unsigned int component = 0) const; + + /** + * The same as above. + * + * @deprecated Use the jump_in_shape_hessians() function instead. + */ + DEAL_II_DEPRECATED + Tensor<2, spacedim> + jump_hessian(const unsigned int interface_dof_index, + const unsigned int q_point, + const unsigned int component = 0) const; + + /** + * Return the jump in the third derivative $\jump{\nabla^3 u} = \nabla^3 + * u_{\text{cell0}} - \nabla^3 u_{\text{cell1}}$ on the interface for the + * shape function @p interface_dof_index at the quadrature point @p q_point of + * component @p component. + * + * If this is a boundary face (at_boundary() returns true), then + * $\jump{\nabla^3 u} = \nabla^3 u_{\text{cell0}}$. + */ + Tensor<3, spacedim> + jump_in_shape_3rd_derivatives(const unsigned int interface_dof_index, + const unsigned int q_point, + const unsigned int component = 0) const; + + /** + * The same as above. + * + * @deprecated Use the jump_in_shape_3rd_derivatives() function instead. + */ + DEAL_II_DEPRECATED + Tensor<3, spacedim> + jump_3rd_derivative(const unsigned int interface_dof_index, + const unsigned int q_point, + const unsigned int component = 0) const; + + /** + * @} + */ + + /** + * @name Functions to evaluate the average of shape functions + * @{ + */ + /** * Return the average $\average{u}=\frac{1}{2}u_{\text{cell0}} + * \frac{1}{2}u_{\text{cell1}}$ on the interface @@ -1638,80 +1773,13 @@ public: const unsigned int component = 0) const; /** - * Return the jump in the gradient $\jump{\nabla u}=\nabla u_{\text{cell0}} - - * \nabla u_{\text{cell1}}$ on the interface for the shape function @p - * interface_dof_index at the quadrature point @p q_point of component @p - * component. - * - * If this is a boundary face (at_boundary() returns true), then - * $\jump{\nabla u}=\nabla u_{\text{cell0}}$. - */ - Tensor<1, spacedim> - jump_in_shape_gradients(const unsigned int interface_dof_index, - const unsigned int q_point, - const unsigned int component = 0) const; - - /** - * The same as above. - * - * @deprecated Use the jump_in_shape_gradients() function instead. - */ - DEAL_II_DEPRECATED - Tensor<1, spacedim> - jump_gradient(const unsigned int interface_dof_index, - const unsigned int q_point, - const unsigned int component = 0) const; - - /** - * Return the jump in the Hessian $\jump{\nabla^2 u} = \nabla^2 - * u_{\text{cell0}} - \nabla^2 u_{\text{cell1}}$ on the interface for the - * shape function - * @p interface_dof_index at the quadrature point @p q_point of component - * @p component. - * - * If this is a boundary face (at_boundary() returns true), then - * $\jump{\nabla^2 u} = \nabla^2 u_{\text{cell0}}$. - */ - Tensor<2, spacedim> - jump_in_shape_hessians(const unsigned int interface_dof_index, - const unsigned int q_point, - const unsigned int component = 0) const; - - /** - * The same as above. - * - * @deprecated Use the jump_in_shape_hessians() function instead. - */ - DEAL_II_DEPRECATED - Tensor<2, spacedim> - jump_hessian(const unsigned int interface_dof_index, - const unsigned int q_point, - const unsigned int component = 0) const; - - /** - * Return the jump in the third derivative $\jump{\nabla^3 u} = \nabla^3 - * u_{\text{cell0}} - \nabla^3 u_{\text{cell1}}$ on the interface for the - * shape function @p interface_dof_index at the quadrature point @p q_point of - * component @p component. - * - * If this is a boundary face (at_boundary() returns true), then - * $\jump{\nabla^3 u} = \nabla^3 u_{\text{cell0}}$. + * @} */ - Tensor<3, spacedim> - jump_in_shape_3rd_derivatives(const unsigned int interface_dof_index, - const unsigned int q_point, - const unsigned int component = 0) const; /** - * The same as above. - * - * @deprecated Use the jump_in_shape_3rd_derivatives() function instead. + * @name Extractors Methods to extract individual components + * @{ */ - DEAL_II_DEPRECATED - Tensor<3, spacedim> - jump_3rd_derivative(const unsigned int interface_dof_index, - const unsigned int q_point, - const unsigned int component = 0) const; /** * Create a view of the current FEInterfaceValues object that represents a