[cig-commits] commit 2295 by bangerth to /var/svn/dealii/aspect

dealii.demon at gmail.com dealii.demon at gmail.com
Tue Feb 11 19:06:53 PST 2014


Revision 2295

Honor the 'convert_output_to_years' flag in the depth average processor.

U   trunk/aspect/doc/modules/changes.h
U   trunk/aspect/source/postprocess/depth_average.cc


http://www.dealii.org/websvn/revision.php?repname=Aspect+Repository&path=%2F&rev=2295&peg=2295

Diff:
Modified: trunk/aspect/doc/modules/changes.h
===================================================================
--- trunk/aspect/doc/modules/changes.h	2014-02-10 20:08:00 UTC (rev 2294)
+++ trunk/aspect/doc/modules/changes.h	2014-02-12 03:06:50 UTC (rev 2295)
@@ -8,6 +8,12 @@
 </p>
 
 <ol>
+  <li>Fixed: The "depth average" postprocessor did not honor the
+  "Use years in output instead of seconds" parameter in the input
+  file and instead always printed time in seconds. This is now fixed.
+  <br>
+  (Wolfgang Bangerth 2014/02/11)
+
   <li>New: The "Simple setups" section of the manual now has a subsection
   detailing the generalization of the "Convection in a box" setup to
   a three-dimensional situation. This includes links to the movies

Modified: trunk/aspect/source/postprocess/depth_average.cc
===================================================================
--- trunk/aspect/source/postprocess/depth_average.cc	2014-02-10 20:08:00 UTC (rev 2294)
+++ trunk/aspect/source/postprocess/depth_average.cc	2014-02-12 03:06:50 UTC (rev 2295)
@@ -124,7 +124,12 @@
                   f << std::endl;
                   continue;
                 }
-              f << entries[i].time << " "
+              f << (this->convert_output_to_years()
+                    ?
+                    entries[i].time / year_in_seconds
+                    :
+                    entries[i].time)
+                << " "
                 << entries[i].depth;
               for (unsigned int j=0; j<n_statistics; ++j)
                 f << " " << entries[i].values[j];
@@ -228,7 +233,9 @@
       if (output_interval > 0)
         {
           // the current time is always in seconds, so we need to convert the output_interval to the same unit
-          double output_interval_in_s = (this->convert_output_to_years()) ? (output_interval*year_in_seconds) : output_interval;
+          double output_interval_in_s = (this->convert_output_to_years() ?
+                                         (output_interval*year_in_seconds) :
+                                         output_interval);
 
           // we need to compute the smallest integer that is bigger than current_time/my_output_interval,
           // even if it is a whole number already (otherwise we output twice in a row)
@@ -246,6 +253,8 @@
   {
     ASPECT_REGISTER_POSTPROCESSOR(DepthAverage,
                                   "depth average",
-                                  "A postprocessor that computes depth averaged quantities and writes them out.")
+                                  "A postprocessor that computes depth averaged "
+                                  "quantities and writes them into a file named "
+                                  "'depthaverage.plt' in the output directory.")
   }
 }


More information about the CIG-COMMITS mailing list