cell->clear_refine_flag ();
cell->clear_coarsen_flag ();
}
+ else
+ // if this is a cell we do
+ // own, make sure they are
+ // not refined
+ // anisotropically since we
+ // don't support this
+ if (cell->refine_flag_set())
+ Assert (cell->refine_flag_set() ==
+ RefinementPossibilities<dim>::isotropic_refinement,
+ ExcMessage ("This class does not support anisotropic refinement"));
--- /dev/null
+//---------------------------------------------------------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2008, 2009, 2010 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.
+//
+//---------------------------------------------------------------------------
+
+
+// Test that anisotropic refinement really doesn't work
+
+#include "../tests.h"
+#include "coarse_grid_common.h"
+#include <base/logstream.h>
+#include <base/tensor.h>
+#include <grid/tria.h>
+#include <distributed/tria.h>
+#include <grid/tria_accessor.h>
+#include <grid/tria_iterator.h>
+#include <grid/grid_generator.h>
+#include <grid/grid_out.h>
+
+#include <fstream>
+
+
+template<int dim>
+void test(std::ostream& /*out*/)
+{
+ parallel::distributed::Triangulation<dim> tr(MPI_COMM_WORLD);
+
+ GridGenerator::hyper_cube(tr);
+ tr.begin_active()->set_refine_flag(RefinementCase<dim>::cut_x);
+
+ try
+ {
+ tr.execute_coarsening_and_refinement ();
+ }
+ catch (const ExcMessage &e)
+ {
+ deallog << "Caught exception:" << std::endl;
+ deallog << e.what() << std::endl;
+ }
+}
+
+
+int main(int argc, char *argv[])
+{
+#ifdef DEAL_II_COMPILER_SUPPORTS_MPI
+ MPI_Init (&argc,&argv);
+#else
+ (void)argc;
+ (void)argv;
+#endif
+
+ std::ofstream logfile("2d_refinement_01/output");
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+ deallog.threshold_double(1.e-10);
+
+ // we want to catch exceptions
+ // instead of aborting the program
+ deal_II_exceptions::disable_abort_on_exception();
+
+ deallog.push("2d");
+ test<2>(logfile);
+ deallog.pop();
+ deallog.push("2d");
+ test<3>(logfile);
+ deallog.pop();
+
+#ifdef DEAL_II_COMPILER_SUPPORTS_MPI
+ MPI_Finalize();
+#endif
+}
--- /dev/null
+
+DEAL:2d::Checksum: 167510149
+<?xml version="1.0"?>
+<VTKFile type="PUnstructuredGrid" version="0.1" byte_order="LittleEndian">
+ <PUnstructuredGrid GhostLevel="0">
+ <PPoints>
+ <PDataArray type="Float32" Name="Position" NumberOfComponents="3" format="ascii"/>
+ </PPoints>
+ <PCellData Scalars="mpirank,treeid">
+ <PDataArray type="Int32" Name="mpirank" format="ascii"/>
+ <PDataArray type="Int32" Name="treeid" format="ascii"/>
+ </PCellData>
+ <PPointData>
+ </PPointData>
+ <Piece Source="2_0000.vtu"/>
+ </PUnstructuredGrid>
+</VTKFile>
+
+<?xml version="1.0"?>
+<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
+ <UnstructuredGrid>
+ <Piece NumberOfPoints="16" NumberOfCells="4">
+ <Points>
+ <DataArray type="Float32" Name="Position" NumberOfComponents="3" format="ascii">
+ 1.25000002e-02 1.25000002e-02 0.00000000e+00
+ 4.87500012e-01 1.25000002e-02 0.00000000e+00
+ 1.25000002e-02 4.87500012e-01 0.00000000e+00
+ 4.87500012e-01 4.87500012e-01 0.00000000e+00
+ 5.12499988e-01 1.25000002e-02 0.00000000e+00
+ 9.87500012e-01 1.25000002e-02 0.00000000e+00
+ 5.12499988e-01 4.87500012e-01 0.00000000e+00
+ 9.87500012e-01 4.87500012e-01 0.00000000e+00
+ 1.25000002e-02 5.12499988e-01 0.00000000e+00
+ 4.87500012e-01 5.12499988e-01 0.00000000e+00
+ 1.25000002e-02 9.87500012e-01 0.00000000e+00
+ 4.87500012e-01 9.87500012e-01 0.00000000e+00
+ 5.12499988e-01 5.12499988e-01 0.00000000e+00
+ 9.87500012e-01 5.12499988e-01 0.00000000e+00
+ 5.12499988e-01 9.87500012e-01 0.00000000e+00
+ 9.87500012e-01 9.87500012e-01 0.00000000e+00
+ </DataArray>
+ </Points>
+ <Cells>
+ <DataArray type="Int32" Name="connectivity" format="ascii">
+ 0 1 2 3
+ 4 5 6 7
+ 8 9 10 11
+ 12 13 14 15
+ </DataArray>
+ <DataArray type="Int32" Name="offsets" format="ascii">
+ 4 8 12 16
+ </DataArray>
+ <DataArray type="UInt8" Name="types" format="ascii">
+ 8 8 8 8
+ </DataArray>
+ </Cells>
+ <CellData Scalars="mpirank,treeid">
+ <DataArray type="Int32" Name="mpirank" format="ascii">
+ 0 0 0 0
+ </DataArray>
+ <DataArray type="Int32" Name="treeid" format="ascii">
+ 0 0 0 0
+ </DataArray>
+ </CellData>
+ <PointData>
+ </PointData>
+ </Piece>
+ </UnstructuredGrid>
+</VTKFile>
+