]> https://gitweb.dealii.org/ - dealii.git/commitdiff
By default, do not produce a preamble for UCD output files (both mesh and data) since...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 30 Oct 2007 19:00:57 +0000 (19:00 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 30 Oct 2007 19:00:57 +0000 (19:00 +0000)
git-svn-id: https://svn.dealii.org/trunk@15395 0785d39b-7218-0410-832d-ea1e28bc413d

21 files changed:
deal.II/base/include/base/data_out_base.h
deal.II/deal.II/include/grid/grid_out.h
deal.II/doc/news/changes.h
tests/base/data_out_base.cc
tests/bits/data_out_01.cc
tests/bits/data_out_02.cc
tests/bits/data_out_faces_01.cc
tests/bits/data_out_faces_02.cc
tests/bits/data_out_rotation_01.cc
tests/bits/data_out_rotation_02.cc
tests/bits/data_out_stack_01.cc
tests/bits/data_out_stack_02.cc
tests/bits/grid_generator_04.cc
tests/bits/grid_generator_05.cc
tests/deal.II/data_out.cc
tests/deal.II/grid_in.cc
tests/deal.II/grid_in_tecplot.cc
tests/deal.II/grid_invert.cc
tests/deal.II/grid_out.cc
tests/deal.II/grid_test.cc
tests/deal.II/line_coarsening_3d.cc

index 855fc20068451b2c5d26af6c82d955a84465900b..42b847f4530f3f0035a82ebb464cc136bf635db8 100644 (file)
@@ -511,23 +511,29 @@ class DataOutBase
     struct UcdFlags 
     {
                                         /**
-                                         * Write a comment at the beginning
-                                         * of the file stating the date of
-                                         * creation and some other data.
-                                         * While this is supported by the
-                                         * UCD format and @ref SoftwareAVS,
-                                         * some other programs get confused
-                                         * by this, so you can switch it off
-                                         * this way.
+                                         * Write a comment at the
+                                         * beginning of the file
+                                         * stating the date of
+                                         * creation and some other
+                                         * data.  While this is
+                                         * supported by the UCD
+                                         * format and @ref
+                                         * SoftwareAVS, some other
+                                         * programs get confused by
+                                         * this, so the default is to
+                                         * not write a
+                                         * preamble. However, a
+                                         * preamble can be written
+                                         * using this flag.
                                          *
-                                         * Default: <tt>true</tt>.
+                                         * Default: <code>false</code>.
                                          */
        bool write_preamble;
        
                                         /**
                                          * Constructor.
                                          */
-       UcdFlags (const bool write_preamble = true);
+       UcdFlags (const bool write_preamble = false);
 
                                         /**
                                          * Declare all flags with name
index 0135722293a7b11de316fe41d62c046ed0522109..b732cb5f97f957c54ab3bf34158d84be426fd573 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$
 //
-//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors
+//    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -172,16 +172,21 @@ namespace GridOutFlags
   struct Ucd 
   {
                                       /**
-                                       * Write a comment at the beginning
-                                       * of the file stating the date of
-                                       * creation and some other data.
-                                       * While this is supported by the
-                                       * UCD format (and the AVS program),
-                                       * some other programs get confused
-                                       * by this, so you can switch it off
-                                       * this way.
+                                       * Write a comment at the
+                                       * beginning of the file
+                                       * stating the date of creation
+                                       * and some other data.  While
+                                       * this is supported by the UCD
+                                       * format (and the AVS
+                                       * program), some other
+                                       * programs get confused by
+                                       * this, so the default is to
+                                       * not write a
+                                       * preamble. However, a
+                                       * preamble can be written
+                                       * using this flag.
                                        *
-                                       * Default: @p true.
+                                       * Default: <code>false</code>.
                                        */
       bool write_preamble;
       
@@ -229,7 +234,7 @@ namespace GridOutFlags
                                       /**
                                        * Constructor.
                                        */
-      Ucd (const bool write_preamble = true,
+      Ucd (const bool write_preamble = false,
           const bool write_faces    = false,
           const bool write_lines    = false);
 
index e564547e936bcfa6404cdbf2ffd07cd4c53cf7cf..b51569602baf81b7391d2a136eb858ba302b82cd 100644 (file)
@@ -30,6 +30,24 @@ inconvenience this causes.
 </p>
 
 <ol>
+  <li> <p>Changed: When writing output files in UCD format using either the
+  DataOutBase or the GridOut class, we used to write a preamble at the
+  beginning of the file that included the date and time the file was created.
+  However, several visualization programs get confused when confronted with
+  comments at the beginning of UCD files. Rather than printing a sensible
+  error message, they usually simply refuse to show any output, making it
+  very hard to track down the actual cause.
+  <br>
+  The classes mentioned above previously allowed to suppress writing a preamble
+  by setting a flag in the DataOutBase::UcdFlags or GridOutFlags::Ucd
+  structures. Given how complicated it is to find the actual
+  source of trouble, the default for these flags has been changed to not
+  produce this preamble any more. If desired, the flag can be used to still
+  produce a preamble.
+  <br>
+  (WB 2007/10/30)
+  </p>
+
   <li> <p>Changed: The version number of the deal.II intermediate format written by
   DataOutBase::write_deal_II_intermediate has been increased to 3 to accomodate the fact that
   we now support writing vector-valued data to output files in at least some output formats.
index e787c12f8bc86f95bf91346ec5164b67e10fe4f2..db3356302c6c97d93a34b80f9e019a3bd58ea88d 100644 (file)
@@ -40,7 +40,7 @@ write_patches(const std::vector<DataOutBase::Patch<dim,spacedim> >& patches,
   DataOutBase::GnuplotFlags gnuplotflags;
   DataOutBase::GmvFlags gmvflags;
   DataOutBase::PovrayFlags povrayflags;
-  DataOutBase::UcdFlags ucdflags;
+  DataOutBase::UcdFlags ucdflags(true);
   DataOutBase::VtkFlags vtkflags;
   DataOutBase::Deal_II_IntermediateFlags deal_II_intermediateflags;
 
index 178d011caf9e6f05c6c29f189b0028a958c5bb74..b37d6943a6f13382b7b17067204efe8697f516f6 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2003, 2004, 2005 by the deal.II authors
+//    Copyright (C) 2003, 2004, 2005, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -33,6 +33,7 @@ check_this (const DoFHandler<dim> &dof_handler,
   data_out.build_patches ();
   
   data_out.write_dx (deallog.get_file_stream());
+  data_out.set_flags (DataOutBase::UcdFlags(true));
   data_out.write_ucd (deallog.get_file_stream());  
   data_out.write_gmv (deallog.get_file_stream());
   data_out.write_tecplot (deallog.get_file_stream());
index e9d43590cb8b4d53f44ab9fda0ef72f64a09b625..8583ecdaaea61cab6cf7fbc6731fc3f3d5fa9f14 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2003, 2004 by the deal.II authors
+//    Copyright (C) 2003, 2004, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -40,6 +40,7 @@ check_this (const DoFHandler<dim> &dof_handler,
   data_out.build_patches ();
   
   data_out.write_dx (deallog.get_file_stream());
+  data_out.set_flags (DataOutBase::UcdFlags(true));
   data_out.write_ucd (deallog.get_file_stream());  
   data_out.write_gmv (deallog.get_file_stream());
   data_out.write_tecplot (deallog.get_file_stream());
index 0b11cc9a45d3cef6ff7c083145b5db7369ae3fc8..27ba6060d7a6bdfda6bdb2b9e455019e49a98f21 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2003, 2004, 2006 by the deal.II authors
+//    Copyright (C) 2003, 2004, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -43,6 +43,7 @@ my_check_this (const DoFHandler<dim> &dof_handler,
   data_out_faces.build_patches ();
   
   data_out_faces.write_dx (deallog.get_file_stream());
+  data_out_faces.set_flags (DataOutBase::UcdFlags(true));
   data_out_faces.write_ucd (deallog.get_file_stream());  
   data_out_faces.write_gmv (deallog.get_file_stream());
   data_out_faces.write_tecplot (deallog.get_file_stream());
index f78399a6512633388ccfb9c6394617896b35add8..f3dc777b95c68aa032828a6d0aa90cd21b6bd324 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2003, 2004, 2006 by the deal.II authors
+//    Copyright (C) 2003, 2004, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -49,6 +49,7 @@ my_check_this (const DoFHandler<dim> &dof_handler,
   data_out_faces.build_patches ();
   
   data_out_faces.write_dx (deallog.get_file_stream());
+  data_out_faces.set_flags (DataOutBase::UcdFlags(true));
   data_out_faces.write_ucd (deallog.get_file_stream());  
   data_out_faces.write_gmv (deallog.get_file_stream());
   data_out_faces.write_tecplot (deallog.get_file_stream());
index c6546e791a6834db9e3674c2f7bc236e63f44bac..17e9a546fffbc087ed9e191e30c44b61bf4d3bb5 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2003, 2004, 2006 by the deal.II authors
+//    Copyright (C) 2003, 2004, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -43,6 +43,7 @@ my_check_this (const DoFHandler<dim> &dof_handler,
   data_out_rotation.build_patches (4);
   
   data_out_rotation.write_dx (deallog.get_file_stream());
+  data_out_rotation.set_flags (DataOutBase::UcdFlags(true));
   data_out_rotation.write_ucd (deallog.get_file_stream());  
   data_out_rotation.write_gmv (deallog.get_file_stream());
   data_out_rotation.write_tecplot (deallog.get_file_stream());
index 2d25af25d285a3fd860d9969970a52553db1a757..81f1f84c3198e6d136fbac612e9f440975490a67 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2003, 2004, 2006 by the deal.II authors
+//    Copyright (C) 2003, 2004, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -50,6 +50,7 @@ my_check_this (const DoFHandler<dim> &dof_handler,
   data_out_rotation.build_patches (4);
   
   data_out_rotation.write_dx (deallog.get_file_stream());
+  data_out_rotation.set_flags (DataOutBase::UcdFlags(true));
   data_out_rotation.write_ucd (deallog.get_file_stream());  
   data_out_rotation.write_gmv (deallog.get_file_stream());
   data_out_rotation.write_tecplot (deallog.get_file_stream());
index 5f3a0350f703f8718ed08636bfc366519900ed23..cad49f0d185a1b5b73fd90960bec8bcd2f8819df 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2003, 2004 by the deal.II authors
+//    Copyright (C) 2003, 2004, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -62,6 +62,7 @@ check_this (const DoFHandler<dim> &dof_handler,
   data_out_stack.finish_parameter_value ();
   
   data_out_stack.write_dx (deallog.get_file_stream());
+  data_out_stack.set_flags (DataOutBase::UcdFlags(true));
   data_out_stack.write_ucd (deallog.get_file_stream());  
   data_out_stack.write_gmv (deallog.get_file_stream());
   data_out_stack.write_tecplot (deallog.get_file_stream());
index fb7a1bec15ce0c2489f96a28a26be059282b7707..82cede56e85294f5b2dee6212335ea18c9e3289c 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2003, 2004 by the deal.II authors
+//    Copyright (C) 2003, 2004, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -70,6 +70,7 @@ check_this (const DoFHandler<dim> &dof_handler,
   data_out_stack.finish_parameter_value ();
   
   data_out_stack.write_dx (deallog.get_file_stream());
+  data_out_stack.set_flags (DataOutBase::UcdFlags(true));
   data_out_stack.write_ucd (deallog.get_file_stream());  
   data_out_stack.write_gmv (deallog.get_file_stream());
   data_out_stack.write_tecplot (deallog.get_file_stream());
index 4551a80de4493d3738e6cd97bb3505f900b46bfa..35d96cd94399709c98345621302fe3532c043580 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2005, 2006 by the deal.II authors
+//    Copyright (C) 2005, 2006, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
index 164aa7eccd5d59428ba6549fb71f7967d4c9d450..ffe50396fb7ff86d95efdf702acd2600f65987f4 100644 (file)
@@ -49,7 +49,9 @@ void test(std::ostream& out)
       deallog <<"moebius, no rotation" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::moebius(tr, 20, 0, 10.0, 2.0);
-      GridOut().write_ucd(tr, out);
+      GridOut go;
+      go.set_flags (GridOutFlags::Ucd(true));
+      go.write_ucd(tr, out);
     }
 
                                    // loop with quarter rotation (1 * pi/2)
@@ -59,7 +61,9 @@ void test(std::ostream& out)
              << "moebius, quarter rotation (1* Pi/2)" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::moebius(tr, 20, 1, 10.0, 2.0);
-      GridOut().write_ucd(tr, out);
+      GridOut go;
+      go.set_flags (GridOutFlags::Ucd(true));
+      go.write_ucd(tr, out);
     }
 
                                    // loop with half rotation (2 * pi/2)
@@ -69,7 +73,9 @@ void test(std::ostream& out)
              << "moebius, half rotation (2* Pi/2)" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::moebius(tr, 20, 2, 10.0, 2.0);
-      GridOut().write_ucd(tr, out);
+      GridOut go;
+      go.set_flags (GridOutFlags::Ucd(true));
+      go.write_ucd(tr, out);
     }
 
                                    // loop with three quarter rotation (3 * pi/2)
@@ -79,7 +85,9 @@ void test(std::ostream& out)
              << "moebius, three quarter rotation (3* Pi/2)" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::moebius(tr, 20, 3, 10.0, 2.0);
-      GridOut().write_ucd(tr, out);
+      GridOut go;
+      go.set_flags (GridOutFlags::Ucd(true));
+      go.write_ucd(tr, out);
     }
 
                                    // loop with full rotation (1 * pi/2)
