From 18d7bb1457d155c51d8b692b618dc996b0e85992 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Wed, 18 Apr 2018 17:35:11 +0200 Subject: [PATCH] Slightly relax Hermite detection; add a test for Hermite type. --- include/deal.II/matrix_free/evaluation_selector.h | 10 ++++------ include/deal.II/matrix_free/shape_info.templates.h | 2 +- tests/matrix_free/shape_info.cc | 14 ++++++++++++++ tests/matrix_free/shape_info.output | 13 +++++++++++++ 4 files changed, 32 insertions(+), 7 deletions(-) diff --git a/include/deal.II/matrix_free/evaluation_selector.h b/include/deal.II/matrix_free/evaluation_selector.h index db65bbcbd6..0215bf0a3b 100644 --- a/include/deal.II/matrix_free/evaluation_selector.h +++ b/include/deal.II/matrix_free/evaluation_selector.h @@ -245,8 +245,7 @@ namespace const bool evaluate_gradients, const bool evaluate_hessians) { - Assert(shape_info.element_type == internal::MatrixFreeFunctions::tensor_symmetric|| - shape_info.element_type == internal::MatrixFreeFunctions::tensor_symmetric_collocation, + Assert(shape_info.element_type <= internal::MatrixFreeFunctions::tensor_symmetric, ExcInternalError()); Factory::evaluate (shape_info, values_dofs_actual, values_quad, gradients_quad, hessians_quad, @@ -268,8 +267,7 @@ namespace const bool integrate_values, const bool integrate_gradients) { - Assert(shape_info.element_type == internal::MatrixFreeFunctions::tensor_symmetric|| - shape_info.element_type == internal::MatrixFreeFunctions::tensor_symmetric_collocation, + Assert(shape_info.element_type <= internal::MatrixFreeFunctions::tensor_symmetric, ExcInternalError()); Factory::integrate (shape_info, values_dofs_actual, values_quad, gradients_quad, @@ -401,7 +399,7 @@ SelectEvaluator::evaluate evaluate_values, evaluate_gradients, evaluate_hessians); } else if (fe_degree < n_q_points_1d && - shape_info.element_type == internal::MatrixFreeFunctions::tensor_symmetric) + shape_info.element_type <= internal::MatrixFreeFunctions::tensor_symmetric) { internal::FEEvaluationImplTransformToCollocation ::evaluate(shape_info, values_dofs_actual, values_quad, @@ -469,7 +467,7 @@ SelectEvaluator::integrate integrate_values, integrate_gradients, false); } else if (fe_degree < n_q_points_1d && - shape_info.element_type == internal::MatrixFreeFunctions::tensor_symmetric) + shape_info.element_type <= internal::MatrixFreeFunctions::tensor_symmetric) { internal::FEEvaluationImplTransformToCollocation ::integrate(shape_info, values_dofs_actual, values_quad, diff --git a/include/deal.II/matrix_free/shape_info.templates.h b/include/deal.II/matrix_free/shape_info.templates.h index 8260f8f869..3a83d68912 100644 --- a/include/deal.II/matrix_free/shape_info.templates.h +++ b/include/deal.II/matrix_free/shape_info.templates.h @@ -278,7 +278,7 @@ namespace internal element_type = tensor_symmetric_collocation; else element_type = tensor_symmetric; - if (n_dofs_1d > 3 && element_type == tensor_symmetric) + if (n_dofs_1d > 2 && element_type == tensor_symmetric) { // check if we are a Hermite type element_type = tensor_symmetric_hermite; diff --git a/tests/matrix_free/shape_info.cc b/tests/matrix_free/shape_info.cc index 35b63427ab..a21a375bec 100644 --- a/tests/matrix_free/shape_info.cc +++ b/tests/matrix_free/shape_info.cc @@ -87,6 +87,20 @@ int main () test(FE_DGQ<2>(17), gauss8); test(FE_DGQ<2>(25), gauss3); + test(FE_DGQHermite<2>(1), gauss3); + test(FE_DGQHermite<2>(1), gauss8); + test(FE_DGQHermite<2>(2), gauss3); + test(FE_DGQHermite<2>(2), gauss8); + test(FE_DGQHermite<2>(3), gauss3); + test(FE_DGQHermite<2>(3), gauss8); + test(FE_DGQHermite<2>(6), gauss3); + test(FE_DGQHermite<2>(6), gauss8); + test(FE_DGQHermite<2>(12), gauss3); + test(FE_DGQHermite<2>(12), gauss8); + test(FE_DGQHermite<2>(25), gauss3); + test(FE_DGQHermite<2>(25), gauss8); + test(FE_DGQHermite<2>(45), gauss8); + test(FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(), 1)), gauss3); test(FE_DGQArbitraryNodes<3>(QIterated<1>(QTrapez<1>(), 6)), gauss3); test(FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(), 13)), gauss8); diff --git a/tests/matrix_free/shape_info.output b/tests/matrix_free/shape_info.output index e84cf72bec..87b8dbfbd5 100644 --- a/tests/matrix_free/shape_info.output +++ b/tests/matrix_free/shape_info.output @@ -29,6 +29,19 @@ DEAL::Detected shape info type for FE_DGQ<3>(6): 2 DEAL::Detected shape info type for FE_Q_Hierarchical<3>(6): 3 DEAL::Detected shape info type for FE_DGQ<2>(17): 2 DEAL::Detected shape info type for FE_DGQ<2>(25): 2 +DEAL::Detected shape info type for FE_DGQHermite<2>(1): 2 +DEAL::Detected shape info type for FE_DGQHermite<2>(1): 2 +DEAL::Detected shape info type for FE_DGQHermite<2>(2): 3 +DEAL::Detected shape info type for FE_DGQHermite<2>(2): 1 +DEAL::Detected shape info type for FE_DGQHermite<2>(3): 1 +DEAL::Detected shape info type for FE_DGQHermite<2>(3): 1 +DEAL::Detected shape info type for FE_DGQHermite<2>(6): 1 +DEAL::Detected shape info type for FE_DGQHermite<2>(6): 1 +DEAL::Detected shape info type for FE_DGQHermite<2>(12): 1 +DEAL::Detected shape info type for FE_DGQHermite<2>(12): 1 +DEAL::Detected shape info type for FE_DGQHermite<2>(25): 1 +DEAL::Detected shape info type for FE_DGQHermite<2>(25): 1 +DEAL::Detected shape info type for FE_DGQHermite<2>(45): 1 DEAL::Detected shape info type for FE_DGQ<2>(1): 2 DEAL::Detected shape info type for FE_DGQArbitraryNodes<3>(QIterated(QTrapez(),6)): 2 DEAL::Detected shape info type for FE_DGQArbitraryNodes<2>(QIterated(QTrapez(),13)): 2 -- 2.39.5