[cig-commits] [commit] master: Change postprocess (76eff42)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu May 22 15:35:02 PDT 2014


Repository : https://github.com/geodynamics/aspect

On branch  : master
Link       : https://github.com/geodynamics/aspect/compare/4a5e27e5690a0e0c1e13e19100af7398e37f36b8...d31f4e9435a1c12781f5b673b672cbd29c41c2c2

>---------------------------------------------------------------

commit 76eff427acb2bfea7dc41a63383dacde9fa4a591
Author: Siqi Zhang <siqi.zhang at mq.edu.au>
Date:   Tue May 20 13:32:47 2014 -0500

    Change postprocess
    
    Change file and class names to internal heating.
    Add visualization plugin.


>---------------------------------------------------------------

76eff427acb2bfea7dc41a63383dacde9fa4a591
 ..._topography.h => internal_heating_statistics.h} | 11 ++---
 .../postprocess/radioactive_heating_statistics.h   | 54 ----------------------
 .../{density.h => internal_heating.h}              | 10 ++--
 ...tatistics.cc => internal_heating_statistics.cc} | 10 ++--
 .../{seismic_vp.cc => internal_heating.cc}         | 38 ++++++++-------
 5 files changed, 36 insertions(+), 87 deletions(-)

diff --git a/include/aspect/postprocess/dynamic_topography.h b/include/aspect/postprocess/internal_heating_statistics.h
similarity index 74%
copy from include/aspect/postprocess/dynamic_topography.h
copy to include/aspect/postprocess/internal_heating_statistics.h
index b14efd3..40c6b00 100644
--- a/include/aspect/postprocess/dynamic_topography.h
+++ b/include/aspect/postprocess/internal_heating_statistics.h
@@ -20,29 +20,28 @@
 /*  $Id$  */
 
 
-#ifndef __aspect__postprocess_surface_topography_h
-#define __aspect__postprocess_surface_topography_h
+#ifndef __aspect__postprocess_internal_heating_statistics_h
+#define __aspect__postprocess_internal_heating_statistics_h
 
 #include <aspect/postprocess/interface.h>
 #include <aspect/simulator_access.h>
 
