]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Save solution time into tecplot ascii files for animating time dependent data.
authorPraveen C <cpraveen@gmail.com>
Sat, 29 Aug 2015 05:49:11 +0000 (11:19 +0530)
committerPraveen C <cpraveen@gmail.com>
Sat, 29 Aug 2015 05:49:11 +0000 (11:19 +0530)
include/deal.II/base/data_out_base.h
source/base/data_out_base.cc

index 1ff41538a80526a5031fe106867ac09bc74b86e0..1da0e726b08bbe5146353ef7675b6b0c409ad22b 100644 (file)
@@ -833,11 +833,26 @@ namespace DataOutBase
      */
     const char *zone_name;
 
+    /**
+     * Solution time for each zone in a strand. This value must be non-negative,
+     * otherwise it will not be written to file. Do not assign any value for this
+     * in case of a static zone.
+     */
+    double solution_time;
+
+    /**
+     * A strand is a set of zones that represent the same region of the solution over time.
+     * <tt>strand_id</tt> is an integer value that uniquely identifies each strand.
+     */
+    int strand_id;
+
     /**
      * Constructor.
      */
     TecplotFlags (const char *tecplot_binary_file_name = NULL,
-                  const char *zone_name = NULL);
+                  const char *zone_name = NULL,
+                  const double solution_time = -1.0,
+                  const int strand_id = 1);
 
     /**
      * Return an estimate for the memory consumption, in bytes, of this
index 2a9df54420b9885b3ce8050976e7bd471866b6ee..09e7c90491846fbe9d029ba75a6226d8867a2976 100644 (file)
@@ -1978,11 +1978,19 @@ namespace DataOutBase
 
   TecplotFlags::
   TecplotFlags (const char *tecplot_binary_file_name,
-                const char *zone_name)
+                const char *zone_name,
+                const double solution_time,
+                const int strand_id)
     :
     tecplot_binary_file_name(tecplot_binary_file_name),
-    zone_name(zone_name)
-  {}
+    zone_name(zone_name),
+    solution_time (solution_time),
+    strand_id (strand_id)
+
+  {
+    Assert (strand_id >= 1,
+            ExcMessage("For transient data, strand_id must be > 0"));
+  }
 
 
 
@@ -4094,6 +4102,9 @@ namespace DataOutBase
       if (flags.zone_name)
         out << "t=\"" << flags.zone_name << "\" ";
 
+      if (flags.solution_time >= 0.0)
+        out << "strandid=" << flags.strand_id << ", solutiontime=" << flags.solution_time <<", ";
+
       out << "f=feblock, n=" << n_nodes << ", e=" << n_cells
           << ", et=" << tecplot_cell_type[dim] << '\n';
     }

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.