From 92b37a15b8328055700b56e3a644c56532d3bd4a Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 10 Jul 2009 20:59:20 +0000 Subject: [PATCH] Fix a problem with whitespace at the end of lines -- apparently we can't put back characters that are not exactly in the same order in which we read them. git-svn-id: https://svn.dealii.org/trunk@19057 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/grid/grid_in.cc | 22 +++++++++++++--------- deal.II/doc/news/changes.h | 20 ++++++++++++++++++-- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/deal.II/deal.II/source/grid/grid_in.cc b/deal.II/deal.II/source/grid/grid_in.cc index 344e1bd3fe..ce76598a96 100644 --- a/deal.II/deal.II/source/grid/grid_in.cc +++ b/deal.II/deal.II/source/grid/grid_in.cc @@ -22,12 +22,15 @@ #include #include #include +#include #include + #ifdef HAVE_LIBNETCDF #include #endif + DEAL_II_NAMESPACE_OPEN template @@ -1805,22 +1808,23 @@ void GridIn::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(),' ')) + != 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 - }; + } } diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 0827e8ad0a..11c0a1666a 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -206,7 +206,14 @@ inconvenience this causes.
  1. - 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.
    (Toby D. Young 2009/06/25)

    @@ -218,6 +225,15 @@ inconvenience this causes.

    deal.II

      +
    1. +

      + Fixed: The GridIn class sometimes had problems with input files that had + whitespace at the end of lines. This should now be fixed. +
      + (WB 2009/07/10) +

      +
    2. +
    3. New: The new hp::DoFHandler::set_active_fe_indices function allows @@ -234,7 +250,7 @@ inconvenience this causes.

    4. - 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. -- 2.39.5