From: Daniel Arndt Date: Mon, 4 Jun 2018 16:38:05 +0000 (+0200) Subject: Deprecate parallel::distributed::Vector X-Git-Tag: v9.1.0-rc1~1069^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6710%2Fhead;p=dealii.git Deprecate parallel::distributed::Vector --- diff --git a/include/deal.II/fe/fe_tools.h b/include/deal.II/fe/fe_tools.h index f1c5362842..a99b256ef8 100644 --- a/include/deal.II/fe/fe_tools.h +++ b/include/deal.II/fe/fe_tools.h @@ -31,7 +31,7 @@ #include -#include +#include #include #include diff --git a/include/deal.II/lac/parallel_block_vector.h b/include/deal.II/lac/parallel_block_vector.h index 4d3d27f79e..b85769488c 100644 --- a/include/deal.II/lac/parallel_block_vector.h +++ b/include/deal.II/lac/parallel_block_vector.h @@ -50,8 +50,12 @@ namespace parallel * @see * @ref GlossBlockLA "Block (linear algebra)" * @author Katharina Kormann, Martin Kronbichler, 2011 + * + * @deprecated Use LinearAlgebra::distributed::BlockVector instead. */ - using LinearAlgebra::distributed::BlockVector; + template + using BlockVector DEAL_II_DEPRECATED = + LinearAlgebra::distributed::BlockVector; /*@}*/ } // namespace distributed diff --git a/include/deal.II/lac/parallel_vector.h b/include/deal.II/lac/parallel_vector.h index 58bb3bd68a..738542b50e 100644 --- a/include/deal.II/lac/parallel_vector.h +++ b/include/deal.II/lac/parallel_vector.h @@ -137,8 +137,12 @@ namespace parallel * not rely on this class to automatically detect the unsupported case. * * @author Katharina Kormann, Martin Kronbichler, 2010, 2011 + * + * @deprecated Use LinearAlgebra::distributed::Vector instead. */ - using LinearAlgebra::distributed::Vector; + template + using Vector DEAL_II_DEPRECATED = + LinearAlgebra::distributed::Vector; /*@}*/ } // namespace distributed diff --git a/source/fe/mapping_fe_field.cc b/source/fe/mapping_fe_field.cc index 2940fa1b07..bccf71a87e 100644 --- a/source/fe/mapping_fe_field.cc +++ b/source/fe/mapping_fe_field.cc @@ -38,9 +38,9 @@ #include #include +#include +#include #include -#include -#include #include #include #include diff --git a/source/fe/mapping_q_eulerian.cc b/source/fe/mapping_q_eulerian.cc index 42c2754752..9aa26d11a7 100644 --- a/source/fe/mapping_q_eulerian.cc +++ b/source/fe/mapping_q_eulerian.cc @@ -28,9 +28,9 @@ #include #include +#include +#include #include -#include -#include #include #include #include diff --git a/tests/matrix_free/compare_faces_by_cells.cc b/tests/matrix_free/compare_faces_by_cells.cc index 4f2fb328c0..01f88b05a5 100644 --- a/tests/matrix_free/compare_faces_by_cells.cc +++ b/tests/matrix_free/compare_faces_by_cells.cc @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include @@ -78,7 +78,8 @@ public: } void - compute_diagonal_by_face(parallel::distributed::Vector &result) const + compute_diagonal_by_face( + LinearAlgebra::distributed::Vector &result) const { int dummy; result = 0; @@ -91,7 +92,8 @@ public: } void - compute_diagonal_by_cell(parallel::distributed::Vector &result) const + compute_diagonal_by_cell( + LinearAlgebra::distributed::Vector &result) const { int dummy; result.zero_out_ghosts(); @@ -100,7 +102,8 @@ public: } void - initialize_dof_vector(parallel::distributed::Vector &vector) const + initialize_dof_vector( + LinearAlgebra::distributed::Vector &vector) const { data.initialize_dof_vector(vector); } @@ -109,15 +112,15 @@ public: private: void local_diagonal_dummy(const MatrixFree &, - parallel::distributed::Vector &, + LinearAlgebra::distributed::Vector &, const int &, const std::pair &) const {} void local_diagonal_face( - const MatrixFree & data, - parallel::distributed::Vector &dst, + const MatrixFree & data, + LinearAlgebra::distributed::Vector &dst, const int &, const std::pair &face_range) const { @@ -207,8 +210,8 @@ private: void local_diagonal_boundary( - const MatrixFree & data, - parallel::distributed::Vector &dst, + const MatrixFree & data, + LinearAlgebra::distributed::Vector &dst, const int &, const std::pair &face_range) const { @@ -251,8 +254,8 @@ private: void local_diagonal_by_cell( - const MatrixFree & data, - parallel::distributed::Vector &dst, + const MatrixFree & data, + LinearAlgebra::distributed::Vector &dst, const int &, const std::pair &cell_range) const { @@ -339,7 +342,7 @@ test() LaplaceOperator fine_matrix; fine_matrix.initialize(mapping, dof); - parallel::distributed::Vector res1, res2; + LinearAlgebra::distributed::Vector res1, res2; fine_matrix.initialize_dof_vector(res1); fine_matrix.initialize_dof_vector(res2); @@ -356,7 +359,7 @@ test() LaplaceOperator fine_matrix; fine_matrix.initialize(mapping, dof, level); - parallel::distributed::Vector res1, res2; + LinearAlgebra::distributed::Vector res1, res2; fine_matrix.initialize_dof_vector(res1); fine_matrix.initialize_dof_vector(res2); diff --git a/tests/matrix_free/matrix_vector_20.cc b/tests/matrix_free/matrix_vector_20.cc index 9fa2315576..44ba82be72 100644 --- a/tests/matrix_free/matrix_vector_20.cc +++ b/tests/matrix_free/matrix_vector_20.cc @@ -35,8 +35,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -52,10 +52,10 @@ template void -helmholtz_operator(const MatrixFree & data, - parallel::distributed::BlockVector & dst, - const parallel::distributed::BlockVector &src, - const std::pair & cell_range) +helmholtz_operator(const MatrixFree & data, + LinearAlgebra::distributed::BlockVector & dst, + const LinearAlgebra::distributed::BlockVector &src, + const std::pair &cell_range) { FEEvaluation phi0(data); FEEvaluation phi1(data); @@ -99,15 +99,16 @@ public: MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; void - vmult(parallel::distributed::BlockVector & dst, - const parallel::distributed::BlockVector &src) const + vmult(LinearAlgebra::distributed::BlockVector & dst, + const LinearAlgebra::distributed::BlockVector &src) const { for (unsigned int i = 0; i < dst.size(); ++i) dst[i] = 0; - const std::function &, - parallel::distributed::BlockVector &, - const parallel::distributed::BlockVector &, - const std::pair &)> + const std::function &, + LinearAlgebra::distributed::BlockVector &, + const LinearAlgebra::distributed::BlockVector &, + const std::pair &)> wrap = helmholtz_operator; data.cell_loop(wrap, dst, src); }; @@ -178,9 +179,9 @@ test() mf_data.reinit(dof, constraints, quad, data); } - MatrixFreeTest mf(mf_data); - parallel::distributed::Vector ref; - parallel::distributed::BlockVector in(2), out(2); + MatrixFreeTest mf(mf_data); + LinearAlgebra::distributed::Vector ref; + LinearAlgebra::distributed::BlockVector in(2), out(2); for (unsigned int i = 0; i < 2; ++i) { mf_data.initialize_dof_vector(in.block(i)); diff --git a/tests/matrix_free/matrix_vector_21.cc b/tests/matrix_free/matrix_vector_21.cc index 28ac6d8842..e43085c570 100644 --- a/tests/matrix_free/matrix_vector_21.cc +++ b/tests/matrix_free/matrix_vector_21.cc @@ -35,8 +35,8 @@ #include #include -#include -#include +#include +#include #include #include @@ -52,10 +52,10 @@ template void -helmholtz_operator(const MatrixFree & data, - parallel::distributed::BlockVector & dst, - const parallel::distributed::BlockVector &src, - const std::pair & cell_range) +helmholtz_operator(const MatrixFree & data, + LinearAlgebra::distributed::BlockVector & dst, + const LinearAlgebra::distributed::BlockVector &src, + const std::pair &cell_range) { FEEvaluation fe_eval(data); const unsigned int n_q_points = fe_eval.n_q_points; @@ -90,15 +90,16 @@ public: MatrixFreeTest(const MatrixFree &data_in) : data(data_in){}; void - vmult(parallel::distributed::BlockVector & dst, - const parallel::distributed::BlockVector &src) const + vmult(LinearAlgebra::distributed::BlockVector & dst, + const LinearAlgebra::distributed::BlockVector &src) const { for (unsigned int i = 0; i < dst.size(); ++i) dst[i] = 0; - const std::function &, - parallel::distributed::BlockVector &, - const parallel::distributed::BlockVector &, - const std::pair &)> + const std::function &, + LinearAlgebra::distributed::BlockVector &, + const LinearAlgebra::distributed::BlockVector &, + const std::pair &)> wrap = helmholtz_operator; data.cell_loop(wrap, dst, src); }; @@ -169,9 +170,9 @@ test() mf_data.reinit(dof, constraints, quad, data); } - MatrixFreeTest mf(mf_data); - parallel::distributed::Vector ref; - parallel::distributed::BlockVector in(2), out(2); + MatrixFreeTest mf(mf_data); + LinearAlgebra::distributed::Vector ref; + LinearAlgebra::distributed::BlockVector in(2), out(2); for (unsigned int i = 0; i < 2; ++i) { mf_data.initialize_dof_vector(in.block(i)); diff --git a/tests/matrix_free/multigrid_dg_periodic.cc b/tests/matrix_free/multigrid_dg_periodic.cc index 28661d0506..6d9bff9e00 100644 --- a/tests/matrix_free/multigrid_dg_periodic.cc +++ b/tests/matrix_free/multigrid_dg_periodic.cc @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include @@ -91,31 +91,31 @@ public: } void - vmult(parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src) const + vmult(LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src) const { dst = 0; vmult_add(dst, src); } void - Tvmult(parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src) const + Tvmult(LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src) const { dst = 0; vmult_add(dst, src); } void - Tvmult_add(parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src) const + Tvmult_add(LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src) const { vmult_add(dst, src); } void - vmult_add(parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src) const + vmult_add(LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src) const { Assert(src.partitioners_are_globally_compatible( *data.get_dof_info(0).vector_partitioner), @@ -152,14 +152,15 @@ public: } void - initialize_dof_vector(parallel::distributed::Vector &vector) const + initialize_dof_vector( + LinearAlgebra::distributed::Vector &vector) const { if (!vector.partitioners_are_compatible( *data.get_dof_info(0).vector_partitioner)) data.initialize_dof_vector(vector); } - const parallel::distributed::Vector & + const LinearAlgebra::distributed::Vector & get_matrix_diagonal_inverse() const { return inverse_diagonal_entries; @@ -168,9 +169,9 @@ public: private: void - local_apply(const MatrixFree & data, - parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src, + local_apply(const MatrixFree & data, + LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src, const std::pair &cell_range) const { FEEvaluation phi(data); @@ -189,10 +190,10 @@ private: void local_apply_face( - const MatrixFree & data, - parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src, - const std::pair &face_range) const + const MatrixFree & data, + LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src, + const std::pair & face_range) const { FEFaceEvaluation fe_eval(data, true); @@ -238,10 +239,10 @@ private: void local_apply_boundary( - const MatrixFree & data, - parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src, - const std::pair &face_range) const + const MatrixFree & data, + LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src, + const std::pair & face_range) const { FEFaceEvaluation fe_eval(data, true); @@ -292,8 +293,8 @@ private: void local_diagonal_cell( - const MatrixFree & data, - parallel::distributed::Vector &dst, + const MatrixFree & data, + LinearAlgebra::distributed::Vector &dst, const unsigned int &, const std::pair &cell_range) const { @@ -323,8 +324,8 @@ private: void local_diagonal_face( - const MatrixFree & data, - parallel::distributed::Vector &dst, + const MatrixFree & data, + LinearAlgebra::distributed::Vector &dst, const unsigned int &, const std::pair &face_range) const { @@ -409,8 +410,8 @@ private: void local_diagonal_boundary( - const MatrixFree & data, - parallel::distributed::Vector &dst, + const MatrixFree & data, + LinearAlgebra::distributed::Vector &dst, const unsigned int &, const std::pair &face_range) const { @@ -453,15 +454,15 @@ private: } - MatrixFree data; - parallel::distributed::Vector inverse_diagonal_entries; + MatrixFree data; + LinearAlgebra::distributed::Vector inverse_diagonal_entries; }; template class MGCoarseIterative - : public MGCoarseGridBase> + : public MGCoarseGridBase> { public: MGCoarseIterative() @@ -475,11 +476,11 @@ public: virtual void operator()(const unsigned int, - parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src) const + LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src) const { ReductionControl solver_control(1e4, 1e-50, 1e-7, false, false); - SolverCG> solver_coarse( + SolverCG> solver_coarse( solver_control); solver_coarse.solve(*coarse_matrix, dst, src, PreconditionIdentity()); } @@ -492,7 +493,7 @@ public: template class MGTransferMF : public MGTransferPrebuilt< - parallel::distributed::Vector> + LinearAlgebra::distributed::Vector> { public: MGTransferMF(const MGLevelObject &laplace) : @@ -503,16 +504,15 @@ public: */ template void - copy_to_mg( - const DoFHandler &mg_dof, - MGLevelObject< - parallel::distributed::Vector> &dst, - const InVector &src) const + copy_to_mg(const DoFHandler & mg_dof, + MGLevelObject> &dst, + const InVector & src) const { for (unsigned int level = dst.min_level(); level <= dst.max_level(); ++level) laplace_operator[level].initialize_dof_vector(dst[level]); - MGTransferPrebuilt>::copy_to_mg(mg_dof, dst, src); } @@ -534,7 +534,7 @@ do_test(const DoFHandler &dof) LaplaceOperator fine_matrix; fine_matrix.initialize(mapping, dof); - parallel::distributed::Vector in, sol; + LinearAlgebra::distributed::Vector in, sol; fine_matrix.initialize_dof_vector(in); fine_matrix.initialize_dof_vector(sol); @@ -556,11 +556,11 @@ do_test(const DoFHandler &dof) mg_coarse.initialize(mg_matrices[0]); typedef PreconditionChebyshev> + LinearAlgebra::distributed::Vector> SMOOTHER; MGSmootherPrecondition> + LinearAlgebra::distributed::Vector> mg_smoother; MGLevelObject smoother_data; @@ -580,18 +580,18 @@ do_test(const DoFHandler &dof) MGTransferMF mg_transfer(mg_matrices); mg_transfer.build_matrices(dof); - mg::Matrix> mg_matrix(mg_matrices); + mg::Matrix> mg_matrix(mg_matrices); - Multigrid> mg( + Multigrid> mg( dof, mg_matrix, mg_coarse, mg_transfer, mg_smoother, mg_smoother); PreconditionMG, + LinearAlgebra::distributed::Vector, MGTransferMF> preconditioner(dof, mg, mg_transfer); { - ReductionControl control(30, 1e-20, 1e-10); - SolverCG> solver(control); + ReductionControl control(30, 1e-20, 1e-10); + SolverCG> solver(control); solver.solve(fine_matrix, sol, in, preconditioner); } } diff --git a/tests/matrix_free/multigrid_dg_sip_01.cc b/tests/matrix_free/multigrid_dg_sip_01.cc index 67fa126854..674affc09b 100644 --- a/tests/matrix_free/multigrid_dg_sip_01.cc +++ b/tests/matrix_free/multigrid_dg_sip_01.cc @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include @@ -90,44 +90,45 @@ public: } void - vmult(parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src) const + vmult(LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src) const { dst = 0; vmult_add(dst, src); } void - Tvmult(parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src) const + Tvmult(LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src) const { dst = 0; vmult_add(dst, src); } void - Tvmult_add(parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src) const + Tvmult_add(LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src) const { vmult_add(dst, src); } void - vmult_add(parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src) const + vmult_add(LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src) const { if (!src.partitioners_are_globally_compatible( *data.get_dof_info(0).vector_partitioner)) { - parallel::distributed::Vector src_copy; + LinearAlgebra::distributed::Vector src_copy; src_copy.reinit(data.get_dof_info().vector_partitioner); src_copy = src; - const_cast &>(src).swap(src_copy); + const_cast &>(src).swap( + src_copy); } if (!dst.partitioners_are_globally_compatible( *data.get_dof_info(0).vector_partitioner)) { - parallel::distributed::Vector dst_copy; + LinearAlgebra::distributed::Vector dst_copy; dst_copy.reinit(data.get_dof_info().vector_partitioner); dst_copy = dst; dst.swap(dst_copy); @@ -162,12 +163,13 @@ public: } void - initialize_dof_vector(parallel::distributed::Vector &vector) const + initialize_dof_vector( + LinearAlgebra::distributed::Vector &vector) const { data.initialize_dof_vector(vector); } - const parallel::distributed::Vector & + const LinearAlgebra::distributed::Vector & get_matrix_diagonal_inverse() const { return inverse_diagonal_entries; @@ -176,9 +178,9 @@ public: private: void - local_apply(const MatrixFree & data, - parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src, + local_apply(const MatrixFree & data, + LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src, const std::pair &cell_range) const { FEEvaluation phi(data); @@ -197,10 +199,10 @@ private: void local_apply_face( - const MatrixFree & data, - parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src, - const std::pair &face_range) const + const MatrixFree & data, + LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src, + const std::pair & face_range) const { FEFaceEvaluation fe_eval(data, true); @@ -246,10 +248,10 @@ private: void local_apply_boundary( - const MatrixFree & data, - parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src, - const std::pair &face_range) const + const MatrixFree & data, + LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src, + const std::pair & face_range) const { FEFaceEvaluation fe_eval(data, true); @@ -298,8 +300,8 @@ private: void local_diagonal_cell( - const MatrixFree & data, - parallel::distributed::Vector &dst, + const MatrixFree & data, + LinearAlgebra::distributed::Vector &dst, const unsigned int &, const std::pair &cell_range) const { @@ -329,8 +331,8 @@ private: void local_diagonal_face( - const MatrixFree & data, - parallel::distributed::Vector &dst, + const MatrixFree & data, + LinearAlgebra::distributed::Vector &dst, const unsigned int &, const std::pair &face_range) const { @@ -415,8 +417,8 @@ private: void local_diagonal_boundary( - const MatrixFree & data, - parallel::distributed::Vector &dst, + const MatrixFree & data, + LinearAlgebra::distributed::Vector &dst, const unsigned int &, const std::pair &face_range) const { @@ -459,15 +461,15 @@ private: } - MatrixFree data; - parallel::distributed::Vector inverse_diagonal_entries; + MatrixFree data; + LinearAlgebra::distributed::Vector inverse_diagonal_entries; }; template class MGCoarseIterative - : public MGCoarseGridBase> + : public MGCoarseGridBase> { public: MGCoarseIterative() @@ -481,11 +483,11 @@ public: virtual void operator()(const unsigned int, - parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src) const + LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src) const { ReductionControl solver_control(1e4, 1e-50, 1e-10, false, false); - SolverCG> solver_coarse( + SolverCG> solver_coarse( solver_control); solver_coarse.solve(*coarse_matrix, dst, src, PreconditionIdentity()); } @@ -541,7 +543,7 @@ do_test(const DoFHandler &dof, const bool also_test_parallel = false) LaplaceOperator fine_matrix; fine_matrix.initialize(mapping, dof); - parallel::distributed::Vector in, sol; + LinearAlgebra::distributed::Vector in, sol; fine_matrix.initialize_dof_vector(in); fine_matrix.initialize_dof_vector(sol); @@ -564,11 +566,11 @@ do_test(const DoFHandler &dof, const bool also_test_parallel = false) mg_coarse.initialize(mg_matrices[0]); typedef PreconditionChebyshev> + LinearAlgebra::distributed::Vector> SMOOTHER; MGSmootherPrecondition> + LinearAlgebra::distributed::Vector> mg_smoother; MGLevelObject smoother_data; @@ -595,18 +597,18 @@ do_test(const DoFHandler &dof, const bool also_test_parallel = false) mg_constrained_dofs); mg_transfer.build(dof); - mg::Matrix> mg_matrix(mg_matrices); + mg::Matrix> mg_matrix(mg_matrices); - Multigrid> mg( + Multigrid> mg( dof, mg_matrix, mg_coarse, mg_transfer, mg_smoother, mg_smoother); PreconditionMG, + LinearAlgebra::distributed::Vector, MGTransferMF> preconditioner(dof, mg, mg_transfer); { - ReductionControl control(30, 1e-20, 1e-7); - SolverCG> solver(control); + ReductionControl control(30, 1e-20, 1e-7); + SolverCG> solver(control); solver.solve(fine_matrix, sol, in, preconditioner); } } diff --git a/tests/matrix_free/multigrid_dg_sip_02.cc b/tests/matrix_free/multigrid_dg_sip_02.cc index fde9a7361c..6cacc9d79e 100644 --- a/tests/matrix_free/multigrid_dg_sip_02.cc +++ b/tests/matrix_free/multigrid_dg_sip_02.cc @@ -36,7 +36,7 @@ #include #include -#include +#include #include #include @@ -93,44 +93,45 @@ public: } void - vmult(parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src) const + vmult(LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src) const { dst = 0; vmult_add(dst, src); } void - Tvmult(parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src) const + Tvmult(LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src) const { dst = 0; vmult_add(dst, src); } void - Tvmult_add(parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src) const + Tvmult_add(LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src) const { vmult_add(dst, src); } void - vmult_add(parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src) const + vmult_add(LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src) const { if (!src.partitioners_are_globally_compatible( *data.get_dof_info(0).vector_partitioner)) { - parallel::distributed::Vector src_copy; + LinearAlgebra::distributed::Vector src_copy; src_copy.reinit(data.get_dof_info().vector_partitioner); src_copy = src; - const_cast &>(src).swap(src_copy); + const_cast &>(src).swap( + src_copy); } if (!dst.partitioners_are_globally_compatible( *data.get_dof_info(0).vector_partitioner)) { - parallel::distributed::Vector dst_copy; + LinearAlgebra::distributed::Vector dst_copy; dst_copy.reinit(data.get_dof_info().vector_partitioner); dst_copy = dst; dst.swap(dst_copy); @@ -165,12 +166,13 @@ public: } void - initialize_dof_vector(parallel::distributed::Vector &vector) const + initialize_dof_vector( + LinearAlgebra::distributed::Vector &vector) const { data.initialize_dof_vector(vector); } - const parallel::distributed::Vector & + const LinearAlgebra::distributed::Vector & get_matrix_diagonal_inverse() const { return inverse_diagonal_entries; @@ -179,9 +181,9 @@ public: private: void - local_apply(const MatrixFree & data, - parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src, + local_apply(const MatrixFree & data, + LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src, const std::pair &cell_range) const { FEEvaluation phi(data); @@ -200,10 +202,10 @@ private: void local_apply_face( - const MatrixFree & data, - parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src, - const std::pair &face_range) const + const MatrixFree & data, + LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src, + const std::pair & face_range) const { FEFaceEvaluation fe_eval(data, true); @@ -249,10 +251,10 @@ private: void local_apply_boundary( - const MatrixFree & data, - parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src, - const std::pair &face_range) const + const MatrixFree & data, + LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src, + const std::pair & face_range) const { FEFaceEvaluation fe_eval(data, true); @@ -299,8 +301,8 @@ private: void local_diagonal_cell( - const MatrixFree & data, - parallel::distributed::Vector &dst, + const MatrixFree & data, + LinearAlgebra::distributed::Vector &dst, const unsigned int &, const std::pair &cell_range) const { @@ -371,15 +373,15 @@ private: } } - MatrixFree data; - parallel::distributed::Vector inverse_diagonal_entries; + MatrixFree data; + LinearAlgebra::distributed::Vector inverse_diagonal_entries; }; template class MGCoarseIterative - : public MGCoarseGridBase> + : public MGCoarseGridBase> { public: MGCoarseIterative() @@ -393,11 +395,11 @@ public: virtual void operator()(const unsigned int, - parallel::distributed::Vector & dst, - const parallel::distributed::Vector &src) const + LinearAlgebra::distributed::Vector & dst, + const LinearAlgebra::distributed::Vector &src) const { ReductionControl solver_control(1e4, 1e-50, 1e-10, false, false); - SolverCG> solver_coarse( + SolverCG> solver_coarse( solver_control); solver_coarse.solve(*coarse_matrix, dst, src, PreconditionIdentity()); } @@ -453,7 +455,7 @@ do_test(const DoFHandler &dof, const bool also_test_parallel = false) LaplaceOperator fine_matrix; fine_matrix.initialize(mapping, dof); - parallel::distributed::Vector in, sol; + LinearAlgebra::distributed::Vector in, sol; fine_matrix.initialize_dof_vector(in); fine_matrix.initialize_dof_vector(sol); @@ -476,11 +478,11 @@ do_test(const DoFHandler &dof, const bool also_test_parallel = false) mg_coarse.initialize(mg_matrices[0]); typedef PreconditionChebyshev> + LinearAlgebra::distributed::Vector> SMOOTHER; MGSmootherPrecondition> + LinearAlgebra::distributed::Vector> mg_smoother; MGLevelObject smoother_data; @@ -507,18 +509,18 @@ do_test(const DoFHandler &dof, const bool also_test_parallel = false) mg_constrained_dofs); mg_transfer.build(dof); - mg::Matrix> mg_matrix(mg_matrices); + mg::Matrix> mg_matrix(mg_matrices); - Multigrid> mg( + Multigrid> mg( dof, mg_matrix, mg_coarse, mg_transfer, mg_smoother, mg_smoother); PreconditionMG, + LinearAlgebra::distributed::Vector, MGTransferMF> preconditioner(dof, mg, mg_transfer); { - ReductionControl control(30, 1e-20, 1e-7); - SolverCG> solver(control); + ReductionControl control(30, 1e-20, 1e-7); + SolverCG> solver(control); solver.solve(fine_matrix, sol, in, preconditioner); } }