]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
New test that currently fails.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 26 Jun 2011 17:33:12 +0000 (17:33 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Sun, 26 Jun 2011 17:33:12 +0000 (17:33 +0000)
git-svn-id: https://svn.dealii.org/trunk@23865 0785d39b-7218-0410-832d-ea1e28bc413d

tests/mpi/solution_transfer_01.cc [new file with mode: 0644]
tests/mpi/solution_transfer_01/ncpu_10/cmp/generic [new file with mode: 0644]
tests/mpi/solution_transfer_01/ncpu_4/cmp/generic [new file with mode: 0644]

diff --git a/tests/mpi/solution_transfer_01.cc b/tests/mpi/solution_transfer_01.cc
new file mode 100644 (file)
index 0000000..b2a78f7
--- /dev/null
@@ -0,0 +1,132 @@
+//---------------------------------------------------------------------------
+//    $Id$
+//    Version: $Name$
+//
+//    Copyright (C) 2009, 2010, 2011 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.
+//
+//---------------------------------------------------------------------------
+
+
+// SolutionTransfer locks up when a process has no locally owned cells
+
+#include "../tests.h"
+#include "coarse_grid_common.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/tensor.h>
+#include <deal.II/base/function.h>
+#include <deal.II/numerics/vectors.h>
+#include <deal.II/grid/filtered_iterator.h>
+
+#include <deal.II/grid/tria.h>
+#include <deal.II/distributed/tria.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_out.h>
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/dofs/dof_tools.h>
+#include <deal.II/grid/tria_accessor.h>
+#include <deal.II/grid/tria_iterator.h>
+#include <deal.II/dofs/dof_accessor.h>
+#include <deal.II/grid/tria_boundary_lib.h>
+#include <deal.II/numerics/data_out.h>
+#include <deal.II/distributed/solution_transfer.h>
+#include <deal.II/lac/petsc_parallel_vector.h>
+
+#include <deal.II/fe/fe_q.h>
+#include <deal.II/fe/fe_system.h>
+
+#include <fstream>
+#include <sstream>
+
+
+template<int dim>
+void test()
+{
+  parallel::distributed::Triangulation<2> tria(MPI_COMM_WORLD,
+                                              typename Triangulation<2>::MeshSmoothing
+                                              (Triangulation<2>::smoothing_on_refinement |
+                                               Triangulation<2>::smoothing_on_coarsening));
+
+  GridGenerator::hyper_cube (tria,-1.0,1.0);
+
+  DoFHandler<2> dh(tria);
+  FE_Q<2> fe(1);
+
+  dh.distribute_dofs(fe);
+
+  IndexSet locally_owned_dofs = dh.locally_owned_dofs ();
+  IndexSet locally_relevant_dofs;
+
+  DoFTools::extract_locally_relevant_dofs (dh,locally_relevant_dofs);
+
+  PETScWrappers::MPI::Vector solution(MPI_COMM_WORLD,locally_owned_dofs,locally_relevant_dofs);
+  solution = 0;
+  solution.update_ghost_values();
+
+  parallel::distributed::SolutionTransfer<2,PETScWrappers::MPI::Vector> soltrans(dh);
+
+  tria.set_all_refine_flags();
+  tria.prepare_coarsening_and_refinement();
+
+  soltrans.prepare_for_coarsening_and_refinement (solution);
+
+
+  tria.execute_coarsening_and_refinement();
+
+  dh.distribute_dofs (fe);
+  locally_owned_dofs = dh.locally_owned_dofs ();
+  DoFTools::extract_locally_relevant_dofs (dh,locally_relevant_dofs);
+
+  PETScWrappers::MPI::Vector  tmp(MPI_COMM_WORLD,dh.n_dofs(),dh.n_locally_owned_dofs());
+
+  std::cout<<"I WAS HERE"<<std::endl;
+
+  soltrans.interpolate (tmp);
+
+  std::cout<<"I AM HERE"<<std::endl;
+
+  solution.reinit(MPI_COMM_WORLD,locally_owned_dofs,locally_relevant_dofs);
+  solution = tmp;
+  solution.update_ghost_values();
+}
+
+
+int main(int argc, char *argv[])
+{
+  abort ();
+  
+  PetscInitialize(&argc,&argv,0,0);
+
+
+  unsigned int myid = Utilities::System::get_this_mpi_process (MPI_COMM_WORLD);
+
+
+  deallog.push(Utilities::int_to_string(myid));
+
+  if (myid == 0)
+    {
+      std::ofstream logfile(output_file_for_mpi("solution_transfer_01").c_str());
+      deallog.attach(logfile);
+      deallog.depth_console(0);
+      deallog.threshold_double(1.e-10);
+
+      deallog.push("2d");
+      test<2>();
+      deallog.pop();
+      deallog.push("3d");
+      test<3>();
+      deallog.pop();
+    }
+  else
+    {
+      test<2>();
+      test<3>();
+    }
+
+  PetscFinalize();
+}
diff --git a/tests/mpi/solution_transfer_01/ncpu_10/cmp/generic b/tests/mpi/solution_transfer_01/ncpu_10/cmp/generic
new file mode 100644 (file)
index 0000000..8011959
--- /dev/null
@@ -0,0 +1,5 @@
+
+DEAL:0:2d::0 4
+DEAL:0:2d::2.00000
+DEAL:0:3d::0 8
+DEAL:0:3d::2.82843
diff --git a/tests/mpi/solution_transfer_01/ncpu_4/cmp/generic b/tests/mpi/solution_transfer_01/ncpu_4/cmp/generic
new file mode 100644 (file)
index 0000000..8011959
--- /dev/null
@@ -0,0 +1,5 @@
+
+DEAL:0:2d::0 4
+DEAL:0:2d::2.00000
+DEAL:0:3d::0 8
+DEAL:0:3d::2.82843

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.