From: Martin Kronbichler Date: Thu, 17 Sep 2020 10:59:57 +0000 (+0200) Subject: Adjust return parameter. Add inverse mass matrix X-Git-Tag: v9.3.0-rc1~1108^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F10922%2Fhead;p=dealii.git Adjust return parameter. Add inverse mass matrix --- diff --git a/include/deal.II/matrix_free/evaluation_kernels.h b/include/deal.II/matrix_free/evaluation_kernels.h index da6a399cc8..8f40cb85d3 100644 --- a/include/deal.II/matrix_free/evaluation_kernels.h +++ b/include/deal.II/matrix_free/evaluation_kernels.h @@ -1396,7 +1396,7 @@ namespace internal struct FEEvaluationImplEvaluateSelector { template - static void + static bool run(const unsigned int n_components, const EvaluationFlags::EvaluationFlags evaluation_flag, const internal::MatrixFreeFunctions::ShapeInfo &shape_info, @@ -1519,6 +1519,8 @@ namespace internal } else AssertThrow(false, ExcNotImplemented()); + + return false; } }; @@ -1543,7 +1545,7 @@ namespace internal struct FEEvaluationImplIntegrateSelector { template - static void + static bool run(const unsigned int n_components, const EvaluationFlags::EvaluationFlags integration_flag, const internal::MatrixFreeFunctions::ShapeInfo &shape_info, @@ -1666,6 +1668,8 @@ namespace internal } else AssertThrow(false, ExcNotImplemented()); + + return false; } }; @@ -2313,7 +2317,7 @@ namespace internal struct FEFaceEvaluationImplEvaluateSelector { template - static void + static bool run(const unsigned int n_components, const MatrixFreeFunctions::ShapeInfo &data, const VectorizedArrayType * values_array, @@ -2392,6 +2396,8 @@ namespace internal scratch_data, values_quad, gradients_quad); + + return false; } }; @@ -2401,7 +2407,7 @@ namespace internal struct FEFaceEvaluationImplIntegrateSelector { template - static void + static bool run(const unsigned int n_components, const MatrixFreeFunctions::ShapeInfo &data, VectorizedArrayType * values_array, @@ -2484,6 +2490,7 @@ namespace internal values_array, integrate_gradients, face_no); + return false; } }; @@ -3515,18 +3522,20 @@ namespace internal /** * This struct implements the action of the inverse mass matrix operation + * using an FEEvaluationBaseData argument. */ - template - struct CellwiseInverseMassMatrixImpl + template + struct CellwiseInverseMassMatrixImplBasic { - static void - apply(const unsigned int n_components, - const FEEvaluationBaseData &fe_eval, - const Number * in_array, - Number * out_array) + template + static bool + run(const unsigned int n_components, + const FEEvaluationBaseData &fe_eval, + const Number * in_array, + Number * out_array) { constexpr unsigned int dofs_per_component = Utilities::pow(fe_degree + 1, dim); @@ -3573,14 +3582,26 @@ namespace internal evaluator.template hessians<1, false, false>(out, out); evaluator.template hessians<0, false, false>(out, out); } + return false; } + }; - static void - apply(const unsigned int n_desired_components, - const AlignedVector &inverse_shape, - const AlignedVector &inverse_coefficients, - const Number * in_array, - Number * out_array) + + + /** + * This struct implements the action of the inverse mass matrix operation + * using an FEEvaluationBaseData argument. + */ + template + struct CellwiseInverseMassMatrixImplFlexible + { + template + static bool + run(const unsigned int n_desired_components, + const AlignedVector &inverse_shape, + const AlignedVector &inverse_coefficients, + const Number * in_array, + Number * out_array) { constexpr unsigned int dofs_per_component = Utilities::pow(fe_degree + 1, dim); @@ -3630,13 +3651,25 @@ namespace internal inv_coefficient += shift_coefficient; } + return false; } + }; - static void - transform_from_q_points_to_basis(const unsigned int n_desired_components, - const AlignedVector &inverse_shape, - const Number * in_array, - Number * out_array) + + + /** + * This struct implements the action of the inverse mass matrix operation + * using an FEEvaluationBaseData argument. + */ + template + struct CellwiseInverseMassMatrixImplTransformFromQPoints + { + template + static bool + run(const unsigned int n_desired_components, + const AlignedVector &inverse_shape, + const Number * in_array, + Number * out_array) { constexpr unsigned int dofs_per_cell = Utilities::pow(fe_degree + 1, dim); internal::EvaluatorTensorProduct(in, out); } + return false; } }; diff --git a/include/deal.II/matrix_free/operators.h b/include/deal.II/matrix_free/operators.h index 9e68e74c98..cd5cb3e7ca 100644 --- a/include/deal.II/matrix_free/operators.h +++ b/include/deal.II/matrix_free/operators.h @@ -1016,9 +1016,8 @@ namespace MatrixFreeOperators VectorizedArrayType>::apply(const VectorizedArrayType *in_array, VectorizedArrayType * out_array) const { - internal:: - CellwiseInverseMassMatrixImpl::apply( - n_components, fe_eval, in_array, out_array); + internal::CellwiseInverseMassMatrixImplBasic:: + template run(n_components, fe_eval, in_array, out_array); } @@ -1039,8 +1038,8 @@ namespace MatrixFreeOperators const VectorizedArrayType * in_array, VectorizedArrayType * out_array) const { - internal:: - CellwiseInverseMassMatrixImpl::apply( + internal::CellwiseInverseMassMatrixImplFlexible:: + template run( n_actual_components, fe_eval.get_shape_info().data.front().inverse_shape_values_eo, inverse_coefficients, @@ -1065,13 +1064,14 @@ namespace MatrixFreeOperators const VectorizedArrayType *in_array, VectorizedArrayType * out_array) const { - internal:: - CellwiseInverseMassMatrixImpl:: - transform_from_q_points_to_basis( - n_actual_components, - fe_eval.get_shape_info().data.front().inverse_shape_values_eo, - in_array, - out_array); + internal::CellwiseInverseMassMatrixImplTransformFromQPoints< + dim, + VectorizedArrayType>::template run(n_actual_components, + fe_eval.get_shape_info() + .data.front() + .inverse_shape_values_eo, + in_array, + out_array); }