From: Daniel Arndt Date: Tue, 24 Apr 2018 22:33:13 +0000 (+0200) Subject: Instantiate distribute_local_to_global for another combination of PETScWrapper objects X-Git-Tag: v9.0.0-rc1~119^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F6322%2Fhead;p=dealii.git Instantiate distribute_local_to_global for another combination of PETScWrapper objects --- 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