From: heister Date: Fri, 25 Apr 2014 20:47:39 +0000 (+0000) Subject: add test X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46ea3e460cbecfb45b10b107043cdb3d665e4b9d;p=dealii-svn.git add test git-svn-id: https://svn.dealii.org/branches/branch_sharedtria@32832 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/sharedtria/tria_01.cc b/tests/sharedtria/tria_01.cc new file mode 100644 index 0000000000..017902b7ee --- /dev/null +++ b/tests/sharedtria/tria_01.cc @@ -0,0 +1,103 @@ +// --------------------------------------------------------------------- +// $Id: 3d_refinement_01.cc 31349 2013-10-20 19:07:06Z maier $ +// +// Copyright (C) 2008 - 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. +// +// --------------------------------------------------------------------- + + +// create a shared tria mesh and refine it + + +#include "../tests.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +template +void write_mesh (const parallel::shared::Triangulation &tria, + const char *filename_) +{ + DataOut data_out; + data_out.attach_triangulation (tria); + Vector subdomain (tria.n_active_cells()); + for (unsigned int i=0; i +void test() +{ + parallel::shared::Triangulation tr(MPI_COMM_WORLD); + + + GridGenerator::hyper_cube(tr); + tr.begin_active()->set_refine_flag(); + tr.execute_coarsening_and_refinement (); + if (tr.locally_owned_subdomain()==0) + tr.begin_active()->set_refine_flag(); + tr.execute_coarsening_and_refinement (); + + deallog + << " locally_owned_subdomain(): " << tr.locally_owned_subdomain() << "\n" + << " n_active_cells: " << tr.n_active_cells() << "\n" + << " n_levels: " << tr.n_levels() << "\n" + << " n_global_levels: " << tr.n_global_levels() << "\n" + //<< " n_locally_owned_active_cells: " << tr.n_locally_owned_active_cells() << "\n" + //<< " n_global_active_cells: " << tr.n_global_active_cells() << "\n" + << std::endl; + + /*deallog << "n_locally_owned_active_cells_per_processor: "; + std::vector v = tr.n_locally_owned_active_cells_per_processor(); + for (unsigned int i=0;i(); + deallog.pop(); + deallog.push("3d"); + //test<3>(); + deallog.pop(); +} diff --git a/tests/sharedtria/tria_01.mpirun=3.output b/tests/sharedtria/tria_01.mpirun=3.output new file mode 100644 index 0000000000..2fd09c50a7 --- /dev/null +++ b/tests/sharedtria/tria_01.mpirun=3.output @@ -0,0 +1,20 @@ + +DEAL:0:2d:: locally_owned_subdomain(): 0 + n_active_cells: 7 + n_levels: 3 + n_global_levels: 3 + + +DEAL:1:2d:: locally_owned_subdomain(): 1 + n_active_cells: 4 + n_levels: 2 + n_global_levels: 2 + + + +DEAL:2:2d:: locally_owned_subdomain(): 2 + n_active_cells: 4 + n_levels: 2 + n_global_levels: 2 + + diff --git a/tests/sharedtria/tria_01.output b/tests/sharedtria/tria_01.output new file mode 100644 index 0000000000..132c2cf2c4 --- /dev/null +++ b/tests/sharedtria/tria_01.output @@ -0,0 +1,6 @@ + +DEAL:0:2d:: locally_owned_subdomain(): 0 + n_active_cells: 7 + n_levels: 3 + n_global_levels: 3 +