]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rename DataPostprocessor functions. 3664/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 7 Dec 2016 17:14:19 +0000 (10:14 -0700)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 7 Dec 2016 17:14:19 +0000 (10:14 -0700)
In #3333, I added virtual functions to DataPostprocessor with the same name as the existing
functions. This leads to issues where we get a warning in every derived class that only
overloads one of these functions, because that hides the other function. This is, well,
suboptimal.

This patch is therefore a redo of my earlier attempt in which I continue to deprecate
the old functions, but the new functions have a different name. I think they also
have a better name (for a discussion of the naming, see
https://github.com/geodynamics/aspect/issues/1284 ). The different names avoid the
problem of getting the warning and should therefore lead to less discontent. They
also avoid the need to try to work around the warnings using 'using' declarations, like
in #3528.

15 files changed:
doc/news/changes.h
examples/step-29/step-29.cc
examples/step-32/step-32.cc
examples/step-33/step-33.cc
examples/step-47/step-47.cc
include/deal.II/numerics/data_postprocessor.h
source/numerics/data_out.cc
source/numerics/data_out_faces.cc
source/numerics/data_out_rotation.cc
source/numerics/data_postprocessor.cc
tests/numerics/data_out_postprocessor_01-new.cc
tests/numerics/data_out_postprocessor_scalar_01-new.cc
tests/numerics/data_out_postprocessor_scalar_01.cc
tests/numerics/data_out_postprocessor_vector_01-new.cc
tests/numerics/data_out_postprocessor_vector_01.cc

index 401747de2768059361679f02406177ac4d047a67..47a7e2f06776a8342a1b6870817cd892e0690722 100644 (file)
@@ -270,7 +270,8 @@ inconvenience this causes.
     Rather than adding each possible argument anyone may want to use
     individually to the list of the postprocessor function arguments, the
     existing functions have been deprecated in favor of a new set of
-    functions that
+    functions DataPostprocessor::evaluate_scalar_field() and
+    DataPostprocessor::evaluate_vector_field() that
     take a reference to a structure that contains these individual pieces
     of information. We can extend the members of these structures without
     backward compatibility issues because the functions still get a
index 4732319ecc158001f84ae1b2dd53543f5fba7a1a..1d6acef8ba90edd8cf3226dd2607debd3b84bb7b 100644 (file)
@@ -273,8 +273,8 @@ namespace Step29
   // version of this function that in addition to the data vector has an
   // additional argument of type DataPostprocessor. What happens when this
   // function is used for output is that at each point where output data is to
-  // be generated, the DataPostprocessor::compute_derived_quantities_scalar or
-  // DataPostprocessor::compute_derived_quantities_vector function of the
+  // be generated, the DataPostprocessor::evaluate_scalar_field() or
+  // DataPostprocessor::evaluate_vector_field() function of the
   // specified DataPostprocessor object is invoked to compute the output
   // quantities from the values, the gradients and the second derivatives of
   // the finite element function represented by the data vector (in the case
@@ -298,11 +298,9 @@ namespace Step29
   public:
     ComputeIntensity ();
 
-    using DataPostprocessorScalar<dim>::compute_derived_quantities_vector;
-
     virtual
     void
-    compute_derived_quantities_vector
+    evaluate_vector_field
     (const DataPostprocessorInputs::Vector<dim> &inputs,
      std::vector<Vector<double> >               &computed_quantities) const;
   };
@@ -343,7 +341,7 @@ namespace Step29
   // are provided.
   template <int dim>
   void
