]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add simple distributed codim 1 test case
authorTimo Heister <timo.heister@gmail.com>
Fri, 28 Feb 2014 14:49:15 +0000 (14:49 +0000)
committerTimo Heister <timo.heister@gmail.com>
Fri, 28 Feb 2014 14:49:15 +0000 (14:49 +0000)
git-svn-id: https://svn.dealii.org/trunk@32585 0785d39b-7218-0410-832d-ea1e28bc413d

tests/distributed_grids/coarse_grid_common.h
tests/distributed_grids/codim_01.cc [new file with mode: 0644]
tests/distributed_grids/codim_01.output [new file with mode: 0644]

index deda5c05b1f1d08bc7dd0e5604b9d2fed5964169..fc3cdd70127f07fc65c447de0e9205347e080850 100644 (file)
@@ -26,8 +26,8 @@
 #include <unistd.h>
 
 
-template <int dim>
-void write_vtk (const parallel::distributed::Triangulation<dim> &tria,
+template <int dim, int spacedim=dim>
+void write_vtk (const parallel::distributed::Triangulation<dim,spacedim> &tria,
                 const char                                *filename)
 {
   deallog << "Checksum: "
diff --git a/tests/distributed_grids/codim_01.cc b/tests/distributed_grids/codim_01.cc
new file mode 100644 (file)
index 0000000..07364f6
--- /dev/null
@@ -0,0 +1,57 @@
+// ---------------------------------------------------------------------
+// $Id: 2d_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.
+//
+// ---------------------------------------------------------------------
+
+
+
+// Test Tria<2,3>
+
+#include "../tests.h"
+#include "coarse_grid_common.h"
+#include <deal.II/base/logstream.h>
+#include <deal.II/base/tensor.h>
+#include <deal.II/grid/tria.h>
+#include <deal.II/distributed/tria.h>
+#include <deal.II/grid/tria_accessor.h>
+#include <deal.II/grid/tria_iterator.h>
+#include <deal.II/grid/grid_generator.h>
+#include <deal.II/grid/grid_out.h>
+
+#include <fstream>
+
+
+template<int dim, int spacedim>
+void test(std::ostream & /*out*/)
+{
+  parallel::distributed::Triangulation<dim,spacedim> tr(MPI_COMM_WORLD);
+
+  GridGenerator::torus(tr, 1, 0.2);
+  tr.begin_active()->set_refine_flag();
+  tr.execute_coarsening_and_refinement ();
+
+  write_vtk(tr, "file");
+}
+
+
+int main(int argc, char *argv[])
+{
+  Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1);
+
+  initlog();
+
+  deallog.push("2-3");
+  test<2,3>(deallog.get_file_stream());  
+  deallog.pop();
+}
diff --git a/tests/distributed_grids/codim_01.output b/tests/distributed_grids/codim_01.output
new file mode 100644 (file)
index 0000000..c85ea54
--- /dev/null
@@ -0,0 +1,147 @@
+
+DEAL:2-3::Checksum: 1736441989
+<?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="file_0000.vtu"/>
+  </PUnstructuredGrid>
+</VTKFile>
+
+<?xml version="1.0"?>
+<VTKFile type="UnstructuredGrid" version="0.1" byte_order="LittleEndian">
+  <UnstructuredGrid>
+    <Piece NumberOfPoints="76" NumberOfCells="19">
+      <Points>
+        <DataArray type="Float32" Name="Position" NumberOfComponents="3" format="ascii">
+            7.92468727e-01   2.49999994e-03   1.00312503e-02
+            4.11281258e-01   2.49999994e-03   3.91218752e-01
+            8.86281252e-01   9.74999964e-02   1.12187499e-02
+            4.59968746e-01   9.74999964e-02   4.37531263e-01
+            3.91218752e-01   2.49999994e-03   4.11281258e-01
+            1.00312503e-02   2.49999994e-03   7.92468727e-01
+            4.37531263e-01   9.74999964e-02   4.59968746e-01
+            1.12187499e-02   9.74999964e-02   8.86281252e-01
+            8.91218722e-01   1.02499999e-01   1.12812500e-02
+            4.62531239e-01   1.02499999e-01   4.39968765e-01
+            9.85031247e-01   1.97500005e-01   1.24687497e-02
+            5.11218727e-01   1.97500005e-01   4.86281246e-01
+            4.39968765e-01   1.02499999e-01   4.62531239e-01
+            1.12812500e-02   1.02499999e-01   8.91218722e-01
+            4.86281246e-01   1.97500005e-01   5.11218727e-01
+            1.24687497e-02   1.97500005e-01   9.85031247e-01
+            9.70125020e-01  -1.94999993e-01   2.48750001e-02
+            2.48750001e-02  -1.94999993e-01   9.70125020e-01
+            7.84874976e-01  -4.99999989e-03   2.01249998e-02
+            2.01249998e-02  -4.99999989e-03   7.84874976e-01
+            9.79875028e-01   1.94999993e-01   2.51250006e-02
+            2.51250006e-02   1.94999993e-01   9.79875028e-01
+            1.16512501e+00   4.99999989e-03   2.98749991e-02
+            2.98749991e-02   4.99999989e-03   1.16512501e+00
+           -2.01249998e-02   4.99999989e-03   7.84874976e-01
+           -7.84874976e-01   4.99999989e-03   2.01249998e-02
+           -2.48750001e-02   1.94999993e-01   9.70125020e-01
+           -9.70125020e-01   1.94999993e-01   2.48750001e-02
+            2.01249998e-02   4.99999989e-03  -7.84874976e-01
+            7.84874976e-01   4.99999989e-03  -2.01249998e-02
+            2.48750001e-02   1.94999993e-01  -9.70125020e-01
+            9.70125020e-01   1.94999993e-01  -2.48750001e-02
+            1.16512501e+00  -4.99999989e-03   2.98749991e-02
+            2.98749991e-02  -4.99999989e-03   1.16512501e+00
+            9.79875028e-01  -1.94999993e-01   2.51250006e-02
+            2.51250006e-02  -1.94999993e-01   9.79875028e-01
+           -2.48750001e-02  -1.94999993e-01   9.70125020e-01
+           -9.70125020e-01  -1.94999993e-01   2.48750001e-02
+           -2.01249998e-02  -4.99999989e-03   7.84874976e-01
+           -7.84874976e-01  -4.99999989e-03   2.01249998e-02
+           -2.51250006e-02   1.94999993e-01   9.79875028e-01
+           -9.79875028e-01   1.94999993e-01   2.51250006e-02
+           -2.98749991e-02   4.99999989e-03   1.16512501e+00
+           -1.16512501e+00   4.99999989e-03   2.98749991e-02
+           -7.84874976e-01   4.99999989e-03  -2.01249998e-02
+           -2.01249998e-02   4.99999989e-03  -7.84874976e-01
+           -9.70125020e-01   1.94999993e-01  -2.48750001e-02
+           -2.48750001e-02   1.94999993e-01  -9.70125020e-01
+            2.48750001e-02  -1.94999993e-01  -9.70125020e-01
+            9.70125020e-01  -1.94999993e-01  -2.48750001e-02
+            2.01249998e-02  -4.99999989e-03  -7.84874976e-01
+            7.84874976e-01  -4.99999989e-03  -2.01249998e-02
+            2.51250006e-02   1.94999993e-01  -9.79875028e-01
+            9.79875028e-01   1.94999993e-01  -2.51250006e-02
+            2.98749991e-02   4.99999989e-03  -1.16512501e+00
+            1.16512501e+00   4.99999989e-03  -2.98749991e-02
+           -2.98749991e-02  -4.99999989e-03   1.16512501e+00
+           -1.16512501e+00  -4.99999989e-03   2.98749991e-02
+           -2.51250006e-02  -1.94999993e-01   9.79875028e-01
+           -9.79875028e-01  -1.94999993e-01   2.51250006e-02
+           -9.70125020e-01  -1.94999993e-01  -2.48750001e-02
+           -2.48750001e-02  -1.94999993e-01  -9.70125020e-01
+           -7.84874976e-01  -4.99999989e-03  -2.01249998e-02
+           -2.01249998e-02  -4.99999989e-03  -7.84874976e-01
+           -9.79875028e-01   1.94999993e-01  -2.51250006e-02
+           -2.51250006e-02   1.94999993e-01  -9.79875028e-01
+           -1.16512501e+00   4.99999989e-03  -2.98749991e-02
+           -2.98749991e-02   4.99999989e-03  -1.16512501e+00
+            2.98749991e-02  -4.99999989e-03  -1.16512501e+00
+            1.16512501e+00  -4.99999989e-03  -2.98749991e-02
+            2.51250006e-02  -1.94999993e-01  -9.79875028e-01
+            9.79875028e-01  -1.94999993e-01  -2.51250006e-02
+           -1.16512501e+00  -4.99999989e-03  -2.98749991e-02
+           -2.98749991e-02  -4.99999989e-03  -1.16512501e+00
+           -9.79875028e-01  -1.94999993e-01  -2.51250006e-02
+           -2.51250006e-02  -1.94999993e-01  -9.79875028e-01
+        </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
+          16 17 18 19
+          20 21 22 23
+          24 25 26 27
+          28 29 30 31
+          32 33 34 35
+          36 37 38 39
+          40 41 42 43
+          44 45 46 47
+          48 49 50 51
+          52 53 54 55
+          56 57 58 59
+          60 61 62 63
+          64 65 66 67
+          68 69 70 71
+          72 73 74 75
+        </DataArray>
+        <DataArray type="Int32" Name="offsets" format="ascii">
+          4 8 12 16 20 24 28 32
+          36 40 44 48 52 56 60 64
+          68 72 76
+        </DataArray>
+        <DataArray type="UInt8" Name="types" format="ascii">
+          8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8
+        </DataArray>
+      </Cells>
+      <CellData Scalars="mpirank,treeid">
+        <DataArray type="Int32" Name="mpirank" format="ascii">
+          0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
+        </DataArray>
+        <DataArray type="Int32" Name="treeid" format="ascii">
+          0 0 0 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
+        </DataArray>
+      </CellData>
+      <PointData>
+      </PointData>
+    </Piece>
+  </UnstructuredGrid>
+</VTKFile>
+

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.