virtual
void
- compute_derived_quantities_vector (const std::vector<Vector<double> > &uh,
- const std::vector<std::vector<Tensor<1,dim> > > &duh,
- const std::vector<std::vector<Tensor<2,dim> > > &dduh,
+ compute_derived_quantities_vector (const std::vector<Vector<double> > &solution_values,
+ const std::vector<std::vector<Tensor<1,dim> > > &solution_gradients,
+ const std::vector<std::vector<Tensor<2,dim> > > &solution_hessians,
const std::vector<Point<dim> > &normals,
const std::vector<Point<dim> > &evaluation_points,
std::vector<Vector<double> > &computed_quantities) const;
template <int dim>
void
Postprocessor<dim>::
- compute_derived_quantities_vector (const std::vector<Vector<double> > &uh,
- const std::vector<std::vector<Tensor<1,dim> > > &/*duh*/,
- const std::vector<std::vector<Tensor<2,dim> > > &/*dduh*/,
+ compute_derived_quantities_vector (const std::vector<Vector<double> > &solution_values,
+ const std::vector<std::vector<Tensor<1,dim> > > &/*solution_gradients*/,
+ const std::vector<std::vector<Tensor<2,dim> > > &/*solution_hessians*/,
const std::vector<Point<dim> > &/*normals*/,
const std::vector<Point<dim> > &evaluation_points,
std::vector<Vector<double> > &computed_quantities) const
{
- const unsigned int n_quadrature_points = uh.size();
+ const unsigned int n_quadrature_points = solution_values.size();
Assert (computed_quantities.size() == n_quadrature_points, ExcInternalError());
for (unsigned int q=0; q<n_quadrature_points; ++q)
{
- Assert(uh[q].size() == 2, ExcDimensionMismatch (uh[q].size(), 2)); // FESystem with 2 components
+ Assert(solution_values[q].size() == 2, ExcDimensionMismatch (solution_values[q].size(), 2)); // FESystem with 2 components
computed_quantities[q](0)
- = (uh[q](0)
+ = (solution_values[q](0)
+
- uh[q](1) * enrichment.value(evaluation_points[q])); // for FE_Nothing uh[q](1) will be zero
+ solution_values[q](1) * enrichment.value(evaluation_points[q])); // for FE_Nothing solution_values[q](1) will be zero
}
}
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2000 - 2016 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.
+//
+// ---------------------------------------------------------------------
+
+
+// tests DataPostprocessor: create a FE field that has two components of
+// the kind cos(something) and sin(something) and then have a postprocessor
+// that computes the sum of squares. should always be equal to one
+
+
+#include "../tests.h"
+#include <deal.II/grid/tria.h>
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/grid/grid_generator.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/fe/fe_q.h>
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/base/function.h>
+#include <deal.II/numerics/vector_tools.h>
+#include <deal.II/numerics/matrix_tools.h>
+#include <deal.II/lac/vector.h>
+
+#include <deal.II/numerics/data_out.h>
+#include <deal.II/numerics/data_postprocessor.h>
+#include <fstream>
+
+#include <deal.II/base/logstream.h>
+
+
+std::ofstream logfile("output");
+
+
+template <int dim>
+class LaplaceProblem
+{
+public:
+ LaplaceProblem ();
+ void run ();
+
+private:
+ void make_grid_and_dofs ();
+ void solve ();
+ void output_results () const;
+
+ Triangulation<dim> triangulation;
+ FESystem<dim> fe;
+ DoFHandler<dim> dof_handler;
+
+ Vector<double> solution;
+};
+
+
+template <int dim>
+LaplaceProblem<dim>::LaplaceProblem ()
+ :
+ fe (FE_Q<dim>(1),2),
+ dof_handler (triangulation)
+{}
+
+
+
+template <int dim>
+void LaplaceProblem<dim>::make_grid_and_dofs ()
+{
+ GridGenerator::hyper_cube (triangulation, 0, 1);
+ triangulation.refine_global (1);
+ triangulation.begin_active()->set_refine_flag ();
+ triangulation.execute_coarsening_and_refinement ();
+
+ dof_handler.distribute_dofs (fe);
+ solution.reinit (dof_handler.n_dofs());
+}
+
+
+
+template <int dim>
+class SinesAndCosines : public Function<dim>
+{
+public:
+ SinesAndCosines ()
+ :
+ Function<dim> (2)
+ {}
+
+ double value (const Point<dim> &p,
+ const unsigned int component) const
+ {
+ switch (component)
+ {
+ case 0:
+ return std::sin (p.norm());
+ case 1:
+ return std::cos (p.norm());
+ default:
+ Assert (false, ExcNotImplemented());
+ return 0;
+ }
+ }
+};
+
+
+
+template <int dim>
+void LaplaceProblem<dim>::solve ()
+{
+ // dummy solve. just insert some
+ // values as mentioned at the top
+ // of the file
+ VectorTools::interpolate (dof_handler,
+ SinesAndCosines<dim>(),
+ solution);
+}
+
+
+template <int dim>
+class MyPostprocessor : public DataPostprocessor<dim>
+{
+public:
+ virtual std::vector<std::string> get_names () const
+ {
+ return std::vector<std::string>(1,"magnitude");
+ }
+
+ virtual
+ std::vector<DataComponentInterpretation::DataComponentInterpretation>
+ get_data_component_interpretation () const
+ {
+ return
+ std::vector<DataComponentInterpretation::DataComponentInterpretation>
+ (1,DataComponentInterpretation::component_is_scalar);
+ }
+
+ virtual UpdateFlags get_needed_update_flags () const
+ {
+ return update_values;
+ }
+
+ virtual
+ void
+ compute_derived_quantities_vector (const DataPostprocessorInputs::Vector<dim> &input_data,
+ std::vector<Vector<double> > &computed_quantities) const
+ {
+ for (unsigned int q=0; q<input_data.solution_values.size(); ++q)
+ {
+ AssertThrow (computed_quantities[q].size() == 1,
+ ExcInternalError());
+
+ computed_quantities[q](0) = input_data.solution_values[q](0)*input_data.solution_values[q](0) + input_data.solution_values[q](1)*input_data.solution_values[q](1);
+ AssertThrow (std::fabs(computed_quantities[q](0)-1) < 1e-12,
+ ExcInternalError());
+ }
+ }
+};
+
+
+
+template <int dim>
+void LaplaceProblem<dim>::output_results () const
+{
+ MyPostprocessor<dim> p;
+ DataOut<dim> data_out;
+ data_out.attach_dof_handler (dof_handler);
+ data_out.add_data_vector (solution, p);
+ data_out.build_patches ();
+ data_out.write_gnuplot (logfile);
+}
+
+
+
+template <int dim>
+void LaplaceProblem<dim>::run ()
+{
+ make_grid_and_dofs();
+ solve ();
+ output_results ();
+}
+
+
+
+int main ()
+{
+ logfile << std::setprecision(2);
+ deallog << std::setprecision(2);
+
+ LaplaceProblem<2> laplace_problem_2d;
+ laplace_problem_2d.run ();
+
+ LaplaceProblem<3> laplace_problem_3d;
+ laplace_problem_3d.run ();
+
+ return 0;
+}
--- /dev/null
+# This file was generated by the deal.II library.
+
+
+#
+# For a description of the GNUPLOT format see the GNUPLOT manual.
+#
+# <x> <y> <magnitude>
+0.5 0 1
+1 0 1
+
+0.5 0.5 1
+1 0.5 1
+
+
+0 0.5 1
+0.5 0.5 1
+
+0 1 1
+0.5 1 1
+
+
+0.5 0.5 1
+1 0.5 1
+
+0.5 1 1
+1 1 1
+
+
+0 0 1
+0.25 0 1
+
+0 0.25 1
+0.25 0.25 1
+
+
+0.25 0 1
+0.5 0 1
+
+0.25 0.25 1
+0.5 0.25 1
+
+
+0 0.25 1
+0.25 0.25 1
+
+0 0.5 1
+0.25 0.5 1
+
+
+0.25 0.25 1
+0.5 0.25 1
+
+0.25 0.5 1
+0.5 0.5 1
+
+
+# This file was generated by the deal.II library.
+
+
+#
+# For a description of the GNUPLOT format see the GNUPLOT manual.
+#
+# <x> <y> <z> <magnitude>
+0.5 0 0 1
+1 0 0 1
+
+
+0.5 0 0 1
+0.5 0.5 0 1
+
+
+0.5 0 0 1
+0.5 0 0.5 1
+
+
+1 0 0 1
+1 0.5 0 1
+
+
+1 0 0 1
+1 0 0.5 1
+
+
+0.5 0.5 0 1
+1 0.5 0 1
+
+
+0.5 0.5 0 1
+0.5 0.5 0.5 1
+
+
+1 0.5 0 1
+1 0.5 0.5 1
+
+
+0.5 0 0.5 1
+1 0 0.5 1
+
+
+0.5 0 0.5 1
+0.5 0.5 0.5 1
+
+
+1 0 0.5 1
+1 0.5 0.5 1
+
+
+0.5 0.5 0.5 1
+1 0.5 0.5 1
+
+
+0 0.5 0 1
+0.5 0.5 0 1
+
+
+0 0.5 0 1
+0 1 0 1
+
+
+0 0.5 0 1
+0 0.5 0.5 1
+
+
+0.5 0.5 0 1
+0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
+0 0.25 0 1
+0.25 0.25 0 1
+
+
+0 0.25 0 1
+0 0.25 0.25 1
+
+
+0.25 0.25 0 1
+0.25 0.25 0.25 1
+
+
+0 0 0.25 1
+0.25 0 0.25 1
+
+
+0 0 0.25 1
+0 0.25 0.25 1
+
+
+0.25 0 0.25 1
+0.25 0.25 0.25 1
+
+
+0 0.25 0.25 1
+0.25 0.25 0.25 1
+
+
+0.25 0 0 1
+0.5 0 0 1
+
+
+0.25 0 0 1
+0.25 0.25 0 1
+
+
+0.25 0 0 1
+0.25 0 0.25 1
+
+
+0.5 0 0 1
+0.5 0.25 0 1
+
+
+0.5 0 0 1
+0.5 0 0.25 1
+
+
+0.25 0.25 0 1
+0.5 0.25 0 1
+
+
+0.25 0.25 0 1
+0.25 0.25 0.25 1
+
+
+0.5 0.25 0 1
+0.5 0.25 0.25 1
+
+
+0.25 0 0.25 1
+0.5 0 0.25 1
+
+
+0.25 0 0.25 1
+0.25 0.25 0.25 1
+
+
+0.5 0 0.25 1
+0.5 0.25 0.25 1
+
+
+0.25 0.25 0.25 1
+0.5 0.25 0.25 1
+
+
+0 0.25 0 1
+0.25 0.25 0 1
+
+
+0 0.25 0 1
+0 0.5 0 1
+
+
+0 0.25 0 1
+0 0.25 0.25 1
+
+
+0.25 0.25 0 1
+0.25 0.5 0 1
+
+
+0.25 0.25 0 1
+0.25 0.25 0.25 1
+
+
+0 0.5 0 1
+0.25 0.5 0 1
+
+
+0 0.5 0 1
+0 0.5 0.25 1
+
+
+0.25 0.5 0 1
+0.25 0.5 0.25 1
+
+
+0 0.25 0.25 1
+0.25 0.25 0.25 1
+
+
+0 0.25 0.25 1
+0 0.5 0.25 1
+
+
+0.25 0.25 0.25 1
+0.25 0.5 0.25 1
+
+
+0 0.5 0.25 1
+0.25 0.5 0.25 1
+
+
+0.25 0.25 0 1
+0.5 0.25 0 1
+
+
+0.25 0.25 0 1
+0.25 0.5 0 1
+
+
+0.25 0.25 0 1
+0.25 0.25 0.25 1
+
+
+0.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.5 1
+
+
+0 0.25 0.25 1
+0.25 0.25 0.25 1
+
+
+0 0.25 0.25 1
+0 0.5 0.25 1
+
+
+0 0.25 0.25 1
+0 0.25 0.5 1
+
+
+0.25 0.25 0.25 1
+0.25 0.5 0.25 1
+
+
+0.25 0.25 0.25 1
+0.25 0.25 0.5 1
+
+
+0 0.5 0.25 1
+0.25 0.5 0.25 1
+
+
+0 0.5 0.25 1
+0 0.5 0.5 1
+
+
+0.25 0.5 0.25 1
+0.25 0.5 0.5 1
+
+
+0 0.25 0.5 1
+0.25 0.25 0.5 1
+
+
+0 0.25 0.5 1
+0 0.5 0.5 1
+
+
+0.25 0.25 0.5 1
+0.25 0.5 0.5 1
+
+
+0 0.5 0.5 1
+0.25 0.5 0.5 1
+
+
+0.25 0.25 0.25 1
+0.5 0.25 0.25 1
+
+
+0.25 0.25 0.25 1
+0.25 0.5 0.25 1
+
+
+0.25 0.25 0.25 1
+0.25 0.25 0.5 1
+
+
+0.5 0.25 0.25 1
+0.5 0.5 0.25 1
+
+
+0.5 0.25 0.25 1
+0.5 0.25 0.5 1
+
+
+0.25 0.5 0.25 1
+0.5 0.5 0.25 1
+
+
+0.25 0.5 0.25 1
+0.25 0.5 0.5 1
+
+
+0.5 0.5 0.25 1
+0.5 0.5 0.5 1
+
+
+0.25 0.25 0.5 1
+0.5 0.25 0.5 1
+
+
+0.25 0.25 0.5 1
+0.25 0.5 0.5 1
+
+
+0.5 0.25 0.5 1
+0.5 0.5 0.5 1
+
+
+0.25 0.5 0.5 1
+0.5 0.5 0.5 1
+
+
virtual
void
- compute_derived_quantities_vector (const std::vector<Vector<double> > &uh,
+ compute_derived_quantities_vector (const std::vector<Vector<double> > &solution_values,
const std::vector<std::vector<Tensor<1,dim> > > &,
const std::vector<std::vector<Tensor<2,dim> > > &,
const std::vector<Point<dim> > &,
const std::vector<Point<dim> > &,
std::vector<Vector<double> > &computed_quantities) const
{
- for (unsigned int q=0; q<uh.size(); ++q)
+ for (unsigned int q=0; q<solution_values.size(); ++q)
{
AssertThrow (computed_quantities[q].size() == 1,
ExcInternalError());
- computed_quantities[q](0) = uh[q](0)*uh[q](0) + uh[q](1)*uh[q](1);
+ computed_quantities[q](0) = solution_values[q](0)*solution_values[q](0) + solution_values[q](1)*solution_values[q](1);
AssertThrow (std::fabs(computed_quantities[q](0)-1) < 1e-12,
ExcInternalError());
}
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2000 - 2016 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.
+//
+// ---------------------------------------------------------------------
+
+
+// tests DataPostprocessor: create a FE field that has two components of
+// the kind cos(something) and sin(something) and then have a postprocessor
+// that computes the sum of squares. should always be equal to one
+//
+// this test uses the shortcut class DataPostprocessorScalar to make
+// writing postprocessors simpler
+
+
+#include "../tests.h"
+#include <deal.II/grid/tria.h>
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/grid/grid_generator.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/fe/fe_q.h>
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/base/function.h>
+#include <deal.II/numerics/vector_tools.h>
+#include <deal.II/numerics/matrix_tools.h>
+#include <deal.II/lac/vector.h>
+
+#include <deal.II/numerics/data_out.h>
+#include <deal.II/numerics/data_postprocessor.h>
+#include <fstream>
+
+#include <deal.II/base/logstream.h>
+
+
+std::ofstream logfile("output");
+
+
+template <int dim>
+class LaplaceProblem
+{
+public:
+ LaplaceProblem ();
+ void run ();
+
+private:
+ void make_grid_and_dofs ();
+ void solve ();
+ void output_results () const;
+
+ Triangulation<dim> triangulation;
+ FESystem<dim> fe;
+ DoFHandler<dim> dof_handler;
+
+ Vector<double> solution;
+};
+
+
+template <int dim>
+LaplaceProblem<dim>::LaplaceProblem ()
+ :
+ fe (FE_Q<dim>(1),2),
+ dof_handler (triangulation)
+{}
+
+
+
+template <int dim>
+void LaplaceProblem<dim>::make_grid_and_dofs ()
+{
+ GridGenerator::hyper_cube (triangulation, 0, 1);
+ triangulation.refine_global (1);
+ triangulation.begin_active()->set_refine_flag ();
+ triangulation.execute_coarsening_and_refinement ();
+
+ dof_handler.distribute_dofs (fe);
+ solution.reinit (dof_handler.n_dofs());
+}
+
+
+
+template <int dim>
+class SinesAndCosines : public Function<dim>
+{
+public:
+ SinesAndCosines ()
+ :
+ Function<dim> (2)
+ {}
+
+ double value (const Point<dim> &p,
+ const unsigned int component) const
+ {
+ switch (component)
+ {
+ case 0:
+ return std::sin (p.norm());
+ case 1:
+ return std::cos (p.norm());
+ default:
+ Assert (false, ExcNotImplemented());
+ return 0;
+ }
+ }
+};
+
+
+
+template <int dim>
+void LaplaceProblem<dim>::solve ()
+{
+ // dummy solve. just insert some
+ // values as mentioned at the top
+ // of the file
+ VectorTools::interpolate (dof_handler,
+ SinesAndCosines<dim>(),
+ solution);
+}
+
+
+template <int dim>
+class MyPostprocessor : public DataPostprocessorScalar<dim>
+{
+public:
+ MyPostprocessor ()
+ :
+ DataPostprocessorScalar<dim> ("magnitude", update_values)
+ {}
+
+ virtual
+ void
+ compute_derived_quantities_vector (const DataPostprocessorInputs::Vector<dim> &input_data,
+ std::vector<Vector<double> > &computed_quantities) const
+ {
+ for (unsigned int q=0; q<input_data.solution_values.size(); ++q)
+ {
+ Assert (computed_quantities[q].size() == 1,
+ ExcInternalError());
+
+ computed_quantities[q](0) = input_data.solution_values[q](0)*input_data.solution_values[q](0) + input_data.solution_values[q](1)*input_data.solution_values[q](1);
+ AssertThrow (std::fabs(computed_quantities[q](0)-1) < 1e-12,
+ ExcInternalError());
+ }
+ }
+};
+
+
+
+template <int dim>
+void LaplaceProblem<dim>::output_results () const
+{
+ MyPostprocessor<dim> p;
+ DataOut<dim> data_out;
+ data_out.attach_dof_handler (dof_handler);
+ data_out.add_data_vector (solution, p);
+ data_out.build_patches ();
+ data_out.write_gnuplot (logfile);
+}
+
+
+
+template <int dim>
+void LaplaceProblem<dim>::run ()
+{
+ make_grid_and_dofs();
+ solve ();
+ output_results ();
+}
+
+
+
+int main ()
+{
+ logfile << std::setprecision(2);
+ deallog << std::setprecision(2);
+
+ LaplaceProblem<2> laplace_problem_2d;
+ laplace_problem_2d.run ();
+
+ LaplaceProblem<3> laplace_problem_3d;
+ laplace_problem_3d.run ();
+
+ return 0;
+}
--- /dev/null
+# This file was generated by the deal.II library.
+
+
+#
+# For a description of the GNUPLOT format see the GNUPLOT manual.
+#
+# <x> <y> <magnitude>
+0.5 0 1
+1 0 1
+
+0.5 0.5 1
+1 0.5 1
+
+
+0 0.5 1
+0.5 0.5 1
+
+0 1 1
+0.5 1 1
+
+
+0.5 0.5 1
+1 0.5 1
+
+0.5 1 1
+1 1 1
+
+
+0 0 1
+0.25 0 1
+
+0 0.25 1
+0.25 0.25 1
+
+
+0.25 0 1
+0.5 0 1
+
+0.25 0.25 1
+0.5 0.25 1
+
+
+0 0.25 1
+0.25 0.25 1
+
+0 0.5 1
+0.25 0.5 1
+
+
+0.25 0.25 1
+0.5 0.25 1
+
+0.25 0.5 1
+0.5 0.5 1
+
+
+# This file was generated by the deal.II library.
+
+
+#
+# For a description of the GNUPLOT format see the GNUPLOT manual.
+#
+# <x> <y> <z> <magnitude>
+0.5 0 0 1
+1 0 0 1
+
+
+0.5 0 0 1
+0.5 0.5 0 1
+
+
+0.5 0 0 1
+0.5 0 0.5 1
+
+
+1 0 0 1
+1 0.5 0 1
+
+
+1 0 0 1
+1 0 0.5 1
+
+
+0.5 0.5 0 1
+1 0.5 0 1
+
+
+0.5 0.5 0 1
+0.5 0.5 0.5 1
+
+
+1 0.5 0 1
+1 0.5 0.5 1
+
+
+0.5 0 0.5 1
+1 0 0.5 1
+
+
+0.5 0 0.5 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 0.5 0.25 1
+
+
+0.25 0.25 0.25 1
+0.25 0.5 0.25 1
+
+
+0 0.5 0.25 1
+0.25 0.5 0.25 1
+
+
+0.25 0.25 0 1
+0.5 0.25 0 1
+
+
+0.25 0.25 0 1
+0.25 0.5 0 1
+
+
+0.25 0.25 0 1
+0.25 0.25 0.25 1
+
+
+0.5 0.25 0 1
+0.5 0.5 0 1
+
+
+0.5 0.25 0 1
+0.5 0.25 0.25 1
+
+
+0.25 0.5 0 1
+0.5 0.5 0 1
+
+
+0.25 0.5 0 1
+0.25 0.5 0.25 1
+
+
+0.5 0.5 0 1
+0.5 0.5 0.25 1
+
+
+0.25 0.25 0.25 1
+0.5 0.25 0.25 1
+
+
+0.25 0.25 0.25 1
+0.25 0.5 0.25 1
+
+
+0.5 0.25 0.25 1
+0.5 0.5 0.25 1
+
+
+0.25 0.5 0.25 1
+0.5 0.5 0.25 1
+
+
+0 0 0.25 1
+0.25 0 0.25 1
+
+
+0 0 0.25 1
+0 0.25 0.25 1
+
+
+0 0 0.25 1
+0 0 0.5 1
+
+
+0.25 0 0.25 1
+0.25 0.25 0.25 1
+
+
+0.25 0 0.25 1
+0.25 0 0.5 1
+
+
+0 0.25 0.25 1
+0.25 0.25 0.25 1
+
+
+0 0.25 0.25 1
+0 0.25 0.5 1
+
+
+0.25 0.25 0.25 1
+0.25 0.25 0.5 1
+
+
+0 0 0.5 1
+0.25 0 0.5 1
+
+
+0 0 0.5 1
+0 0.25 0.5 1
+
+
+0.25 0 0.5 1
+0.25 0.25 0.5 1
+
+
+0 0.25 0.5 1
+0.25 0.25 0.5 1
+
+
+0.25 0 0.25 1
+0.5 0 0.25 1
+
+
+0.25 0 0.25 1
+0.25 0.25 0.25 1
+
+
+0.25 0 0.25 1
+0.25 0 0.5 1
+
+
+0.5 0 0.25 1
+0.5 0.25 0.25 1
+
+
+0.5 0 0.25 1
+0.5 0 0.5 1
+
+
+0.25 0.25 0.25 1
+0.5 0.25 0.25 1
+
+
+0.25 0.25 0.25 1
+0.25 0.25 0.5 1
+
+
+0.5 0.25 0.25 1
+0.5 0.25 0.5 1
+
+
+0.25 0 0.5 1
+0.5 0 0.5 1
+
+
+0.25 0 0.5 1
+0.25 0.25 0.5 1
+
+
+0.5 0 0.5 1
+0.5 0.25 0.5 1
+
+
+0.25 0.25 0.5 1
+0.5 0.25 0.5 1
+
+
+0 0.25 0.25 1
+0.25 0.25 0.25 1
+
+
+0 0.25 0.25 1
+0 0.5 0.25 1
+
+
+0 0.25 0.25 1
+0 0.25 0.5 1
+
+
+0.25 0.25 0.25 1
+0.25 0.5 0.25 1
+
+
+0.25 0.25 0.25 1
+0.25 0.25 0.5 1
+
+
+0 0.5 0.25 1
+0.25 0.5 0.25 1
+
+
+0 0.5 0.25 1
+0 0.5 0.5 1
+
+
+0.25 0.5 0.25 1
+0.25 0.5 0.5 1
+
+
+0 0.25 0.5 1
+0.25 0.25 0.5 1
+
+
+0 0.25 0.5 1
+0 0.5 0.5 1
+
+
+0.25 0.25 0.5 1
+0.25 0.5 0.5 1
+
+
+0 0.5 0.5 1
+0.25 0.5 0.5 1
+
+
+0.25 0.25 0.25 1
+0.5 0.25 0.25 1
+
+
+0.25 0.25 0.25 1
+0.25 0.5 0.25 1
+
+
+0.25 0.25 0.25 1
+0.25 0.25 0.5 1
+
+
+0.5 0.25 0.25 1
+0.5 0.5 0.25 1
+
+
+0.5 0.25 0.25 1
+0.5 0.25 0.5 1
+
+
+0.25 0.5 0.25 1
+0.5 0.5 0.25 1
+
+
+0.25 0.5 0.25 1
+0.25 0.5 0.5 1
+
+
+0.5 0.5 0.25 1
+0.5 0.5 0.5 1
+
+
+0.25 0.25 0.5 1
+0.5 0.25 0.5 1
+
+
+0.25 0.25 0.5 1
+0.25 0.5 0.5 1
+
+
+0.5 0.25 0.5 1
+0.5 0.5 0.5 1
+
+
+0.25 0.5 0.5 1
+0.5 0.5 0.5 1
+
+
virtual
void
- compute_derived_quantities_vector (const std::vector<Vector<double> > &uh,
+ compute_derived_quantities_vector (const std::vector<Vector<double> > &solution_values,
const std::vector<std::vector<Tensor<1,dim> > > &,
const std::vector<std::vector<Tensor<2,dim> > > &,
const std::vector<Point<dim> > &,
const std::vector<Point<dim> > &,
std::vector<Vector<double> > &computed_quantities) const
{
- for (unsigned int q=0; q<uh.size(); ++q)
+ for (unsigned int q=0; q<solution_values.size(); ++q)
{
Assert (computed_quantities[q].size() == 1,
ExcInternalError());
- computed_quantities[q](0) = uh[q](0)*uh[q](0) + uh[q](1)*uh[q](1);
+ computed_quantities[q](0) = solution_values[q](0)*solution_values[q](0) + solution_values[q](1)*solution_values[q](1);
AssertThrow (std::fabs(computed_quantities[q](0)-1) < 1e-12,
ExcInternalError());
}
--- /dev/null
+// ---------------------------------------------------------------------
+//
+// Copyright (C) 2000 - 2016 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.
+//
+// ---------------------------------------------------------------------
+
+
+// tests DataPostprocessor: create a FE field that has two components of
+// the kind cos(something) and sin(something) and then have a postprocessor
+// that computes the sum of squares. should always be equal to one
+//
+// this test uses the shortcut class DataPostprocessorVector to make
+// writing postprocessors simpler
+
+
+#include "../tests.h"
+#include <deal.II/grid/tria.h>
+#include <deal.II/dofs/dof_handler.h>
+#include <deal.II/grid/grid_generator.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/fe/fe_q.h>
+#include <deal.II/fe/fe_system.h>
+#include <deal.II/base/function.h>
+#include <deal.II/numerics/vector_tools.h>
+#include <deal.II/numerics/matrix_tools.h>
+#include <deal.II/lac/vector.h>
+
+#include <deal.II/numerics/data_out.h>
+#include <deal.II/numerics/data_postprocessor.h>
+#include <fstream>
+
+#include <deal.II/base/logstream.h>
+
+
+std::ofstream logfile("output");
+
+
+template <int dim>
+class LaplaceProblem
+{
+public:
+ LaplaceProblem ();
+ void run ();
+
+private:
+ void make_grid_and_dofs ();
+ void solve ();
+ void output_results () const;
+
+ Triangulation<dim> triangulation;
+ FESystem<dim> fe;
+ DoFHandler<dim> dof_handler;
+
+ Vector<double> solution;
+};
+
+
+template <int dim>
+LaplaceProblem<dim>::LaplaceProblem ()
+ :
+ fe (FE_Q<dim>(1),2),
+ dof_handler (triangulation)
+{}
+
+
+
+template <int dim>
+void LaplaceProblem<dim>::make_grid_and_dofs ()
+{
+ GridGenerator::hyper_cube (triangulation, 0, 1);
+ triangulation.refine_global (1);
+ triangulation.begin_active()->set_refine_flag ();
+ triangulation.execute_coarsening_and_refinement ();
+
+ dof_handler.distribute_dofs (fe);
+ solution.reinit (dof_handler.n_dofs());
+}
+
+
+
+template <int dim>
+class SinesAndCosines : public Function<dim>
+{
+public:
+ SinesAndCosines ()
+ :
+ Function<dim> (2)
+ {}
+
+ double value (const Point<dim> &p,
+ const unsigned int component) const
+ {
+ switch (component)
+ {
+ case 0:
+ return std::sin (p.norm());
+ case 1:
+ return std::cos (p.norm());
+ default:
+ Assert (false, ExcNotImplemented());
+ return 0;
+ }
+ }
+};
+
+
+
+template <int dim>
+void LaplaceProblem<dim>::solve ()
+{
+ // dummy solve. just insert some
+ // values as mentioned at the top
+ // of the file
+ VectorTools::interpolate (dof_handler,
+ SinesAndCosines<dim>(),
+ solution);
+}
+
+
+template <int dim>
+class MyPostprocessor : public DataPostprocessorVector<dim>
+{
+public:
+ MyPostprocessor ()
+ :
+ DataPostprocessorVector<dim> ("magnitude_times_d", update_values)
+ {}
+
+ virtual
+ void
+ compute_derived_quantities_vector (const DataPostprocessorInputs::Vector<dim> &input_data,
+ std::vector<Vector<double> > &computed_quantities) const
+ {
+ for (unsigned int q=0; q<input_data.solution_values.size(); ++q)
+ {
+ Assert (computed_quantities[q].size() == dim,
+ ExcInternalError());
+
+ for (unsigned int d=0; d<dim; ++d)
+ computed_quantities[q](d) = input_data.solution_values[q](0)*input_data.solution_values[q](0) + input_data.solution_values[q](1)*input_data.solution_values[q](1);
+ AssertThrow (std::fabs(computed_quantities[q](0)-1) < 1e-12,
+ ExcInternalError());
+ }
+ }
+};
+
+
+
+template <int dim>
+void LaplaceProblem<dim>::output_results () const
+{
+ MyPostprocessor<dim> p;
+ DataOut<dim> data_out;
+ data_out.attach_dof_handler (dof_handler);
+ data_out.add_data_vector (solution, p);
+ data_out.build_patches ();
+ data_out.write_gnuplot (logfile);
+}
+
+
+
+template <int dim>
+void LaplaceProblem<dim>::run ()
+{
+ make_grid_and_dofs();
+ solve ();
+ output_results ();
+}
+
+
+
+int main ()
+{
+ logfile << std::setprecision(2);
+ deallog << std::setprecision(2);
+
+ LaplaceProblem<2> laplace_problem_2d;
+ laplace_problem_2d.run ();
+
+ LaplaceProblem<3> laplace_problem_3d;
+ laplace_problem_3d.run ();
+
+ return 0;
+}
--- /dev/null
+# This file was generated by the deal.II library.
+
+
+#
+# For a description of the GNUPLOT format see the GNUPLOT manual.
+#
+# <x> <y> <magnitude_times_d> <magnitude_times_d>
+0.5 0 1 1
+1 0 1 1
+
+0.5 0.5 1 1
+1 0.5 1 1
+
+
+0 0.5 1 1
+0.5 0.5 1 1
+
+0 1 1 1
+0.5 1 1 1
+
+
+0.5 0.5 1 1
+1 0.5 1 1
+
+0.5 1 1 1
+1 1 1 1
+
+
+0 0 1 1
+0.25 0 1 1
+
+0 0.25 1 1
+0.25 0.25 1 1
+
+
+0.25 0 1 1
+0.5 0 1 1
+
+0.25 0.25 1 1
+0.5 0.25 1 1
+
+
+0 0.25 1 1
+0.25 0.25 1 1
+
+0 0.5 1 1
+0.25 0.5 1 1
+
+
+0.25 0.25 1 1
+0.5 0.25 1 1
+
+0.25 0.5 1 1
+0.5 0.5 1 1
+
+
+# This file was generated by the deal.II library.
+
+
+#
+# For a description of the GNUPLOT format see the GNUPLOT manual.
+#
+# <x> <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.25 0.5 1 1 1
+0.25 0.25 0.5 1 1 1
+
+
+0 0.25 0.5 1 1 1
+0 0.5 0.5 1 1 1
+
+
+0.25 0.25 0.5 1 1 1
+0.25 0.5 0.5 1 1 1
+
+
+0 0.5 0.5 1 1 1
+0.25 0.5 0.5 1 1 1
+
+
+0.25 0.25 0.25 1 1 1
+0.5 0.25 0.25 1 1 1
+
+
+0.25 0.25 0.25 1 1 1
+0.25 0.5 0.25 1 1 1
+
+
+0.25 0.25 0.25 1 1 1
+0.25 0.25 0.5 1 1 1
+
+
+0.5 0.25 0.25 1 1 1
+0.5 0.5 0.25 1 1 1
+
+
+0.5 0.25 0.25 1 1 1
+0.5 0.25 0.5 1 1 1
+
+
+0.25 0.5 0.25 1 1 1
+0.5 0.5 0.25 1 1 1
+
+
+0.25 0.5 0.25 1 1 1
+0.25 0.5 0.5 1 1 1
+
+
+0.5 0.5 0.25 1 1 1
+0.5 0.5 0.5 1 1 1
+
+
+0.25 0.25 0.5 1 1 1
+0.5 0.25 0.5 1 1 1
+
+
+0.25 0.25 0.5 1 1 1
+0.25 0.5 0.5 1 1 1
+
+
+0.5 0.25 0.5 1 1 1
+0.5 0.5 0.5 1 1 1
+
+
+0.25 0.5 0.5 1 1 1
+0.5 0.5 0.5 1 1 1
+
+
virtual
void
- compute_derived_quantities_vector (const std::vector<Vector<double> > &uh,
+ compute_derived_quantities_vector (const std::vector<Vector<double> > &solution_values,
const std::vector<std::vector<Tensor<1,dim> > > &,
const std::vector<std::vector<Tensor<2,dim> > > &,
const std::vector<Point<dim> > &,
const std::vector<Point<dim> > &,
std::vector<Vector<double> > &computed_quantities) const
{
- for (unsigned int q=0; q<uh.size(); ++q)
+ for (unsigned int q=0; q<solution_values.size(); ++q)
{
Assert (computed_quantities[q].size() == dim,
ExcInternalError());
for (unsigned int d=0; d<dim; ++d)
- computed_quantities[q](d) = uh[q](0)*uh[q](0) + uh[q](1)*uh[q](1);
+ computed_quantities[q](d) = solution_values[q](0)*solution_values[q](0) + solution_values[q](1)*solution_values[q](1);
AssertThrow (std::fabs(computed_quantities[q](0)-1) < 1e-12,
ExcInternalError());
}
template <int dim>
void
Postprocess<dim>::compute_derived_quantities_vector (
- const std::vector< Vector< double > > &uh,
- const std::vector< std::vector< Tensor< 1, dim > > > &duh,
- const std::vector< std::vector< Tensor< 2, dim > > > &dduh,
+ const std::vector< Vector< double > > &solution_values,
+ const std::vector< std::vector< Tensor< 1, dim > > > &solution_gradients,
+ const std::vector< std::vector< Tensor< 2, dim > > > &solution_hessians,
const std::vector< Point< dim > > & /* normals */,
const std::vector< Point< dim > > & /* locations */,
std::vector< Vector< double > > &computed_quantities
) const
{
- Assert(computed_quantities.size() == uh.size(),
- ExcDimensionMismatch (computed_quantities.size(), uh.size()));
+ Assert(computed_quantities.size() == solution_values.size(),
+ ExcDimensionMismatch (computed_quantities.size(), solution_values.size()));
for (unsigned int i=0; i<computed_quantities.size(); i++)
{
Assert(computed_quantities[i].size() == 4,
ExcDimensionMismatch (computed_quantities[i].size(), 3));
- Assert(uh[i].size() == dim + 1, ExcDimensionMismatch (uh[i].size(), dim + 1));
+ Assert(solution_values[i].size() == dim + 1, ExcDimensionMismatch (solution_values[i].size(), dim + 1));
- computed_quantities[i](0) = duh[i][0].norm(); // norm of x gradient
- computed_quantities[i](1) = dduh[i][1].norm(); // norm of y hessian
- computed_quantities[i](2) = duh[i][0].norm() + dduh[i][1].norm(); // norm of y hessian
- computed_quantities[i](3) = uh[i].l2_norm();
+ computed_quantities[i](0) = solution_gradients[i][0].norm(); // norm of x gradient
+ computed_quantities[i](1) = solution_hessians[i][1].norm(); // norm of y hessian
+ computed_quantities[i](2) = solution_gradients[i][0].norm() + solution_hessians[i][1].norm(); // norm of y hessian
+ computed_quantities[i](3) = solution_values[i].l2_norm();
}
}
template <int dim>
void
Postprocess<dim>::compute_derived_quantities_scalar (
- const std::vector< double > &uh,
- const std::vector< Tensor< 1, dim > > &duh,
- const std::vector< Tensor< 2, dim > > &dduh,
+ const std::vector< double > &solution_values,
+ const std::vector< Tensor< 1, dim > > &solution_gradients,
+ const std::vector< Tensor< 2, dim > > &solution_hessians,
const std::vector< Point< dim > > & /* normals */,
const std::vector< Point< dim > > & /* locations */,
std::vector< Vector< double > > &computed_quantities
) const
{
- Assert(computed_quantities.size() == uh.size(),
- ExcDimensionMismatch (computed_quantities.size(), uh.size()));
+ Assert(computed_quantities.size() == solution_values.size(),
+ ExcDimensionMismatch (computed_quantities.size(), solution_values.size()));
for (unsigned int i=0; i<computed_quantities.size(); i++)
{
Assert(computed_quantities[i].size() == 2,
ExcDimensionMismatch (computed_quantities[i].size(), 2));
- computed_quantities[i](0) = duh[i][0]; // norm of x gradient
- computed_quantities[i](1) = dduh[i][0].norm(); // norm of x hessian
+ computed_quantities[i](0) = solution_gradients[i][0]; // norm of x gradient
+ computed_quantities[i](1) = solution_hessians[i][0].norm(); // norm of x hessian
}
}