]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Adjust order of parameters such that the output parameter comes last.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 13 Sep 2007 23:40:09 +0000 (23:40 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 13 Sep 2007 23:40:09 +0000 (23:40 +0000)
git-svn-id: https://svn.dealii.org/trunk@15210 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/numerics/data_postprocessor.h
deal.II/deal.II/source/numerics/data_out.cc
deal.II/deal.II/source/numerics/data_out_faces.cc
deal.II/deal.II/source/numerics/data_out_rotation.cc
deal.II/deal.II/source/numerics/data_postprocessor.cc
deal.II/examples/step-29/step-29.cc

index 2f9e3c804edb6a1f7968683c76964033b8a57ec2..27639bb569d92c72c0c169d4ab14d4b1e578d14d 100644 (file)
@@ -28,11 +28,14 @@ DEAL_II_NAMESPACE_OPEN
 
 /**
  * For the (graphical) output of a FE solution one frequently wants to include
- * derived quantities, which are calculated from the values of the solution and
- * possibly the first and second derivates of the solution. This class offers
- * the interface to perform such a postprocessing. Given the values and
- * derivatives of provided dataon given points of a cell, new quantities can be
- * calculated.
+ * derived quantities, which are calculated from the values of the solution
+ * and possibly the first and second derivates of the solution. Examples are
+ * the calculation Mach numbers from velocity and density in supersonic flow
+ * computations, or the computation of the magnitude of a complex-valued
+ * solution as demonstrated in @ref step_29 "step-29".  This class offers the
+ * interface to perform such postprocessing. Given the values and derivatives
+ * of the solution at those points where we want to generated output, the
+ * functions of this class can be overloaded to compute new quantities.
  *
  * A data vector and an object of a derived class can be given to the
  * <tt>DataOut::add_data_vector</tt> function, which will write the derived
@@ -77,7 +80,7 @@ class DataPostprocessor: public Subscriptor
 
                                     /**
                                      * This is the main function which actually
-                                     * performs the postprocessing. The first
+                                     * performs the postprocessing. The last
                                      * argument is a reference to the
                                      * postprocessed data which has correct
                                      * size already and must be filled by this
@@ -104,11 +107,11 @@ class DataPostprocessor: public Subscriptor
                                      */
     virtual
     void
-    compute_derived_quantities_scalar (std::vector<Vector<double> >      &computed_quantities,
-                                      const std::vector<double>         &uh,
+    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<Point<dim> >    &normals) const;
+                                      const std::vector<Point<dim> >    &normals,
+                                      std::vector<Vector<double> >      &computed_quantities) const;
     
                                     /**
                                      * Same as above function, but
@@ -121,11 +124,11 @@ class DataPostprocessor: public Subscriptor
                                      */
     virtual
     void
