public:
ComputeIntensity ();
+ using DataPostprocessorScalar<dim>::compute_derived_quantities_vector;
+
virtual
void
- 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;
+ compute_derived_quantities_vector
+ (const DataPostprocessorInputs::Vector<dim> &inputs,
+ std::vector<Vector<double> > &computed_quantities) const;
};
// In the constructor, we need to call the constructor of the base class
{}
- // The actual postprocessing happens in the following function. Its inputs
- // are a vector representing values of the function (which is here
- // vector-valued) representing the data vector given to
- // DataOut::add_data_vector, evaluated at all evaluation points where we
- // generate output, and some tensor objects representing derivatives (that
- // we don't use here since $|u|$ is computed from just $v$ and $w$, and for
- // which we assign no name to the corresponding function argument). The
- // derived quantities are returned in the <code>computed_quantities</code>
- // vector. Remember that this function may only use data for which the
- // respective update flag is specified by
+ // The actual postprocessing happens in the following function. Its input is
+ // an object that stores values of the function (which is here vector-valued)
+ // representing the data vector given to DataOut::add_data_vector, evaluated
+ // at all evaluation points where we generate output, and some tensor objects
+ // representing derivatives (that we don't use here since $|u|$ is computed
+ // from just $v$ and $w$). The derived quantities are returned in the
+ // <code>computed_quantities</code> vector. Remember that this function may
+ // only use data for which the respective update flag is specified by
// <code>get_needed_update_flags</code>. For example, we may not use the
// derivatives here, since our implementation of
// <code>get_needed_update_flags</code> requests that only function values
// are provided.
template <int dim>
void
- ComputeIntensity<dim>::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
+ ComputeIntensity<dim>::compute_derived_quantities_vector
+ (const DataPostprocessorInputs::Vector<dim> &inputs,
+ std::vector<Vector<double> > &computed_quantities) const
{
- Assert(computed_quantities.size() == solution_values.size(),
- ExcDimensionMismatch (computed_quantities.size(), solution_values.size()));
+ Assert(computed_quantities.size() == inputs.solution_values.size(),
+ ExcDimensionMismatch (computed_quantities.size(), inputs.solution_values.size()));
// The computation itself is straightforward: We iterate over each entry
// in the output vector and compute $|u|$ from the corresponding values of
{
Assert(computed_quantities[i].size() == 1,
ExcDimensionMismatch (computed_quantities[i].size(), 1));
- Assert(solution_values[i].size() == 2, ExcDimensionMismatch (solution_values[i].size(), 2));
+ Assert(inputs.solution_values[i].size() == 2,
+ ExcDimensionMismatch (inputs.solution_values[i].size(), 2));
- computed_quantities[i](0) = std::sqrt(solution_values[i](0)*solution_values[i](0) + solution_values[i](1)*solution_values[i](1));
+ computed_quantities[i](0)
+ = std::sqrt(inputs.solution_values[i](0)*inputs.solution_values[i](0)
+ + inputs.solution_values[i](1)*inputs.solution_values[i](1));
}
}
/* ---------------------------------------------------------------------
*
- * Copyright (C) 2008 - 2015 by the deal.II authors
+ * Copyright (C) 2008 - 2016 by the deal.II authors
*
* This file is part of the deal.II library.
*
Postprocessor (const unsigned int partition,
const double minimal_pressure);
+ using DataPostprocessor<dim>::compute_derived_quantities_vector;
+
virtual
void
- 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;
+ compute_derived_quantities_vector
+ (const DataPostprocessorInputs::Vector<dim> &inputs,
+ std::vector<Vector<double> > &computed_quantities) const;
virtual std::vector<std::string> get_names () const;
//
// The quantities we output here are more for illustration, rather than for
// actual scientific value. We come back to this briefly in the results
- // section of this program and explain what one may in fact be interested
- // in.
+ // section of this program and explain what one may in fact be interested in.
template <int dim>
void
BoussinesqFlowProblem<dim>::Postprocessor::
- 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
+ compute_derived_quantities_vector
+ (const DataPostprocessorInputs::Vector<dim> &inputs,
+ std::vector<Vector<double> > &computed_quantities) const
{
- const unsigned int n_quadrature_points = solution_values.size();
- Assert (solution_gradients.size() == n_quadrature_points, ExcInternalError());
- Assert (computed_quantities.size() == n_quadrature_points, ExcInternalError());
- Assert (solution_values[0].size() == dim+2, ExcInternalError());
+ const unsigned int n_quadrature_points = inputs.solution_values.size();
+ Assert (inputs.solution_gradients.size() == n_quadrature_points,
+ ExcInternalError());
+ Assert (computed_quantities.size() == n_quadrature_points,
+ ExcInternalError());
+ Assert (inputs.solution_values[0].size() == dim+2,
+ ExcInternalError());
for (unsigned int q=0; q<n_quadrature_points; ++q)
{
for (unsigned int d=0; d<dim; ++d)
computed_quantities[q](d)
- = (solution_values[q](d) * EquationData::year_in_seconds * 100);
+ = (inputs.solution_values[q](d) * EquationData::year_in_seconds * 100);
- const double pressure = (solution_values[q](dim)-minimal_pressure);
+ const double pressure = (inputs.solution_values[q](dim)-minimal_pressure);
computed_quantities[q](dim) = pressure;
- const double temperature = solution_values[q](dim+1);
+ const double temperature = inputs.solution_values[q](dim+1);
computed_quantities[q](dim+1) = temperature;
Tensor<2,dim> grad_u;
for (unsigned int d=0; d<dim; ++d)
- grad_u[d] = solution_gradients[q][d];
+ grad_u[d] = inputs.solution_gradients[q][d];
const SymmetricTensor<2,dim> strain_rate = symmetrize (grad_u);
computed_quantities[q](dim+2) = 2 * EquationData::eta *
strain_rate * strain_rate;
/* ---------------------------------------------------------------------
*
- * Copyright (C) 2007 - 2015 by the deal.II authors
+ * Copyright (C) 2007 - 2016 by the deal.II authors
*
* This file is part of the deal.II library.
*
public:
Postprocessor (const bool do_schlieren_plot);
+ using DataPostprocessor<dim>::compute_derived_quantities_vector;
+
virtual
void
- 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;
+ compute_derived_quantities_vector
+ (const DataPostprocessorInputs::Vector<dim> &inputs,
+ std::vector<Vector<double> > &computed_quantities) const;
virtual std::vector<std::string> get_names () const;
// This is the only function worth commenting on. When generating graphical
// output, the DataOut and related classes will call this function on each
- // cell, with values, gradients, Hessians, and normal vectors (in case we're
- // working on faces) at each quadrature point. Note that the data at each
- // quadrature point is itself vector-valued, namely the conserved
+ // cell, with access to values, gradients, Hessians, and normal vectors (in
+ // case we're working on faces) at each quadrature point. Note that the data
+ // at each quadrature point is itself vector-valued, namely the conserved
// variables. What we're going to do here is to compute the quantities we're
// interested in at each quadrature point. Note that for this we can ignore
- // the Hessians ("solution_hessians") and normal vectors; to avoid compiler warnings
- // about unused variables, we comment out their names.
+ // the Hessians ("inputs.solution_hessians") and normal vectors
+ // ("inputs.normals").
template <int dim>
void
EulerEquations<dim>::Postprocessor::
- 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
+ compute_derived_quantities_vector
+ (const DataPostprocessorInputs::Vector<dim> &inputs,
+ std::vector<Vector<double> > &computed_quantities) const
{
// At the beginning of the function, let us make sure that all variables
// have the correct sizes, so that we can access individual vector
// we say so in the <code>get_needed_update_flags()</code> function
// below). For the inner vectors, we check that at least the first element
// of the outer vector has the correct inner size:
- const unsigned int n_quadrature_points = solution_values.size();
+ const unsigned int n_quadrature_points = inputs.solution_values.size();
if (do_schlieren_plot == true)
- Assert (solution_gradients.size() == n_quadrature_points,
+ Assert (inputs.solution_gradients.size() == n_quadrature_points,
ExcInternalError());
Assert (computed_quantities.size() == n_quadrature_points,
ExcInternalError());
- Assert (solution_values[0].size() == n_components,
+ Assert (inputs.solution_values[0].size() == n_components,
ExcInternalError());
if (do_schlieren_plot == true)
// <code>density_component</code> information:
for (unsigned int q=0; q<n_quadrature_points; ++q)
{
- const double density = solution_values[q](density_component);
+ const double density = inputs.solution_values[q](density_component);
for (unsigned int d=0; d<dim; ++d)
computed_quantities[q](d)
- = solution_values[q](first_momentum_component+d) / density;
+ = inputs.solution_values[q](first_momentum_component+d) / density;
- computed_quantities[q](dim) = compute_pressure (solution_values[q]);
+ computed_quantities[q](dim) = compute_pressure (inputs.solution_values[q]);
if (do_schlieren_plot == true)
- computed_quantities[q](dim+1) = solution_gradients[q][density_component] *
- solution_gradients[q][density_component];
+ computed_quantities[q](dim+1) = inputs.solution_gradients[q][density_component] *
+ inputs.solution_gradients[q][density_component];
}
}
/* ---------------------------------------------------------------------
*
- * Copyright (C) 2011 - 2015 by the deal.II authors
+ * Copyright (C) 2011 - 2016 by the deal.II authors
*
* This file is part of the deal.II library.
*
class Postprocessor : public DataPostprocessor<dim>
{
public:
+ using DataPostprocessor<dim>::compute_derived_quantities_vector;
+
virtual
void
- 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;
+ compute_derived_quantities_vector
+ (const dealii::DataPostprocessorInputs::Vector<dim> &inputs,
+ std::vector<Vector<double> > &computed_quantities) const;
virtual std::vector<std::string> get_names () const;
template <int dim>
void
Postprocessor<dim>::
- 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
+ compute_derived_quantities_vector
+ (const dealii::DataPostprocessorInputs::Vector<dim> &inputs,
+ std::vector<Vector<double> > &computed_quantities) const
{
- const unsigned int n_quadrature_points = solution_values.size();
- Assert (computed_quantities.size() == n_quadrature_points, ExcInternalError());
- Assert (solution_values[0].size() == 2, ExcInternalError());
+ const unsigned int n_quadrature_points = inputs.solution_values.size();
+ Assert (computed_quantities.size() == n_quadrature_points,
+ ExcInternalError());
+ Assert (inputs.solution_values[0].size() == 2,
+ ExcInternalError());
for (unsigned int q=0; q<n_quadrature_points; ++q)
{
computed_quantities[q](0)
- = (solution_values[q](0)
+ = (inputs.solution_values[q](0)
+
//TODO: shift in weight function is missing!
- solution_values[q](1) * std::fabs(level_set(evaluation_points[q])));
+ inputs.solution_values[q](1) * std::fabs(level_set(inputs.evaluation_points[q])));
computed_quantities[q](1)
= (computed_quantities[q](0)
-
- exact_solution (evaluation_points[q]));
+ exact_solution (inputs.evaluation_points[q]));
}
}