]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Rename compute_derived_quantities to two different names for the scalar and vector...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 13 Sep 2007 15:47:20 +0000 (15:47 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Thu, 13 Sep 2007 15:47:20 +0000 (15:47 +0000)
git-svn-id: https://svn.dealii.org/trunk@15205 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 e24f1b8fe28c622494da5d2861d41c7df078e842..2f9e3c804edb6a1f7968683c76964033b8a57ec2 100644 (file)
@@ -40,17 +40,21 @@ DEAL_II_NAMESPACE_OPEN
  * DataPostprocessor has to live until @p build_patches has been
  * called. DataOutFaces and DataOutRotation can be used as well.
  *
- * In order not to perform needless calculations, DataPostprocessor has to
- * provide the information, which input data is needed for the calculation of
- * the derived quantities, i.e. whether it needs the values, the first
- * derivative and/or the second derivative of the provided
- * data. DataPostprocessor objects which are used in combination with a
- * DataOutFaces object can also ask for the normal vectors at each point. The
- * information, which data is needed has to be provided via the UpdateFlags
- * returned by the virtual function @p 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 @p compute_derived_quantities.
+ * In order not to perform needless calculations, DataPostprocessor
+ * has to provide the information, which input data is needed for the
+ * calculation of the derived quantities, i.e. whether it needs the
+ * values, the first derivative and/or the second derivative of the
+ * provided data. DataPostprocessor objects which are used in
+ * combination with a DataOutFaces object can also ask for the normal
+ * vectors at each point. The information, which data is needed has to
+ * be provided via the UpdateFlags returned by the virtual function @p
+ * 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 functions to call depending on whether the finite element
+ * in use has only a single, or multiple vector components).
  *
  * Furthermore, derived classes have to implement the @p get_names and @p
  * n_output_variables functions, where the number of output variables returned
@@ -91,24 +95,37 @@ class DataPostprocessor: public Subscriptor
                                      * empty vector when working on cells, not
                                      * on faces.
                                      *
-                                     * This function is called, when the
-                                     * original data vector is scalar valued.
+                                     * This function is called when
+                                     * the original data vector
+                                     * represents scalar data,
+                                     * i.e. the finite element in use
+                                     * has only a single vector
+                                     * component.
                                      */
