From ec8e11e59a16fbc30eb6dc0e52247d3c78a4da1c Mon Sep 17 00:00:00 2001 From: heister Date: Mon, 27 May 2013 09:24:38 +0000 Subject: [PATCH] git-svn-id: https://svn.dealii.org/trunk@29634 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/mpi/trilinos_distribute_04.cc | 123 ++++++++++++++++++ .../trilinos_distribute_04/ncpu_1/cmp/generic | 2 + .../trilinos_distribute_04/ncpu_2/cmp/generic | 2 + 3 files changed, 127 insertions(+) create mode 100644 tests/mpi/trilinos_distribute_04.cc create mode 100644 tests/mpi/trilinos_distribute_04/ncpu_1/cmp/generic create mode 100644 tests/mpi/trilinos_distribute_04/ncpu_2/cmp/generic diff --git a/tests/mpi/trilinos_distribute_04.cc b/tests/mpi/trilinos_distribute_04.cc new file mode 100644 index 0000000000..8d8c04654c --- /dev/null +++ b/tests/mpi/trilinos_distribute_04.cc @@ -0,0 +1,123 @@ +//--------------------------------------------------------------------------- +// $Id: trilinos_distribute_02.cc 29593 2013-05-25 12:29:14Z bangerth $ +// Version: $Name$ +// +// Copyright (C) 2009, 2010, 2012, 2013 by the deal.II authors +// +// This file is subject to QPL and may not be distributed +// without copyright and license information. Please refer +// to the file deal.II/doc/license.html for the text and +// further information on this license. +// +//--------------------------------------------------------------------------- + + +// document bug in the new ConstraintMatrix::distribute(): +/* + + */ + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + + +template +void test() +{ + const unsigned int myid = Utilities::MPI::this_mpi_process (MPI_COMM_WORLD); + const unsigned int n_processes = Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD); + + parallel::distributed::Triangulation tr(MPI_COMM_WORLD); + + GridGenerator::hyper_cube(tr); + tr.refine_global(2); + + if (myid==0) + { + typename Triangulation::active_cell_iterator it = tr.begin_active(); + ++it;++it;++it; + for (unsigned int i=0;i<5;++i) + { + it->set_refine_flag(); + ++it; + } + } + tr.execute_coarsening_and_refinement(); + + const FE_Q fe(1); + DoFHandler dofh(tr); + dofh.distribute_dofs (fe); + + IndexSet locally_relevant_set; + DoFTools::extract_locally_relevant_dofs (dofh, + locally_relevant_set); + + ConstraintMatrix cm; + cm.reinit (locally_relevant_set); + DoFTools::make_hanging_node_constraints (dofh, cm); + + typename FunctionMap::type dirichlet_boundary; + ZeroFunction homogeneous_dirichlet_bc (1); + dirichlet_boundary[0] = &homogeneous_dirichlet_bc; + VectorTools::interpolate_boundary_values (dofh, + dirichlet_boundary, + cm); + + cm.close(); + + TrilinosWrappers::MPI::Vector vec (dofh.locally_owned_dofs(), MPI_COMM_WORLD); + for (unsigned int i=vec.local_range().first; i(); + } + else + test<2>(); + +} diff --git a/tests/mpi/trilinos_distribute_04/ncpu_1/cmp/generic b/tests/mpi/trilinos_distribute_04/ncpu_1/cmp/generic new file mode 100644 index 0000000000..be8d055f86 --- /dev/null +++ b/tests/mpi/trilinos_distribute_04/ncpu_1/cmp/generic @@ -0,0 +1,2 @@ + +DEAL:0::OK diff --git a/tests/mpi/trilinos_distribute_04/ncpu_2/cmp/generic b/tests/mpi/trilinos_distribute_04/ncpu_2/cmp/generic new file mode 100644 index 0000000000..be8d055f86 --- /dev/null +++ b/tests/mpi/trilinos_distribute_04/ncpu_2/cmp/generic @@ -0,0 +1,2 @@ + +DEAL:0::OK -- 2.39.5