-    compute_derived_quantities_vector (std::vector<Vector<double> >                    &computed_quantities,
-                                      const std::vector<Vector<double> >              &uh,
+    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<Point<dim> >                  &normals) const;
+                                      const std::vector<Point<dim> >                  &normals,
+                                      std::vector<Vector<double> >                    &computed_quantities) const;
 
                                     /**
                                      * Return the vector of strings describing
index 06af410fd3d4f1179640fd4398d1036a8abc6a8d..2d6622b26ccd8be5f7ca3406f1971f6d19b2a5d2 100644 (file)
@@ -617,11 +617,11 @@ void DataOut<dim,DH>::build_some_patches (Data &data)
                        this->dof_data[dataset]->get_function_second_derivatives (fe_patch_values,
                                                                                  data.patch_second_derivatives);
                      postprocessor->
-                       compute_derived_quantities_scalar(data.postprocessed_values[dataset],
-                                                         data.patch_values,
+                       compute_derived_quantities_scalar(data.patch_values,
                                                          data.patch_gradients,
                                                          data.patch_second_derivatives,
-                                                         data.dummy_normals);
+                                                         data.dummy_normals,
+                                                         data.postprocessed_values[dataset]);
                    }
                  else
                    {
@@ -639,11 +639,11 @@ void DataOut<dim,DH>::build_some_patches (Data &data)
                        this->dof_data[dataset]->get_function_second_derivatives (fe_patch_values,
                                                                                  data.patch_second_derivatives_system);
                      postprocessor->
-                       compute_derived_quantities_vector(data.postprocessed_values[dataset],
-                                                         data.patch_values_system,
+                       compute_derived_quantities_vector(data.patch_values_system,
                                                          data.patch_gradients_system,
                                                          data.patch_second_derivatives_system,
-                                                         data.dummy_normals);
+                                                         data.dummy_normals,
+                                                         data.postprocessed_values[dataset]);
                    }
                  
                  for (unsigned int q=0; q<n_q_points; ++q)
index 6faa708934130664a87ce88bc114340ccae63d76..226382698666141bc372cb13690080f6e5408d1e 100644 (file)
@@ -132,11 +132,11 @@ void DataOutFaces<dim,DH>::build_some_patches (Data &data)
                        this->dof_data[dataset]->get_function_second_derivatives (fe_patch_values,
                                                                                  data.patch_second_derivatives);
                      postprocessor->
-                       compute_derived_quantities_scalar(data.postprocessed_values[dataset],
-                                                         data.patch_values,
+                       compute_derived_quantities_scalar(data.patch_values,
                                                          data.patch_gradients,
                                                          data.patch_second_derivatives,
-                                                         data.patch_normals);
+                                                         data.patch_normals,
+                                                         data.postprocessed_values[dataset]);
                    }
                  else
                    {
@@ -154,11 +154,11 @@ void DataOutFaces<dim,DH>::build_some_patches (Data &data)
                        this->dof_data[dataset]->get_function_second_derivatives (fe_patch_values,
                                                                                  data.patch_second_derivatives_system);
                      postprocessor->
-                       compute_derived_quantities_vector(data.postprocessed_values[dataset],
-                                                         data.patch_values_system,
+                       compute_derived_quantities_vector(data.patch_values_system,
                                                          data.patch_gradients_system,
                                                          data.patch_second_derivatives_system,
-                                                         data.patch_normals);
+                                                         data.patch_normals,
+                                                         data.postprocessed_values[dataset]);
                    }
                  
                  for (unsigned int q=0; q<n_q_points; ++q)
index d81d9ab687762ead080ce1c55bf3f1fc24aae585..a76adfb4f33169309dab3dc3b7e1a53dfb0a738d 100644 (file)
@@ -216,11 +216,11 @@ void DataOutRotation<dim,DH>::build_some_patches (Data &data)
                            this->dof_data[dataset]->get_function_second_derivatives (fe_patch_values,
                                                                                      data.patch_second_derivatives);
                          postprocessor->
-                           compute_derived_quantities_scalar(data.postprocessed_values[dataset],
-                                                             data.patch_values,
+                           compute_derived_quantities_scalar(data.patch_values,
                                                              data.patch_gradients,
                                                              data.patch_second_derivatives,
-                                                             data.dummy_normals);
+                                                             data.dummy_normals,
+                                                             data.postprocessed_values[dataset]);
                        }
                      else
                        {
@@ -238,11 +238,11 @@ void DataOutRotation<dim,DH>::build_some_patches (Data &data)
                            this->dof_data[dataset]->get_function_second_derivatives (fe_patch_values,
                                                                                      data.patch_second_derivatives_system);
                          postprocessor->
-                           compute_derived_quantities_vector(data.postprocessed_values[dataset],
-                                                             data.patch_values_system,
+                           compute_derived_quantities_vector(data.patch_values_system,
                                                              data.patch_gradients_system,
                                                              data.patch_second_derivatives_system,
-                                                             data.dummy_normals);
+                                                             data.dummy_normals,
+                                                             data.postprocessed_values[dataset]);
                        }
                      
                      for (unsigned int component=0;
index d3e1190d99da053f7727152f99fba280b008805f..61ea0bd6bb8b862c904bd2e7eda7e56efd36eb29 100644 (file)
@@ -24,11 +24,11 @@ DataPostprocessor<dim>::~DataPostprocessor()
 template <int dim>
 void
 DataPostprocessor<dim>::
-compute_derived_quantities_scalar (std::vector<Vector<double> >      &computed_quantities,
-                                  const std::vector<double>         &/*uh*/,
+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<Point<dim> >    &/*normals*/) const
+                                  const std::vector<Point<dim> >    &/*normals*/,
+                                  std::vector<Vector<double> >      &computed_quantities) const
 {
   computed_quantities.clear();
   AssertThrow(false,ExcPureFunctionCalled());
@@ -39,11 +39,11 @@ compute_derived_quantities_scalar (std::vector<Vector<double> >      &computed_q
 template <int dim>
 void
 DataPostprocessor<dim>::
-compute_derived_quantities_vector (std::vector<Vector<double> >                    &computed_quantities,
-                                  const std::vector<Vector<double> >              &/*uh*/,
+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<Point<dim> >                  &/*normals*/) const
+                                  const std::vector<Point<dim> >                  &/*normals*/,
+                                  std::vector<Vector<double> >                    &computed_quantities) const
 {
   computed_quantities.clear();
   AssertThrow(false,ExcPureFunctionCalled());
index 86ad0c2d769c62c8f0305291dc8d9dfeebbfc96e..7b9547486e2491df86a3448ca0943d9907cda4c7 100644 (file)
@@ -155,11 +155,11 @@ class Postprocessor : public DataPostprocessor<dim>
   public:
 
     void compute_derived_quantities_vector (
-                       std::vector< Vector< double > > &,
                        const std::vector< Vector< double > > &, 
                        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 > > &
                        ) const;
 
     std::vector<std::string> get_names () const;
@@ -201,11 +201,11 @@ Postprocessor<dim>::n_output_variables () const
 template <int dim>
 void
 Postprocessor<dim>::compute_derived_quantities_vector (
-                       std::vector< Vector< double > >                       &computed_quantities,
                        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< Point< dim > >                     &/*normals*/
+                       const std::vector< Point< dim > >                     &/*normals*/,
+                       std::vector< Vector< double > >                       &computed_quantities
                        ) const
 {
   Assert(computed_quantities.size() == uh.size(), 

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.