-    virtual void compute_derived_quantities (std::vector<Vector<double> >      &computed_quantities,
-                                            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;
+    virtual
+    void
+    compute_derived_quantities_scalar (std::vector<Vector<double> >      &computed_quantities,
+                                      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;
+    
                                     /**
-                                     * Same as above function, but this one is
-                                     * called in case of vector-valued original
-                                     * data.
+                                     * Same as above 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 (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;
+    virtual
+    void
+    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;
 
                                     /**
                                      * Return the vector of strings describing
@@ -130,11 +147,15 @@ class DataPostprocessor: public Subscriptor
     virtual UpdateFlags get_needed_update_flags () const=0;
 
                                     /**
-                                     * Number of postprocessed variables. Has
-                                     * to match the number of entries filled by
-                                     * @p compute_derived_quantities as well as
-                                     * the size of the vector of names returned
-                                     * by @p get_names.
+                                     * Number of postprocessed
+                                     * variables. Has to match the
+                                     * number of entries filled by
+                                     * compute_derived_quantities_scalar()
+                                     * or
+                                     * compute_derived_quantities_vector()
+                                     * as well as the size of the
+                                     * vector of names returned by
+                                     * get_names().
                                      */
     virtual unsigned int n_output_variables() const=0;
     
index 742bb86df8a87a1f019029fe56aed860be55b4b5..06af410fd3d4f1179640fd4398d1036a8abc6a8d 100644 (file)
@@ -596,7 +596,7 @@ void DataOut<dim,DH>::build_some_patches (Data &data)
            {
              const DataPostprocessor<dim> *postprocessor=this->dof_data[dataset]->postprocessor;
              
-             if (postprocessor)
+             if (postprocessor != 0)
                {
                                                   // we have to postprocess the
                                                   // data, so determine, which
@@ -616,11 +616,12 @@ void DataOut<dim,DH>::build_some_patches (Data &data)
                      if (update_flags & update_hessians)
                        this->dof_data[dataset]->get_function_second_derivatives (fe_patch_values,
                                                                                  data.patch_second_derivatives);
-                     postprocessor->compute_derived_quantities(data.postprocessed_values[dataset],
-                                                               data.patch_values,
-                                                               data.patch_gradients,
-                                                               data.patch_second_derivatives,
-                                                               data.dummy_normals);
+                     postprocessor->
+                       compute_derived_quantities_scalar(data.postprocessed_values[dataset],
+                                                         data.patch_values,
+                                                         data.patch_gradients,
+                                                         data.patch_second_derivatives,
+                                                         data.dummy_normals);
                    }
                  else
                    {
@@ -637,11 +638,12 @@ void DataOut<dim,DH>::build_some_patches (Data &data)
                      if (update_flags & update_hessians)
                        this->dof_data[dataset]->get_function_second_derivatives (fe_patch_values,
                                                                                  data.patch_second_derivatives_system);
-                     postprocessor->compute_derived_quantities(data.postprocessed_values[dataset],
-                                                               data.patch_values_system,
-                                                               data.patch_gradients_system,
-                                                               data.patch_second_derivatives_system,
-                                                               data.dummy_normals);
+                     postprocessor->
+                       compute_derived_quantities_vector(data.postprocessed_values[dataset],
+                                                         data.patch_values_system,
+                                                         data.patch_gradients_system,
+                                                         data.patch_second_derivatives_system,
+                                                         data.dummy_normals);
                    }
                  
                  for (unsigned int q=0; q<n_q_points; ++q)
index 8f61572a6092ca8753d3ac06f88b848bcc22a2e5..6faa708934130664a87ce88bc114340ccae63d76 100644 (file)
@@ -100,7 +100,7 @@ void DataOutFaces<dim,DH>::build_some_patches (Data &data)
          for (unsigned int dataset=0; dataset<this->dof_data.size(); ++dataset)
            {
              const DataPostprocessor<dim> *postprocessor=this->dof_data[dataset]->postprocessor;
-             if (postprocessor)
+             if (postprocessor != 0)
                {
                                                   // we have to postprocess the
                                                   // data, so determine, which
@@ -131,11 +131,12 @@ void DataOutFaces<dim,DH>::build_some_patches (Data &data)
                      if (update_flags & update_hessians)
                        this->dof_data[dataset]->get_function_second_derivatives (fe_patch_values,
                                                                                  data.patch_second_derivatives);
-                     postprocessor->compute_derived_quantities(data.postprocessed_values[dataset],
-                                                               data.patch_values,
-                                                               data.patch_gradients,
-                                                               data.patch_second_derivatives,
-                                                               data.patch_normals);
+                     postprocessor->
+                       compute_derived_quantities_scalar(data.postprocessed_values[dataset],
+                                                         data.patch_values,
+                                                         data.patch_gradients,
+                                                         data.patch_second_derivatives,
+                                                         data.patch_normals);
                    }
                  else
                    {
@@ -152,11 +153,12 @@ void DataOutFaces<dim,DH>::build_some_patches (Data &data)
                      if (update_flags & update_hessians)
                        this->dof_data[dataset]->get_function_second_derivatives (fe_patch_values,
                                                                                  data.patch_second_derivatives_system);
-                     postprocessor->compute_derived_quantities(data.postprocessed_values[dataset],
-                                                               data.patch_values_system,
-                                                               data.patch_gradients_system,
-                                                               data.patch_second_derivatives_system,
-                                                               data.patch_normals);
+                     postprocessor->
+                       compute_derived_quantities_vector(data.postprocessed_values[dataset],
+                                                         data.patch_values_system,
+                                                         data.patch_gradients_system,
+                                                         data.patch_second_derivatives_system,
+                                                         data.patch_normals);
                    }
                  
                  for (unsigned int q=0; q<n_q_points; ++q)
index 137754a478983ca43eb3691236d2879418148a2d..d81d9ab687762ead080ce1c55bf3f1fc24aae585 100644 (file)
@@ -194,7 +194,7 @@ void DataOutRotation<dim,DH>::build_some_patches (Data &data)
              for (unsigned int dataset=0; dataset<this->dof_data.size(); ++dataset)
                {
                  const DataPostprocessor<dim> *postprocessor=this->dof_data[dataset]->postprocessor;
-                 if (postprocessor)
+                 if (postprocessor != 0)
                    {
                                                       // we have to postprocess the
                                                       // data, so determine, which
@@ -215,11 +215,12 @@ void DataOutRotation<dim,DH>::build_some_patches (Data &data)
                          if (update_flags & update_hessians)
                            this->dof_data[dataset]->get_function_second_derivatives (fe_patch_values,
                                                                                      data.patch_second_derivatives);
-                         postprocessor->compute_derived_quantities(data.postprocessed_values[dataset],
-                                                                   data.patch_values,
-                                                                   data.patch_gradients,
-                                                                   data.patch_second_derivatives,
-                                                                   data.dummy_normals);
+                         postprocessor->
+                           compute_derived_quantities_scalar(data.postprocessed_values[dataset],
+                                                             data.patch_values,
+                                                             data.patch_gradients,
+                                                             data.patch_second_derivatives,
+                                                             data.dummy_normals);
                        }
                      else
                        {
@@ -236,11 +237,12 @@ void DataOutRotation<dim,DH>::build_some_patches (Data &data)
                          if (update_flags & update_hessians)
                            this->dof_data[dataset]->get_function_second_derivatives (fe_patch_values,
                                                                                      data.patch_second_derivatives_system);
-                         postprocessor->compute_derived_quantities(data.postprocessed_values[dataset],
-                                                                   data.patch_values_system,
-                                                                   data.patch_gradients_system,
-                                                                   data.patch_second_derivatives_system,
-                                                                   data.dummy_normals);
+                         postprocessor->
+                           compute_derived_quantities_vector(data.postprocessed_values[dataset],
+                                                             data.patch_values_system,
+                                                             data.patch_gradients_system,
+                                                             data.patch_second_derivatives_system,
+                                                             data.dummy_normals);
                        }
                      
                      for (unsigned int component=0;
index e018456c4a7f05bf84be9131db2d9a7fd8f55385..d3e1190d99da053f7727152f99fba280b008805f 100644 (file)
@@ -23,11 +23,12 @@ DataPostprocessor<dim>::~DataPostprocessor()
 
 template <int dim>
 void
-DataPostprocessor<dim>::compute_derived_quantities (std::vector<Vector<double> >      &computed_quantities,
-                                                   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
+DataPostprocessor<dim>::
+compute_derived_quantities_scalar (std::vector<Vector<double> >      &computed_quantities,
+                                  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
 {
   computed_quantities.clear();
   AssertThrow(false,ExcPureFunctionCalled());
@@ -37,11 +38,12 @@ DataPostprocessor<dim>::compute_derived_quantities (std::vector<Vector<double> >
 
 template <int dim>
 void
-DataPostprocessor<dim>::compute_derived_quantities (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
+DataPostprocessor<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
 {
   computed_quantities.clear();
   AssertThrow(false,ExcPureFunctionCalled());
index 2e6542348b4faf99e4d8863965d834b7c078d49a..86ad0c2d769c62c8f0305291dc8d9dfeebbfc96e 100644 (file)
@@ -154,9 +154,7 @@ class Postprocessor : public DataPostprocessor<dim>
 {
   public:
 
-    using DataPostprocessor<dim>::compute_derived_quantities;
-
-    void compute_derived_quantities (
+    void compute_derived_quantities_vector (
                        std::vector< Vector< double > > &,
                        const std::vector< Vector< double > > &, 
                        const std::vector< std::vector< Tensor< 1, dim > > > &, 
@@ -202,7 +200,7 @@ Postprocessor<dim>::n_output_variables () const
 
 template <int dim>
 void
-Postprocessor<dim>::compute_derived_quantities (
+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*/,

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.