@@ -89,7 +97,9 @@ void test(std::ostream& out)
              << "moebius, full rotation (2* Pi)" << std::endl;
       Triangulation<dim> tr;
       GridGenerator::moebius(tr, 20, 4, 10.0, 2.0);
-      GridOut().write_ucd(tr, out);
+      GridOut go;
+      go.set_flags (GridOutFlags::Ucd(true));
+      go.write_ucd(tr, out);
     }
 }
 
index 0ad914acad9962ed937888ec2c66601a5c437de3..c566673dfb4458617e53e5e71db85e71a5bcf7b2 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2000, 2001, 2002, 2003, 2004 by the deal.II authors
+//    Copyright (C) 2000, 2001, 2002, 2003, 2004, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -189,6 +189,7 @@ void LaplaceProblem<2>::output_results () const
       data_out.write_dx (logfile);
       data_out.write_gmv (logfile);
       data_out.write_gnuplot (logfile);
+      data_out.set_flags (DataOutBase::UcdFlags(true));
       data_out.write_ucd (logfile);
       data_out.write_povray (logfile);
       data_out.write_eps (logfile);
@@ -204,6 +205,7 @@ void LaplaceProblem<2>::output_results () const
       data_out.write_dx (logfile);
       data_out.write_gmv (logfile);
       data_out.write_gnuplot (logfile);
