anna_4.exe : anna_4.g.$(OBJEXT) $(libraries)
anna_5.exe : anna_5.g.$(OBJEXT) $(libraries)
anna_6.exe : anna_6.g.$(OBJEXT) $(libraries)
+data_out_01.exe : data_out_01.g.$(OBJEXT) $(libraries)
+data_out_faces_01.exe : data_out_faces_01.g.$(OBJEXT) $(libraries)
dof_tools_01a.exe : dof_tools_01a.g.$(OBJEXT) $(libraries)
dof_tools_01b.exe : dof_tools_01b.g.$(OBJEXT) $(libraries)
dof_tools_01c.exe : dof_tools_01c.g.$(OBJEXT) $(libraries)
parameter_handler_1.exe : parameter_handler_1.g.$(OBJEXT) $(libraries)
tests = anna_1 anna_2 anna_3 anna_4 anna_5 anna_6 \
+ data_out_01 data_out_faces_01 \
dof_tools_01a dof_tools_01b dof_tools_01c dof_tools_01d \
dof_tools_02a dof_tools_02b dof_tools_02c dof_tools_02d \
dof_tools_03 dof_tools_04 dof_tools_05 dof_tools_06 \
--- /dev/null
+//---------------------------- data_out_01.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2003 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.
+//
+//---------------------------- data_out_01.cc ---------------------------
+
+#include "data_out_common.cc"
+#include <lac/sparsity_pattern.h>
+#include <numerics/data_out.h>
+
+
+std::string output_file_name = "data_out_01.output";
+
+
+template <int dim>
+void
+check_this (const DoFHandler<dim> &dof_handler,
+ const Vector<double> &v_node,
+ const Vector<double> &v_cell)
+{
+ DataOut<dim> data_out;
+ data_out.attach_dof_handler (dof_handler);
+ data_out.add_data_vector (v_node, "node_data");
+ data_out.add_data_vector (v_cell, "cell_data");
+ data_out.build_patches ();
+
+ data_out.write_dx (deallog.get_file_stream());
+ data_out.write_ucd (deallog.get_file_stream());
+ data_out.write_gmv (deallog.get_file_stream());
+ data_out.write_tecplot (deallog.get_file_stream());
+ data_out.write_vtk (deallog.get_file_stream());
+
+ // the following is only
+ // implemented for 2d
+ if (dim == 2)
+ {
+ data_out.write_povray (deallog.get_file_stream());
+ data_out.write_eps (deallog.get_file_stream());
+ }
+}
+
+
--- /dev/null
+//---------------------------- dof_tools_common.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2003 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.
+//
+//---------------------------- dof_tools_common.cc ---------------------------
+
+
+// common framework for the various dof_tools_*.cc tests
+
+#include <base/logstream.h>
+#include <lac/vector.h>
+#include <grid/tria.h>
+#include <grid/tria_iterator.h>
+#include <grid/grid_generator.h>
+#include <dofs/dof_accessor.h>
+#include <dofs/dof_handler.h>
+#include <dofs/dof_tools.h>
+#include <fe/fe_q.h>
+#include <fe/fe_dgq.h>
+#include <fe/fe_dgp.h>
+#include <fe/fe_nedelec.h>
+#include <fe/fe_system.h>
+
+#include <fstream>
+#include <iostream>
+#include <iomanip>
+#include <string>
+
+
+// forward declaration of the function that must be provided in the
+// .cc files
+template <int dim>
+void
+check_this (const DoFHandler<dim> &dof_handler,
+ const Vector<double> &v_node,
+ const Vector<double> &v_cell);
+
+// forward declaration of a variable with the name of the output file
+extern std::string output_file_name;
+
+
+
+
+template <int dim>
+void
+check (const FiniteElement<dim> &fe,
+ const std::string &name)
+{
+ deallog << "Checking " << name
+ << " in " << dim << "d:"
+ << std::endl;
+
+ // create tria and dofhandler
+ // objects. set different boundary
+ // and sub-domain ids
+ Triangulation<dim> tria;
+ GridGenerator::hyper_cube(tria, 0., 1.);
+ tria.refine_global (1);
+ tria.begin_active()->set_refine_flag();
+ tria.execute_coarsening_and_refinement ();
+
+ DoFHandler<dim> dof_handler (tria);
+ dof_handler.distribute_dofs (fe);
+
+ Vector<double> v_node (dof_handler.n_dofs());
+ for (unsigned int i=0; i<v_node.size(); ++i) v_node(i) = i;
+
+ Vector<double> v_cell (dof_handler.get_tria().n_active_cells());
+ for (unsigned int i=0; i<v_node.size(); ++i) v_node(i) = i;
+
+ // call main function in .cc files
+ check_this (dof_handler, v_node, v_cell);
+}
+
+
+
+
+
+#define CHECK(EL,deg,dim)\
+ { FE_ ## EL<dim> EL(deg); \
+ check(EL, #EL #deg); }
+
+#define CHECK_ALL(EL,deg)\
+ { CHECK(EL,deg,1); \
+ CHECK(EL,deg,2); \
+ CHECK(EL,deg,3); \
+ }
+
+
+int
+main()
+{
+ try
+ {
+ std::ofstream logfile(output_file_name.c_str());
+ logfile.precision (2);
+ deallog.attach(logfile);
+ deallog.depth_console(0);
+
+ CHECK_ALL(Q,1);
+ CHECK_ALL(Q,2);
+ CHECK_ALL(Q,3);
+
+ CHECK_ALL(DGQ,0);
+ CHECK_ALL(DGQ,1);
+ CHECK_ALL(DGQ,2);
+
+ CHECK(Nedelec, 1, 2);
+ CHECK(Nedelec, 1, 3);
+
+ return 0;
+ }
+ catch (std::exception &exc)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Exception on processing: " << std::endl
+ << exc.what() << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ }
+ catch (...)
+ {
+ std::cerr << std::endl << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ std::cerr << "Unknown exception!" << std::endl
+ << "Aborting!" << std::endl
+ << "----------------------------------------------------"
+ << std::endl;
+ return 1;
+ };
+}
+
--- /dev/null
+//---------------------------- data_out_faces_01.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 2003 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.
+//
+//---------------------------- data_out_faces_01.cc ---------------------------
+
+#include "data_out_common.cc"
+#include <lac/sparsity_pattern.h>
+#include <numerics/data_out_faces.h>
+
+
+std::string output_file_name = "data_out_faces_01.output";
+
+
+
+void
+check_this (const DoFHandler<1> &dof_handler,
+ const Vector<double> &v_node,
+ const Vector<double> &v_cell)
+{
+ // nothing to check in 1d
+}
+
+
+template <int dim>
+void
+check_this (const DoFHandler<dim> &dof_handler,
+ const Vector<double> &v_node,
+ const Vector<double> &v_cell)
+{
+ DataOutFaces<dim> data_out_faces;
+ data_out_faces.attach_dof_handler (dof_handler);
+ data_out_faces.add_data_vector (v_node, "node_data");
+ data_out_faces.add_data_vector (v_cell, "cell_data");
+ data_out_faces.build_patches ();
+
+ data_out_faces.write_dx (deallog.get_file_stream());
+ data_out_faces.write_ucd (deallog.get_file_stream());
+ data_out_faces.write_gmv (deallog.get_file_stream());
+ data_out_faces.write_tecplot (deallog.get_file_stream());
+ data_out_faces.write_vtk (deallog.get_file_stream());
+
+ // the following is only
+ // implemented for 2d
+ if (dim == 2)
+ {
+ data_out_faces.write_povray (deallog.get_file_stream());
+ data_out_faces.write_eps (deallog.get_file_stream());
+ }
+}
+
+