From ce575dab4b3e73013a4d381b84e2b5b5c601b538 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Wed, 25 Apr 2018 00:33:13 +0200 Subject: [PATCH] Instantiate distribute_local_to_global for another combination of PETScWrapper objects --- source/lac/constraint_matrix.cc | 1 + tests/petsc_complex/assemble_01.cc | 69 +++++++++++++++++++ .../assemble_01.with_mpi=true.mpirun=1.output | 33 +++++++++ 3 files changed, 103 insertions(+) create mode 100644 tests/petsc_complex/assemble_01.cc create mode 100644 tests/petsc_complex/assemble_01.with_mpi=true.mpirun=1.output diff --git a/source/lac/constraint_matrix.cc b/source/lac/constraint_matrix.cc index d429071745..60f5876caa 100644 --- a/source/lac/constraint_matrix.cc +++ b/source/lac/constraint_matrix.cc @@ -1383,6 +1383,7 @@ MATRIX_FUNCTIONS(PETScWrappers::SparseMatrix,PetscScalar); MATRIX_FUNCTIONS(PETScWrappers::MPI::SparseMatrix,PetscScalar); BLOCK_MATRIX_FUNCTIONS(PETScWrappers::MPI::BlockSparseMatrix); MATRIX_VECTOR_FUNCTIONS(PETScWrappers::MPI::SparseMatrix, PETScWrappers::MPI::Vector); +MATRIX_VECTOR_FUNCTIONS(PETScWrappers::SparseMatrix, PETScWrappers::MPI::Vector); BLOCK_MATRIX_VECTOR_FUNCTIONS(PETScWrappers::MPI::BlockSparseMatrix,PETScWrappers::MPI::BlockVector); #endif diff --git a/tests/petsc_complex/assemble_01.cc b/tests/petsc_complex/assemble_01.cc new file mode 100644 index 0000000000..bcb1987320 --- /dev/null +++ b/tests/petsc_complex/assemble_01.cc @@ -0,0 +1,69 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2018 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE at +// the top level of the deal.II distribution. +// +// --------------------------------------------------------------------- + + +// Check that all the functionality needed for calling +// ConstraintMatrix::distribute_local_to_global on mutiple combinations of +// PETScWrappers objects is correctly instantiated and works. + +#include +#include +#include +#include +#include +#include + +#include "../tests.h" + + +int main (int argc,char **argv) +{ + Utilities::MPI::MPI_InitFinalize mpi_initialization (argc, argv, 1); + mpi_initlog(); + + const unsigned int n=4; + + PETScWrappers::SparseMatrix serial_matrix (n,n,n); + PETScWrappers::MPI::SparseMatrix mpi_matrix (MPI_COMM_WORLD,n,n,n,n,n); + PETScWrappers::MPI::Vector mpi_vector (MPI_COMM_WORLD,n,n); + + FullMatrix cell_matrix (n, n); + Vector cell_rhs (n); + + ConstraintMatrix constraints; + constraints.close(); + + std::vector gdi(n); + std::iota(gdi.begin(), gdi.end(), 0); + std::iota(cell_rhs.begin(), cell_rhs.end(), 0); + + for (unsigned int i=0; i