+      data_out.set_flags (DataOutBase::UcdFlags(true));
       data_out.write_ucd (logfile);
     };
 }
@@ -225,6 +227,7 @@ void LaplaceProblem<3>::output_results () const
       data_out.write_dx (logfile);
       data_out.write_gmv (logfile);
       data_out.write_gnuplot (logfile);
+      data_out.set_flags (DataOutBase::UcdFlags(true));
       data_out.write_ucd (logfile);
     };
 
@@ -240,6 +243,7 @@ void LaplaceProblem<3>::output_results () const
       data_out.write_dx (logfile);
       data_out.write_gmv (logfile);
       data_out.write_gnuplot (logfile);
+      data_out.set_flags (DataOutBase::UcdFlags(true));
       data_out.write_ucd (logfile);
     };
 }
index cb88cc6213faca16105df83f9d14d0c7fd75b8a8..ddd603637ac10d25e97d6f36367c3617806a8be0 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2002, 2003, 2004, 2005 by the deal.II authors
+//    Copyright (C) 2002, 2003, 2004, 2005, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -40,6 +40,7 @@ void test1 ()
   gi.read_ucd (in);
   
   GridOut grid_out;
+  grid_out.set_flags (GridOutFlags::Ucd(true));
   grid_out.write_ucd (tria, logfile);
 }
 
