]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Bug fix in GridIn::parse_tecplot_header: Replace reference to unsigned int array...
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 6 Mar 2007 09:45:39 +0000 (09:45 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 6 Mar 2007 09:45:39 +0000 (09:45 +0000)
git-svn-id: https://svn.dealii.org/trunk@14523 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/grid_in.h
deal.II/deal.II/source/grid/grid_in.cc

index 4c90207c415602bc1d4e34d94981682a604b4192..b585b7dc8eda852ad9a0c99de415cbbe8a5e2acf 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
@@ -409,11 +409,11 @@ class GridIn
                                      * influence on the function execution..
                                      */
     static void parse_tecplot_header(std::string   &header,
-                                    unsigned int (&tecplot2deal)[dim],
+                                    std::vector<unsigned int> &tecplot2deal,
                                     unsigned int  &n_vars,
                                     unsigned int  &n_vertices,
                                     unsigned int  &n_cells,
-                                    unsigned int (&IJK)[dim],
+                                    std::vector<unsigned int> &IJK,
                                     bool          &structured,
                                     bool          &blocked);
     
index 839256c987e0b5f4d60572b9f18e5dc19b8bc207..4ad36aa2db2bab1d3d542563751db202c300e0c4 100644 (file)
@@ -1244,14 +1244,16 @@ void GridIn<3>::read_netcdf (const std::string &filename)
 
 template <int dim>
 void GridIn<dim>::parse_tecplot_header(std::string &header,
-                                      unsigned int (&tecplot2deal)[dim],
+                                      std::vector<unsigned int> &tecplot2deal,
                                       unsigned int &n_vars,
                                       unsigned int &n_vertices,
                                       unsigned int &n_cells,
-                                      unsigned int (&IJK)[dim],
+                                      std::vector<unsigned int> &IJK,
                                       bool &structured,
                                       bool &blocked)
 {
+  Assert(tecplot2deal.size()==dim, ExcInternalError());
+  Assert(IJK.size()==dim, ExcInternalError());
                                   // initialize the output variables
   n_vars=0;
   n_vertices=0;
@@ -1431,7 +1433,7 @@ void GridIn<dim>::parse_tecplot_header(std::string &header,
                                         // tecplot itself accepts entries like
                                         // 'J=20' instead of 'E=20'. therefore,
                                         // take the max of IJK
-       n_cells=*std::max_element(IJK,IJK+dim);
+       n_cells=*std::max_element(IJK.begin(),IJK.end());
       AssertThrow(n_cells>0,
                  ExcMessage("Tecplot file does not contain a complete and consistent set of parameters"));
     }
@@ -1471,11 +1473,11 @@ void GridIn<2>::read_tecplot (std::istream &in)
                                   // now create some variables holding
                                   // important information on the mesh, get
                                   // this information from the header string
-  unsigned int tecplot2deal[dim],
-    n_vars,
+  std::vector<unsigned int> tecplot2deal(dim);
+  std::vector<unsigned int> IJK(dim);
+  unsigned int n_vars,
     n_vertices,
-    n_cells,
-    IJK[dim];
+    n_cells;
   bool structured,
     blocked;
 

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.