-
 namespace aspect
 {
   namespace Postprocess
   {
 
     /**
-     * A postprocessor that computes dynamic topography at the surface.
+     * A postprocessor that computes some statistics about the internal heating rate.
      *
      * @ingroup Postprocessing
      */
     template <int dim>
-    class DynamicTopography : public Interface<dim>, public ::aspect::SimulatorAccess<dim>
+    class InternalHeatingStatistics : public Interface<dim>, public ::aspect::SimulatorAccess<dim>
     {
       public:
         /**
-         * Evaluate the solution for the dynamic topography.
+         * Evaluate the solution for some internal heating rate statistics.
          */
         virtual
         std::pair<std::string,std::string>
diff --git a/include/aspect/postprocess/radioactive_heating_statistics.h b/include/aspect/postprocess/radioactive_heating_statistics.h
deleted file mode 100644
index 2c1496f..0000000
--- a/include/aspect/postprocess/radioactive_heating_statistics.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
-  Copyright (C) 2011, 2012 by the authors of the ASPECT code.
-
-  This file is part of ASPECT.
-
-  ASPECT is free software; you can redistribute it and/or modify
-  it under the terms of the GNU General Public License as published by
-  the Free Software Foundation; either version 2, or (at your option)
-  any later version.
-
-  ASPECT is distributed in the hope that it will be useful,
-  but WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-  GNU General Public License for more details.
-
-  You should have received a copy of the GNU General Public License
-  along with ASPECT; see the file doc/COPYING.  If not see
-  <http://www.gnu.org/licenses/>.
-*/
-/*  $Id$  */
-
-
-#ifndef __aspect__postprocess_radioactive_heating_statistics_h
-#define __aspect__postprocess_radioactive_heating_statistics_h
-
-#include <aspect/postprocess/interface.h>
-#include <aspect/simulator_access.h>
-
-namespace aspect
-{
-  namespace Postprocess
-  {
-
-    /**
-     * A postprocessor that computes some statistics about the radioactive heating.
-     *
-     * @ingroup Postprocessing
-     */
-    template <int dim>
-    class Radioactive_Heating_Statistics : public Interface<dim>, public ::aspect::SimulatorAccess<dim>
-    {
-      public:
-        /**
-         * Evaluate the solution for some radioactive heating statistics.
-         */
-        virtual
-        std::pair<std::string,std::string>
-        execute (TableHandler &statistics);
-    };
-  }
-}
-
-
-#endif
diff --git a/include/aspect/postprocess/visualization/density.h b/include/aspect/postprocess/visualization/internal_heating.h
similarity index 88%
copy from include/aspect/postprocess/visualization/density.h
copy to include/aspect/postprocess/visualization/internal_heating.h
index b496825..05d1cf4 100644
--- a/include/aspect/postprocess/visualization/density.h
+++ b/include/aspect/postprocess/visualization/internal_heating.h
@@ -20,8 +20,8 @@
 /*  $Id$  */
 
 
-#ifndef __aspect__postprocess_visualization_density_h
-#define __aspect__postprocess_visualization_density_h
+#ifndef __aspect__postprocess_visualization_internal_heating_h
+#define __aspect__postprocess_visualization_internal_heating_h
 
 #include <aspect/postprocess/visualization.h>
 #include <aspect/simulator_access.h>
@@ -37,19 +37,19 @@ namespace aspect
     {
       /**
        * A class derived from DataPostprocessor that takes an output vector
-       * and computes a variable that represents the density at every point.
+       * and computes a variable that represents the internal heating rate at every point.
        *
        * The member functions are all implementations of those declared in the
        * base class. See there for their meaning.
        */
       template <int dim>
-      class Density
+      class Heating
         : public DataPostprocessorScalar<dim>,
           public SimulatorAccess<dim>,
           public Interface<dim>
       {
         public:
-          Density ();
+          Heating ();
 
           virtual
           void
diff --git a/source/postprocess/radioactive_heating_statistics.cc b/source/postprocess/internal_heating_statistics.cc
similarity index 93%
rename from source/postprocess/radioactive_heating_statistics.cc
rename to source/postprocess/internal_heating_statistics.cc
index 6227f29..edb7990 100644
--- a/source/postprocess/radioactive_heating_statistics.cc
+++ b/source/postprocess/internal_heating_statistics.cc
@@ -20,7 +20,7 @@
 /*  $Id$  */
 
 
-#include <aspect/postprocess/radioactive_heating_statistics.h>
+#include <aspect/postprocess/internal_heating_statistics.h>
 #include <aspect/simulator_access.h>
 
 #include <deal.II/base/quadrature_lib.h>
@@ -36,7 +36,7 @@ namespace aspect
   {
     template <int dim>
     std::pair<std::string,std::string>
-    Radioactive_Heating_Statistics<dim>::execute (TableHandler &statistics)
+    InternalHeatingStatistics<dim>::execute (TableHandler &statistics)
     {
         const HeatingModel::Interface<dim> &heating_model=this->get_heating_model();
 
@@ -127,9 +127,9 @@ namespace aspect
 {
   namespace Postprocess
   {
-    ASPECT_REGISTER_POSTPROCESSOR(Radioactive_Heating_Statistics,
-                                  "radioactive heating statistics",
+    ASPECT_REGISTER_POSTPROCESSOR(InternalHeatingStatistics,
+                                  "internal heating statistics",
                                   "A postprocessor that computes some statistics about "
-                                  "radioactive heating, averaged by volume. ")
+                                  "internal heating, averaged by volume. ")
   }
 }
diff --git a/source/postprocess/visualization/seismic_vp.cc b/source/postprocess/visualization/internal_heating.cc
similarity index 71%
copy from source/postprocess/visualization/seismic_vp.cc
copy to source/postprocess/visualization/internal_heating.cc
index c32a69b..a65d259 100644
--- a/source/postprocess/visualization/seismic_vp.cc
+++ b/source/postprocess/visualization/internal_heating.cc
@@ -20,7 +20,7 @@
 /*  $Id$  */
 
 
-#include <aspect/postprocess/visualization/seismic_vp.h>
+#include <aspect/postprocess/visualization/internal_heating.h>
 #include <aspect/simulator_access.h>
 
 #include <deal.II/numerics/data_out.h>
@@ -33,42 +33,46 @@ namespace aspect
     namespace VisualizationPostprocessors
     {
       template <int dim>
-      SeismicVp<dim>::
-      SeismicVp ()
+      InternalHeating<dim>::
+      InternalHeating ()
         :
-        DataPostprocessorScalar<dim> ("seismic_Vp",
-                                      update_values | update_q_points)
+        DataPostprocessorScalar<dim> ("internal_heating",
+                                      update_values | update_gradients | update_q_points)
       {}
 
 
 
       template <int dim>
       void
-      SeismicVp<dim>::
+      InternalHeating<dim>::
       compute_derived_quantities_vector (const std::vector<Vector<double> >              &uh,
-                                         const std::vector<std::vector<Tensor<1,dim> > > &,
+                                         const std::vector<std::vector<Tensor<1,dim> > > &duh,
                                          const std::vector<std::vector<Tensor<2,dim> > > &,
                                          const std::vector<Point<dim> > &,
                                          const std::vector<Point<dim> >                  &evaluation_points,
                                          std::vector<Vector<double> >                    &computed_quantities) const
       {
+        const HeatingModel::Interface<dim> &heating_model=this->get_heating_model();
         const unsigned int n_quadrature_points = uh.size();
         Assert (computed_quantities.size() == n_quadrature_points,    ExcInternalError());
         Assert (computed_quantities[0].size() == 1,                   ExcInternalError());
         Assert (uh[0].size() == dim+2+this->n_compositional_fields(), ExcInternalError());
+        Assert (duh[0].size() == dim+2+this->n_compositional_fields(),ExcInternalError());
 
+//        in.position = evaluation_points;
         for (unsigned int q=0; q<n_quadrature_points; ++q)
           {
-            const double pressure    = uh[q][dim];
-            const double temperature = uh[q][dim+1];
+            double temperature=uh[q][dim+1];
+            double pressure   =uh[q][dim];
+            Point<dim> point(evaluation_points[q]);
             std::vector<double> composition(this->n_compositional_fields());
+
             for (unsigned int c=0; c<this->n_compositional_fields(); ++c)
               composition[c] = uh[q][dim+2+c];
-
-            computed_quantities[q](0) = this->get_material_model().seismic_Vp(temperature,
-                                                                              pressure,
-                                                                              composition,
-                                                                              evaluation_points[q]);
+            computed_quantities[q](0) = heating_model.specific_heating_rate(temperature,
+                                                                            pressure,
+                                                                            composition,
+                                                                            point);
           }
       }
     }
@@ -83,10 +87,10 @@ namespace aspect
   {
     namespace VisualizationPostprocessors
     {
-      ASPECT_REGISTER_VISUALIZATION_POSTPROCESSOR(SeismicVp,
-                                                  "seismic vp",
+      ASPECT_REGISTER_VISUALIZATION_POSTPROCESSOR(InternalHeating,
+                                                  "internal heating",
                                                   "A visualization output object that generates output "
-                                                  "for the seismic P-wave speed.")
+                                                  "for the internal heating rate.")
     }
   }
 }



More information about the CIG-COMMITS mailing list