index 264a641603b280566fcacb1b6b45392119ada1f4..78116afdd87da495f6df8906c6e16a7076532fce 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2002, 2003, 2004, 2005 by the deal.II authors
+//    Copyright (C) 2002, 2003, 2004, 2005, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -36,6 +36,7 @@ void test (const std::string &infilename)
         <<"output for grid in "<<infilename<<std::endl;
   
   GridOut grid_out;
+  grid_out.set_flags (GridOutFlags::Ucd(true));
   grid_out.write_ucd (tria, logfile);
 }
 
index 24cf6baa268c6a2f1140ceaf3b122bc188325081..d2f5c82d21f20dcf773f65619ff82a7f6ebb8409 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2002, 2003, 2004, 2005 by the deal.II authors
+//    Copyright (C) 2002, 2003, 2004, 2005, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -64,6 +64,7 @@ void test (bool second_case=false)
         <<std::endl<<std::endl;
 
   GridOut grid_out;
+  grid_out.set_flags (GridOutFlags::Ucd(true));
   grid_out.write_ucd (tria, logfile);
 }
 
index fb2c30e50425e8bf4ffd370ac47b1447b69796d1..0a62e06ceb5864f8e0033074e2fb16b1ae4a3032 100644 (file)
@@ -2,7 +2,7 @@
 //    $Id$
 //    Version: $Name$ 
 //
