From: Martin Kronbichler Date: Fri, 21 Oct 2016 14:19:27 +0000 (+0200) Subject: Re-organize adaptive MG tests with matrix-free. Avoid dependency on Trilinos if not... X-Git-Tag: v8.5.0-rc1~547^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6f19f793f52701dc3cb80691d5aa4b0766cf51dd;p=dealii.git Re-organize adaptive MG tests with matrix-free. Avoid dependency on Trilinos if not necessary. --- diff --git a/tests/matrix_free/parallel_multigrid_adaptive.cc b/tests/matrix_free/parallel_multigrid_adaptive_01.cc similarity index 100% rename from tests/matrix_free/parallel_multigrid_adaptive.cc rename to tests/matrix_free/parallel_multigrid_adaptive_01.cc diff --git a/tests/matrix_free/parallel_multigrid_adaptive.with_trilinos=true.with_mpi=true.with_p4est=true.mpirun=3.output b/tests/matrix_free/parallel_multigrid_adaptive_01.with_trilinos=true.with_mpi=true.with_p4est=true.mpirun=3.output similarity index 100% rename from tests/matrix_free/parallel_multigrid_adaptive.with_trilinos=true.with_mpi=true.with_p4est=true.mpirun=3.output rename to tests/matrix_free/parallel_multigrid_adaptive_01.with_trilinos=true.with_mpi=true.with_p4est=true.mpirun=3.output diff --git a/tests/matrix_free/parallel_multigrid_adaptive.with_trilinos=true.with_mpi=true.with_p4est=true.mpirun=7.output b/tests/matrix_free/parallel_multigrid_adaptive_01.with_trilinos=true.with_mpi=true.with_p4est=true.mpirun=7.output similarity index 100% rename from tests/matrix_free/parallel_multigrid_adaptive.with_trilinos=true.with_mpi=true.with_p4est=true.mpirun=7.output rename to tests/matrix_free/parallel_multigrid_adaptive_01.with_trilinos=true.with_mpi=true.with_p4est=true.mpirun=7.output diff --git a/tests/matrix_free/parallel_multigrid_adaptive_02.cc b/tests/matrix_free/parallel_multigrid_adaptive_02.cc index 279217ee25..03c6d6e6f1 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_02.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_02.cc @@ -15,8 +15,8 @@ -// same as parallel_multigird_adaptive, but derive from -// MatrixFreeOperators::Base class. +// same as parallel_multigird_adaptive_01, but based on MGTransferMatrixFree +// and deriving from the MatrixFreeOperators::Base class. #include "../tests.h" @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include #include @@ -54,6 +54,8 @@ template { public: + typedef number value_type; + LaplaceOperator() : MatrixFreeOperators::Base() @@ -176,14 +178,14 @@ private: -template -class MGTransferMF : public MGTransferPrebuilt > +template +class MGTransferMF : public MGTransferMatrixFree { public: MGTransferMF(const MGLevelObject &laplace, const MGConstrainedDoFs &mg_constrained_dofs) : - MGTransferPrebuilt >(mg_constrained_dofs), + MGTransferMatrixFree(mg_constrained_dofs), laplace_operator (laplace) { } @@ -193,16 +195,16 @@ public: * with MatrixFree and bypass the crude vector initialization in * MGTransferPrebuilt */ - template + template void copy_to_mg (const DoFHandler &mg_dof_handler, - MGLevelObject > &dst, + 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 >:: + MGTransferMatrixFree:: copy_to_mg(mg_dof_handler, dst, src); } @@ -343,9 +345,9 @@ void do_test (const DoFHandler &dof) for (unsigned int level=0; level mg_transfer(mg_matrices, - mg_constrained_dofs); - mg_transfer.build_matrices(dof); + MGTransferMF mg_transfer(mg_matrices, + mg_constrained_dofs); + mg_transfer.build(dof); MGCoarseIterative mg_coarse; mg_coarse.initialize(mg_matrices[0]); @@ -379,7 +381,7 @@ void do_test (const DoFHandler &dof) mg_smoother); mg.set_edge_matrices(mg_interface, mg_interface); PreconditionMG, - MGTransferMF > + MGTransferMF > preconditioner(dof, mg, mg_transfer); { diff --git a/tests/matrix_free/parallel_multigrid_adaptive_02.with_trilinos=true.with_mpi=true.with_p4est=true.mpirun=3.output b/tests/matrix_free/parallel_multigrid_adaptive_02.with_mpi=true.with_p4est=true.mpirun=3.output similarity index 100% rename from tests/matrix_free/parallel_multigrid_adaptive_02.with_trilinos=true.with_mpi=true.with_p4est=true.mpirun=3.output rename to tests/matrix_free/parallel_multigrid_adaptive_02.with_mpi=true.with_p4est=true.mpirun=3.output diff --git a/tests/matrix_free/parallel_multigrid_adaptive_02.with_trilinos=true.with_mpi=true.with_p4est=true.mpirun=7.output b/tests/matrix_free/parallel_multigrid_adaptive_02.with_mpi=true.with_p4est=true.mpirun=7.output similarity index 100% rename from tests/matrix_free/parallel_multigrid_adaptive_02.with_trilinos=true.with_mpi=true.with_p4est=true.mpirun=7.output rename to tests/matrix_free/parallel_multigrid_adaptive_02.with_mpi=true.with_p4est=true.mpirun=7.output diff --git a/tests/matrix_free/parallel_multigrid_adaptive_mf.cc b/tests/matrix_free/parallel_multigrid_adaptive_03.cc similarity index 99% rename from tests/matrix_free/parallel_multigrid_adaptive_mf.cc rename to tests/matrix_free/parallel_multigrid_adaptive_03.cc index a7493f8165..133f617b0d 100644 --- a/tests/matrix_free/parallel_multigrid_adaptive_mf.cc +++ b/tests/matrix_free/parallel_multigrid_adaptive_03.cc @@ -14,8 +14,10 @@ // --------------------------------------------------------------------- -// same test as parallel_multigrid_adaptive but using but using adaptive -// meshes with hanging nodes (doing local smoothing) +// same test as parallel_multigrid_adaptive_01 but using +// MGTransferMatrixFree rather the MGTransferPrebuilt (and manually +// implementing the full LaplaceOperator class rather than using the +// operator as in _02) #include "../tests.h" diff --git a/tests/matrix_free/parallel_multigrid_adaptive_mf.with_mpi=true.with_p4est=true.mpirun=7.output b/tests/matrix_free/parallel_multigrid_adaptive_03.with_mpi=true.with_p4est=true.mpirun=7.output similarity index 100% rename from tests/matrix_free/parallel_multigrid_adaptive_mf.with_mpi=true.with_p4est=true.mpirun=7.output rename to tests/matrix_free/parallel_multigrid_adaptive_03.with_mpi=true.with_p4est=true.mpirun=7.output