From 136e2a8ee053ab8fd7e3cd37c6c6ffd9e0e101c8 Mon Sep 17 00:00:00 2001 From: Praveen C Date: Sat, 29 Aug 2015 11:19:11 +0530 Subject: [PATCH] Save solution time into tecplot ascii files for animating time dependent data. --- include/deal.II/base/data_out_base.h | 17 ++++++++++++++++- source/base/data_out_base.cc | 17 ++++++++++++++--- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/include/deal.II/base/data_out_base.h b/include/deal.II/base/data_out_base.h index 1ff41538a8..1da0e726b0 100644 --- a/include/deal.II/base/data_out_base.h +++ b/include/deal.II/base/data_out_base.h @@ -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. + * strand_id 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 diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index 2a9df54420..09e7c90491 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -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'; } -- 2.39.5