From 01c1cf6649ae3f7d2b0263ba7e5be4784bf82d97 Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Sun, 18 Sep 2022 14:10:57 +0200 Subject: [PATCH] internal::MatrixFreeFunctions::ConstraintInfo: switch data type --- include/deal.II/matrix_free/constraint_info.h | 28 +++++++-------- .../mg_transfer_global_coarsening.templates.h | 6 ++-- tests/matrix_free/constraint_info_01.cc | 36 ++++++++++++++----- 3 files changed, 45 insertions(+), 25 deletions(-) diff --git a/include/deal.II/matrix_free/constraint_info.h b/include/deal.II/matrix_free/constraint_info.h index 44a13c9f65..91c735c36f 100644 --- a/include/deal.II/matrix_free/constraint_info.h +++ b/include/deal.II/matrix_free/constraint_info.h @@ -77,13 +77,13 @@ namespace internal template void - read_write_operation(const T & operation, - VectorType & global_vector, - AlignedVector &local_vector, - const unsigned int first_cell, - const unsigned int n_cells, - const unsigned int n_dofs_per_cell, - const bool apply_constraints) const; + read_write_operation(const T & operation, + VectorType & global_vector, + Number * local_vector, + const unsigned int first_cell, + const unsigned int n_cells, + const unsigned int n_dofs_per_cell, + const bool apply_constraints) const; void apply_hanging_node_constraints( @@ -457,13 +457,13 @@ namespace internal template inline void ConstraintInfo::read_write_operation( - const T & operation, - VectorType & global_vector, - AlignedVector &local_vector, - const unsigned int first_cell, - const unsigned int n_cells, - const unsigned int n_dofs_per_cell, - const bool apply_constraints) const + const T & operation, + VectorType & global_vector, + Number * local_vector, + const unsigned int first_cell, + const unsigned int n_cells, + const unsigned int n_dofs_per_cell, + const bool apply_constraints) const { if (apply_constraints == false) { diff --git a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h index ce715bcf46..08de0842e9 100644 --- a/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h +++ b/include/deal.II/multigrid/mg_transfer_global_coarsening.templates.h @@ -2557,7 +2557,7 @@ MGTwoLevelTransfer>:: internal::VectorReader reader; constraint_info.read_write_operation(reader, *vec_coarse_ptr, - evaluation_data_coarse, + evaluation_data_coarse.data(), cell_counter, n_lanes_filled, scheme.n_dofs_per_cell_coarse, @@ -2761,7 +2761,7 @@ MGTwoLevelTransfer>:: cell_counter, n_lanes_filled, true, evaluation_data_coarse); constraint_info.read_write_operation(writer, *vec_coarse_ptr, - evaluation_data_coarse, + evaluation_data_coarse.data(), cell_counter, n_lanes_filled, scheme.n_dofs_per_cell_coarse, @@ -2894,7 +2894,7 @@ MGTwoLevelTransfer>:: internal::VectorSetter writer; constraint_info.read_write_operation(writer, *vec_coarse_ptr, - evaluation_data_coarse, + evaluation_data_coarse.data(), cell_counter, n_lanes_filled, scheme.n_dofs_per_cell_coarse, diff --git a/tests/matrix_free/constraint_info_01.cc b/tests/matrix_free/constraint_info_01.cc index 2cc5a69ec4..5047b6cc7d 100644 --- a/tests/matrix_free/constraint_info_01.cc +++ b/tests/matrix_free/constraint_info_01.cc @@ -133,8 +133,13 @@ main() const unsigned int n_cells, const unsigned int n_dofs_per_cell) { internal::VectorReader reader; - constraint_info.read_write_operation( - reader, src, local_vector, first_cell, n_cells, n_dofs_per_cell, true); + constraint_info.read_write_operation(reader, + src, + local_vector.data(), + first_cell, + n_cells, + n_dofs_per_cell, + true); constraint_info.apply_hanging_node_constraints(first_cell, n_cells, false, @@ -151,24 +156,39 @@ main() n_cells, true, local_vector); - constraint_info.read_write_operation( - writer, dst, local_vector, first_cell, n_cells, n_dofs_per_cell, true); + constraint_info.read_write_operation(writer, + dst, + local_vector.data(), + first_cell, + n_cells, + n_dofs_per_cell, + true); }; const auto read_dof_values_plain = [&](const unsigned int first_cell, const unsigned int n_cells, const unsigned int n_dofs_per_cell) { internal::VectorReader reader; - constraint_info.read_write_operation( - reader, src, local_vector, first_cell, n_cells, n_dofs_per_cell, false); + constraint_info.read_write_operation(reader, + src, + local_vector.data(), + first_cell, + n_cells, + n_dofs_per_cell, + false); }; const auto set_dof_values_plain = [&](const unsigned int first_cell, const unsigned int n_cells, const unsigned int n_dofs_per_cell) { internal::VectorSetter writer; - constraint_info.read_write_operation( - writer, dst, local_vector, first_cell, n_cells, n_dofs_per_cell, false); + constraint_info.read_write_operation(writer, + dst, + local_vector.data(), + first_cell, + n_cells, + n_dofs_per_cell, + false); }; unsigned int first_cell = 0; -- 2.39.5