From: Martin Kronbichler Date: Fri, 8 Nov 2024 11:51:24 +0000 (+0100) Subject: Use simpler initialization of partitioner X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0a07e72237be7725ff5b0b6b327e2cc355fd2943;p=dealii.git Use simpler initialization of partitioner --- diff --git a/examples/step-59/step-59.cc b/examples/step-59/step-59.cc index adb743c2c3..3132433e92 100644 --- a/examples/step-59/step-59.cc +++ b/examples/step-59/step-59.cc @@ -178,6 +178,9 @@ namespace Step59 std::shared_ptr> get_matrix_free() const; + std::shared_ptr + get_vector_partitioner() const; + void vmult(LinearAlgebra::distributed::Vector &dst, const LinearAlgebra::distributed::Vector &src) const; @@ -282,6 +285,15 @@ namespace Step59 + template + std::shared_ptr + LaplaceOperator::get_vector_partitioner() const + { + return data->get_dof_info().vector_partitioner; + } + + + template void LaplaceOperator::initialize_dof_vector( LinearAlgebra::distributed::Vector &vec) const @@ -1165,11 +1177,8 @@ namespace Step59 std::vector> partitioners(dof_handler.get_triangulation().n_global_levels()); for (unsigned int level = 0; level < partitioners.size(); ++level) - { - LinearAlgebra::distributed::Vector vec; - mg_matrices[level].initialize_dof_vector(vec); - partitioners[level] = vec.get_partitioner(); - } + partitioners[level] = mg_matrices[level].get_vector_partitioner(); + mg_transfer.build(dof_handler, partitioners); setup_time += time.wall_time(); time_details << "MG build transfer time " << time.wall_time()