-//    Copyright (C) 2002, 2003, 2004, 2005 by the deal.II authors
+//    Copyright (C) 2002, 2003, 2004, 2005, 2007 by the deal.II authors
 //
 //    This file is subject to QPL and may not be  distributed
 //    without copyright and license information. Please refer
@@ -49,6 +49,7 @@ void test ()
   if (dim != 1)
     grid_out.write_eps (tria, logfile);
   grid_out.write_gnuplot (tria, logfile);
+  grid_out.set_flags (GridOutFlags::Ucd(true));
   grid_out.write_ucd (tria, logfile);
   if (dim != 1)
     grid_out.write_dx (tria, logfile);
index eb405a5ac8cf57ff7e6cf24f907ab6938a1d7bea..29975bee02b49ec1c83ea667f48d0068a37b2883 100644 (file)
@@ -255,7 +255,9 @@ void test (const int test_case)
       }
     }
 
-  GridOut().write_ucd (tria, logfile);
+  GridOut go;
+  go.set_flags (GridOutFlags::Ucd(true));  
+  go.write_ucd (tria, logfile);
 
   deallog << "     Total number of cells        = " << tria.n_cells() << std::endl
          << "     Total number of active cells = " << tria.n_active_cells() << std::endl;
index df198b83b6438bac945e0853e0b67d0e05d3a430..3326f908bdd86a67e0e55780c6af21602fcbd818 100644 (file)
@@ -87,7 +87,9 @@ void check ()
   cell->set_refine_flag();
   tria.execute_coarsening_and_refinement ();
                                   // write grid to file
-  GridOut().write_ucd(tria,logfile);
+  GridOut go;
+  go.set_flags (GridOutFlags::Ucd(true));  
+  go.write_ucd(tria,logfile);
                                   // coarsen the first cell again
   cell=tria.begin_active(1);
   for (unsigned int c=0;c<8; ++c)
@@ -97,7 +99,7 @@ void check ()
     }
   tria.execute_coarsening_and_refinement ();
   
-  GridOut().write_ucd(tria,logfile);
+  go.write_ucd(tria,logfile);
 }
 
 

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.