-  ComputeIntensity<dim>::compute_derived_quantities_vector
+  ComputeIntensity<dim>::evaluate_vector_field
   (const DataPostprocessorInputs::Vector<dim> &inputs,
    std::vector<Vector<double> >               &computed_quantities) const
   {
index 6d0812ce236a31014100c0ac6c5a46f5ed289eb5..00e7ee0e1fe71bcc112334d42ba39e8cb0c80028 100644 (file)
@@ -3136,8 +3136,8 @@ namespace Step32
   // inherits from the class DataPostprocessor, which can be attached to
   // DataOut. This allows us to output derived quantities from the solution,
   // like the friction heating included in this example. It overloads the
-  // virtual function DataPostprocessor::compute_derived_quantities_vector,
-  // which is then internally called from DataOut::build_patches. We have to
+  // virtual function DataPostprocessor::evaluate_vector_field(),
+  // which is then internally called from DataOut::build_patches(). We have to
   // give it values of the numerical solution, its derivatives, normals to the
   // cell, the actual evaluation points and any additional quantities. This
   // follows the same procedure as discussed in step-29 and other programs.
@@ -3148,11 +3148,9 @@ namespace Step32
     Postprocessor (const unsigned int partition,
                    const double       minimal_pressure);
 
-    using DataPostprocessor<dim>::compute_derived_quantities_vector;
-
     virtual
     void
-    compute_derived_quantities_vector
+    evaluate_vector_field
     (const DataPostprocessorInputs::Vector<dim> &inputs,
      std::vector<Vector<double> >               &computed_quantities) const;
 
@@ -3240,7 +3238,7 @@ namespace Step32
   template <int dim>
   void
   BoussinesqFlowProblem<dim>::Postprocessor::
-  compute_derived_quantities_vector
+  evaluate_vector_field
   (const DataPostprocessorInputs::Vector<dim> &inputs,
    std::vector<Vector<double> >               &computed_quantities) const
   {
index 1ce831f0fa38ffb69e094b97d0ffc779862233cc..9aa53c9235daa60c8fd0d91eaed1658d658b0e11 100644 (file)
@@ -541,11 +541,9 @@ namespace Step33
     public:
       Postprocessor (const bool do_schlieren_plot);
 
-      using DataPostprocessor<dim>::compute_derived_quantities_vector;
-
       virtual
       void
-      compute_derived_quantities_vector
+      evaluate_vector_field
       (const DataPostprocessorInputs::Vector<dim> &inputs,
        std::vector<Vector<double> >               &computed_quantities) const;
 
@@ -588,7 +586,7 @@ namespace Step33
   template <int dim>
   void
   EulerEquations<dim>::Postprocessor::
-  compute_derived_quantities_vector
+  evaluate_vector_field
   (const DataPostprocessorInputs::Vector<dim> &inputs,
    std::vector<Vector<double> >               &computed_quantities) const
   {
index 226c03f70ee04b4214c9c074a609afc9e357ecdb..98cd5b4f073d3aa92d4441229f8976222f8ff019 100644 (file)
@@ -903,11 +903,9 @@ namespace Step47
   class Postprocessor : public DataPostprocessor<dim>
   {
   public:
-    using DataPostprocessor<dim>::compute_derived_quantities_vector;
-
     virtual
     void
-    compute_derived_quantities_vector
+    evaluate_vector_field
     (const dealii::DataPostprocessorInputs::Vector<dim> &inputs,
      std::vector<Vector<double> >                       &computed_quantities) const;
 
@@ -954,7 +952,7 @@ namespace Step47
   template <int dim>
   void
   Postprocessor<dim>::
-  compute_derived_quantities_vector
+  evaluate_vector_field
   (const dealii::DataPostprocessorInputs::Vector<dim> &inputs,
    std::vector<Vector<double> >                       &computed_quantities) const
   {
index de652967afa8e329a7c7d476a55a27757ef552de..4348172a7577a9c7bd73b32e9d559eec86ad6b96 100644 (file)
@@ -39,7 +39,7 @@ namespace DataPostprocessorInputs
 {
   /**
    * A structure that is used to pass information to
-   * DataPostprocessor::compute_derived_quantities_scalar(). It contains
+   * DataPostprocessor::evaluate_scalar_field(). It contains
    * the values and (if requested) derivatives of a scalar solution
    * variable at the evaluation points on a cell or face. If appropriate,
    * it also contains the normal vectors to the geometry on which output
@@ -122,7 +122,7 @@ namespace DataPostprocessorInputs
 
   /**
    * A structure that is used to pass information to
-   * DataPostprocessor::compute_derived_quantities_vector(). It contains
+   * DataPostprocessor::evaluate_vector_field(). It contains
    * the values and (if requested) derivatives of a vector-valued solution
    * variable at the evaluation points on a cell or face. If appropriate,
    * it also contains the normal vectors to the geometry on which output
@@ -255,8 +255,8 @@ namespace DataPostprocessorInputs
  * function get_needed_update_flags(). It is your responsibility to use only
  * those values which were updated in the calculation of derived quantities.
  * The DataOut object will provide references to the requested data in the
- * call to compute_derived_quantities_scalar() or
- * compute_derived_quantities_vector() (DataOut decides which of the two
+ * call to evaluate_scalar_field() or
+ * evaluate_vector_field() (DataOut decides which of the two
  * functions to call depending on whether the finite element in use has only a
  * single, or multiple vector components; note that this is only determined by
  * the number of components in the finite element in use, and not by whether
@@ -279,8 +279,7 @@ namespace DataPostprocessorInputs
  * hand, in step-29 we implement a postprocessor that only computes the
  * magnitude of a complex number given by a two-component finite element. It
  * seems silly to have to implement four virtual functions for this
- * (compute_derived_quantities_scalar() or
- * compute_derived_quantities_vector(), get_names(), get_update_flags() and
+ * (evaluate_scalar_field() or evaluate_vector_field(), get_names(), get_update_flags() and
  * get_data_component_interpretation()).
  *
  * To this end there are two classes DataPostprocessorScalar and
@@ -326,12 +325,12 @@ public:
    */
   virtual
   void
-  compute_derived_quantities_scalar (const DataPostprocessorInputs::Scalar<dim> &input_data,
-                                     std::vector<Vector<double> >               &computed_quantities) const;
+  evaluate_scalar_field (const DataPostprocessorInputs::Scalar<dim> &input_data,
+                         std::vector<Vector<double> >               &computed_quantities) const;
 
   /**
    * @deprecated This function is deprecated. It has been superseded by
-   * function of same name above that receives a superset of the
+   * the evaluate_scalar_field() function that receives a superset of the
    * information provided to the current function through the members
    * of the structure it receives as the first argument.
    *
@@ -359,18 +358,18 @@ public:
                                      std::vector<Vector<double> >      &computed_quantities) const DEAL_II_DEPRECATED;
 
   /**
-   * Same as the compute_derived_quantities_scalar() function, but this
+   * Same as the evaluate_scalar_field() function, but this
    * function is called when the original data vector represents vector data,
    * i.e. the finite element in use has multiple vector components.
    */
   virtual
   void
-  compute_derived_quantities_vector (const DataPostprocessorInputs::Vector<dim> &input_data,
-                                     std::vector<Vector<double> >               &computed_quantities) const;
+  evaluate_vector_field (const DataPostprocessorInputs::Vector<dim> &input_data,
+                         std::vector<Vector<double> >               &computed_quantities) const;
 
   /**
    * @deprecated This function is deprecated. It has been superseded by
-   * function of same name above that receives a superset of the
+   * the evaluate_vector_field() function that receives a superset of the
    * information provided to the current function through the members
    * of the structure it receives as the first argument.
    *
@@ -452,8 +451,8 @@ public:
  * functions by hand.
  *
  * All derived classes have to do is implement a constructor and overload
- * either DataPostprocessor::compute_derived_quantities_scalar() or
- * DataPostprocessor::compute_derived_quantities_vector().
+ * either DataPostprocessor::evaluate_scalar_field() or
+ * DataPostprocessor::evaluate_vector_field().
  *
  * An example of how this class can be used can be found in step-29.
  *
@@ -526,8 +525,8 @@ private:
  * functions by hand.
  *
  * All derived classes have to do is implement a constructor and overload
- * either DataPostprocessor::compute_derived_quantities_scalar() or
- * DataPostprocessor::compute_derived_quantities_vector().
+ * either DataPostprocessor::evaluate_scalar_field() or
+ * DataPostprocessor::evaluate_vector_field().
  *
  * An example of how the closely related class DataPostprocessorScalar is used
  * can be found in step-29.
index 516b096519bd437a7a63f1a15f1d9717706ac81d..eaa4d63f5359c92832afafaa3cfc98b68f832065 100644 (file)
@@ -169,8 +169,8 @@ build_one_patch
 
 
                   postprocessor->
-                  compute_derived_quantities_scalar(scratch_data.patch_values_scalar,
-                                                    scratch_data.postprocessed_values[dataset]);
+                  evaluate_scalar_field(scratch_data.patch_values_scalar,
+                                        scratch_data.postprocessed_values[dataset]);
                 }
               else
                 {
@@ -192,8 +192,8 @@ build_one_patch
                     scratch_data.patch_values_system.evaluation_points = this_fe_patch_values.get_quadrature_points();
 
                   postprocessor->
-                  compute_derived_quantities_vector(scratch_data.patch_values_system,
-                                                    scratch_data.postprocessed_values[dataset]);
+                  evaluate_vector_field(scratch_data.patch_values_system,
+                                        scratch_data.postprocessed_values[dataset]);
                 }
 
               for (unsigned int q=0; q<n_q_points; ++q)
index 29e98f417315f16d4bbfba6755c43d5c4ea84bfe..a510aae6b0e66362acbd64bf4f2d1c5abdb1d9b0 100644 (file)
@@ -170,8 +170,8 @@ build_one_patch (const FaceDescriptor *cell_and_face,
                     data.patch_values_scalar.normals = this_fe_patch_values.get_all_normal_vectors();
 
                   postprocessor->
-                  compute_derived_quantities_scalar(data.patch_values_scalar,
-                                                    data.postprocessed_values[dataset]);
+                  evaluate_scalar_field(data.patch_values_scalar,
+                                        data.postprocessed_values[dataset]);
                 }
               else
                 {
@@ -195,8 +195,8 @@ build_one_patch (const FaceDescriptor *cell_and_face,
                     data.patch_values_system.normals = this_fe_patch_values.get_all_normal_vectors();
 
                   postprocessor->
-                  compute_derived_quantities_vector(data.patch_values_system,
-                                                    data.postprocessed_values[dataset]);
+                  evaluate_vector_field(data.patch_values_system,
+                                        data.postprocessed_values[dataset]);
                 }
 
               for (unsigned int q=0; q<n_q_points; ++q)
index 4b14ef7265fbc80428dfa97bfa378b666117f782..36c4aca01a17f2fc0e6653c64329384af73a2abf 100644 (file)
@@ -217,8 +217,8 @@ build_one_patch (const cell_iterator
                         data.patch_values_scalar.evaluation_points = fe_patch_values.get_quadrature_points();
 
                       postprocessor->
-                      compute_derived_quantities_scalar(data.patch_values_scalar,
-                                                        data.postprocessed_values[dataset]);
+                      evaluate_scalar_field(data.patch_values_scalar,
+                                            data.postprocessed_values[dataset]);
                     }
                   else
                     {
@@ -241,8 +241,8 @@ build_one_patch (const cell_iterator
 
                       std::vector<Point<space_dimension> > dummy_normals;
                       postprocessor->
-                      compute_derived_quantities_vector(data.patch_values_system,
-                                                        data.postprocessed_values[dataset]);
+                      evaluate_vector_field(data.patch_values_system,
+                                            data.postprocessed_values[dataset]);
                     }
 
                   for (unsigned int component=0;
index a3ab1cb0928a1e15b0e0461478855bd91924a476..8d0154db1955bcefd79b99c3eef42386d7ae2e7f 100644 (file)
@@ -30,8 +30,8 @@ DataPostprocessor<dim>::~DataPostprocessor()
 template <int dim>
 void
 DataPostprocessor<dim>::
-compute_derived_quantities_scalar (const DataPostprocessorInputs::Scalar<dim> &inputs,
-                                   std::vector<Vector<double> >               &computed_quantities) const
+evaluate_scalar_field (const DataPostprocessorInputs::Scalar<dim> &inputs,
+                       std::vector<Vector<double> >               &computed_quantities) const
 {
   // for backward compatibility, call the old function.
   // this also requires converting the accidental use
@@ -67,8 +67,8 @@ compute_derived_quantities_scalar (const std::vector<double>         &/*solution
 template <int dim>
 void
 DataPostprocessor<dim>::
-compute_derived_quantities_vector (const DataPostprocessorInputs::Vector<dim> &inputs,
-                                   std::vector<Vector<double> >               &computed_quantities) const
+evaluate_vector_field (const DataPostprocessorInputs::Vector<dim> &inputs,
+                       std::vector<Vector<double> >               &computed_quantities) const
 {
   // for backward compatibility, call the old function.
   // this also requires converting the accidental use
index 228a73522af74f27b176623649ca4831fd704009..dc5d6f8119f16e5289caaa5cf793e3336865deaa 100644 (file)
@@ -150,8 +150,8 @@ public:
 
   virtual
   void
-  compute_derived_quantities_vector (const DataPostprocessorInputs::Vector<dim> &input_data,
-                                     std::vector<Vector<double> >                    &computed_quantities) const
+  evaluate_vector_field (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)
       {
index cd6e43ff6439ae0398bcb8aed4796e340356e812..f43b60fff8807663682e40576ba87c793fcbc3c6 100644 (file)
@@ -139,8 +139,8 @@ public:
 
   virtual
   void
-  compute_derived_quantities_vector (const DataPostprocessorInputs::Vector<dim> &input_data,
-                                     std::vector<Vector<double> >                    &computed_quantities) const
+  evaluate_vector_field (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)
       {
index c9342ca9f2cd2d5434a5843853700560ac8bba7f..00c76c719aea19c669490c00ca3eed22a67ba13c 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2000 - 2015 by the deal.II authors
+// Copyright (C) 2000 - 2016 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
index 1dce52214b17c90e3a373d45b1f2deeaeeff734a..8343cf76d57bba2574c15636e7704af62eb1806b 100644 (file)
@@ -139,8 +139,8 @@ public:
 
   virtual
   void
-  compute_derived_quantities_vector (const DataPostprocessorInputs::Vector<dim> &input_data,
-                                     std::vector<Vector<double> >                    &computed_quantities) const
+  evaluate_vector_field (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)
       {
index 84af679c0df7c81e48eeb9a3380a34586b904c95..e45b24585554ce8a68f720649a0d253cf1884b0f 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2000 - 2015 by the deal.II authors
+// Copyright (C) 2000 - 2016 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //

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.