]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Fix a problem with whitespace at the end of lines -- apparently we can't put back...
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 10 Jul 2009 20:59:20 +0000 (20:59 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 10 Jul 2009 20:59:20 +0000 (20:59 +0000)
git-svn-id: https://svn.dealii.org/trunk@19057 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/grid/grid_in.cc
deal.II/doc/news/changes.h

index 344e1bd3fec9a0eb72426a1271c323e611fed79b..ce76598a9658e7433f22cee3eef48a7d6e7e967a 100644 (file)
 #include <map>
 #include <algorithm>
 #include <fstream>
+#include <functional>
 #include <cctype>
 
+
 #ifdef HAVE_LIBNETCDF
 #include <netcdfcpp.h>
 #endif
 
+
 DEAL_II_NAMESPACE_OPEN
 
 template <int dim, int spacedim>
@@ -1805,22 +1808,23 @@ void GridIn<dim, spacedim>::skip_empty_lines (std::istream &in)
     {
                                       // get line
       getline (in, line);
-                                      // eat all spaces from the back
-      while ((line.length()>0) && (line[line.length()-1]==' '))
-       line.erase (line.length()-1, 1);
-                                      // if still non-null, then this
-                                      // is a non-empty line. put
-                                      // back all info and leave
-      if (line.length() > 0)
+
+                                      // check if this is a line that
+                                      // consists only of spaces, and
+                                      // if not put the whole thing
+                                      // back and return
+      if (std::find_if (line.begin(), line.end(),
+                       std::bind2nd (std::not_equal_to<char>(),' '))
+         != line.end())
        {
          in.putback ('\n');
          for (int i=line.length()-1; i>=0; --i)
            in.putback (line[i]);
          return;
-       };
+       }
 
                                       // else: go on with next line
-    };
+    }
 }
 
 
index 0827e8ad0aa9ded34516c2bbc8e38defee1d1f9d..11c0a1666a795af80ee0c95a6c1c107edbf55bf1 100644 (file)
@@ -206,7 +206,14 @@ inconvenience this causes.
 <ol>
   <li>
   <p>
-  New: Based on work with Rickard Armiento, Francisco Alvaro, and Jose E. Roman, SLEPcWrappers that give a handle on some of the features of SLEPc (Scalable Library for Eigenvalue Problem Computations): (1) The SLEPcWrappers::SolverBase class can be used for specifying an eigenvalue problem, either in standard or generalized form, on serial or parallel architectures with support for a few solver types; and (2) The SLEPcWrappers::TransformationBase class encapsulates a variety of spectral transformations providing some functionality required for acceleration techniques based on the transformation of the spectrum.
+  New: Based on work with Rickard Armiento, Francisco Alvaro, and Jose E. Roman,
+  SLEPcWrappers that give a handle on some of the features of SLEPc (Scalable Library
+  for Eigenvalue Problem Computations): (1) The SLEPcWrappers::SolverBase class can be
+  used for specifying an eigenvalue problem, either in standard or generalized form,
+  on serial or parallel architectures with support for a few solver types; and
+  (2) The SLEPcWrappers::TransformationBase class encapsulates a variety of spectral
+  transformations providing some functionality required for acceleration techniques
+  based on the transformation of the spectrum. 
   <br>
   (Toby D. Young 2009/06/25)
   </p>
@@ -218,6 +225,15 @@ inconvenience this causes.
 <h3>deal.II</h3>
 
 <ol>
+  <li>
+  <p>
+  Fixed: The GridIn class sometimes had problems with input files that had
+  whitespace at the end of lines. This should now be fixed.
+  <br>
+  (WB 2009/07/10)
+  </p>
+  </li>
+
   <li>
   <p>
   New: The new hp::DoFHandler::set_active_fe_indices function allows
@@ -234,7 +250,7 @@ inconvenience this causes.
 
   <li>
   <p>
-  Fix: The projection of quadrature points to subfaces in
+  Fixed: The projection of quadrature points to subfaces in
   MappingQ in case of 3d anisotropic refinement did not respect
   non-standard face orientation/flip/rotation cases. This
   has now been fixed.  

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.