From eaf3316152b192511634f601d3f9bd70a2a6b2bb Mon Sep 17 00:00:00 2001 From: young Date: Sat, 19 Oct 2013 19:08:07 +0000 Subject: [PATCH] Test print a complex vector. git-svn-id: https://svn.dealii.org/branches/branch_petscscalar_complex@31322 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/petsc_scalar_complex/vector_print.cc | 77 +++++++++++++++++++ tests/petsc_scalar_complex/vector_print/cmp/+ | 10 +++ .../vector_print/cmp/generic | 10 +++ 3 files changed, 97 insertions(+) create mode 100644 tests/petsc_scalar_complex/vector_print.cc create mode 100644 tests/petsc_scalar_complex/vector_print/cmp/+ create mode 100644 tests/petsc_scalar_complex/vector_print/cmp/generic diff --git a/tests/petsc_scalar_complex/vector_print.cc b/tests/petsc_scalar_complex/vector_print.cc new file mode 100644 index 0000000000..a2d793b474 --- /dev/null +++ b/tests/petsc_scalar_complex/vector_print.cc @@ -0,0 +1,77 @@ +// --------------------------------------------------------------------- +// $Id: vector_print.cc +// +// Copyright (C) 2013 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. +// +// --------------------------------------------------------------------- + + + +// verify that VectorBase::print uses the precision parameter correctly and +// restores the previous value of the stream precision + +#include "../tests.h" +#include +#include +#include +#include + + +int main (int argc, char **argv) +{ + std::ofstream logfile("vector_print/output"); + deallog.attach(logfile); + deallog.depth_console(0); + deallog.threshold_double(1.e-10); + + try + { + Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); + { + PETScWrappers::Vector v (5); + for (unsigned int k=0; k