From 161f87af6b6bc4db6228f057b062f4de420061f8 Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Tue, 30 Jan 2018 11:18:50 +0100 Subject: [PATCH] Fix transfer for high polynomial degrees. --- source/multigrid/mg_transfer_matrix_free.cc | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/source/multigrid/mg_transfer_matrix_free.cc b/source/multigrid/mg_transfer_matrix_free.cc index a6e11cc4db..57de8ca64b 100644 --- a/source/multigrid/mg_transfer_matrix_free.cc +++ b/source/multigrid/mg_transfer_matrix_free.cc @@ -274,12 +274,16 @@ namespace template void perform_tensorized_op(const Eval &evaluator, + const unsigned int n_points_in, const unsigned int n_child_cell_dofs, const unsigned int n_components, AlignedVector > &evaluation_data) { if (Eval::n_q_points != numbers::invalid_unsigned_int) AssertDimension(n_components * Eval::n_q_points, n_child_cell_dofs); + if (Eval::dofs_per_cell != numbers::invalid_unsigned_int) + AssertDimension(Eval::dofs_per_cell, n_points_in); + const unsigned int n_points_out = n_child_cell_dofs / n_components; VectorizedArray *t0 = &evaluation_data[0]; VectorizedArray *t1 = &evaluation_data[n_child_cell_dofs]; VectorizedArray *t2 = &evaluation_data[2*n_child_cell_dofs]; @@ -305,13 +309,13 @@ namespace Assert(false, ExcNotImplemented()); if (prolongate) { - t0 += Eval::dofs_per_cell; - t2 += Eval::n_q_points; + t0 += n_points_in; + t2 += n_points_out; } else { - t0 += Eval::n_q_points; - t2 += Eval::dofs_per_cell; + t0 += n_points_out; + t2 += n_points_in; } } } @@ -402,6 +406,7 @@ void MGTransferMatrixFree fe_degree, 2*fe_degree+1); perform_tensorized_op(evaluator, + Utilities::fixed_power(fe_degree+1), n_child_cell_dofs, n_components, evaluation_data); @@ -418,6 +423,7 @@ void MGTransferMatrixFree fe_degree, 2*(fe_degree+1)); perform_tensorized_op(evaluator, + Utilities::fixed_power(fe_degree+1), n_child_cell_dofs, n_components, evaluation_data); @@ -483,6 +489,7 @@ void MGTransferMatrixFree n_components, fe_degree, &evaluation_data[0]); perform_tensorized_op(evaluator, + Utilities::fixed_power(fe_degree+1), n_child_cell_dofs, n_components, evaluation_data); @@ -496,6 +503,7 @@ void MGTransferMatrixFree fe_degree, 2*(fe_degree+1)); perform_tensorized_op(evaluator, + Utilities::fixed_power(fe_degree+1), n_child_cell_dofs, n_components, evaluation_data); -- 2.39.5