From 4fa5c34a179c9b136c39529013b8d10de3abefa5 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Fri, 3 Feb 2006 19:21:30 +0000 Subject: [PATCH] Remove support for compilers that do not offer the std::[io]stringstream classes. git-svn-id: https://svn.dealii.org/trunk@12233 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/base/source/data_out_base.cc | 33 +---- deal.II/base/source/exceptions.cc | 16 +-- deal.II/base/source/log.cc | 18 +-- deal.II/base/source/parameter_handler.cc | 58 +------- deal.II/base/source/table_handler.cc | 22 +-- deal.II/base/source/utilities.cc | 25 +--- .../include/numerics/dof_print_solver_step.h | 16 +-- deal.II/deal.II/source/fe/fe_dgp.cc | 18 +-- deal.II/deal.II/source/fe/fe_dgp_monomial.cc | 16 +-- .../deal.II/source/fe/fe_dgp_nonparametric.cc | 14 +- deal.II/deal.II/source/fe/fe_dgq.cc | 16 +-- deal.II/deal.II/source/fe/fe_nedelec.cc | 16 +-- deal.II/deal.II/source/fe/fe_q.cc | 16 +-- .../deal.II/source/fe/fe_q_hierarchical.cc | 16 +-- .../deal.II/source/fe/fe_raviart_thomas.cc | 18 +-- .../source/fe/fe_raviart_thomas_nodal.cc | 16 +-- deal.II/deal.II/source/fe/fe_system.cc | 14 +- deal.II/deal.II/source/fe/fe_tools.cc | 8 +- deal.II/deal.II/source/numerics/data_out.cc | 17 +-- .../deal.II/source/numerics/data_out_stack.cc | 14 +- deal.II/doc/news/changes.html | 8 ++ deal.II/doc/readme.html | 21 ++- deal.II/examples/step-13/step-13.cc | 31 +---- deal.II/examples/step-14/step-14.cc | 39 +----- deal.II/examples/step-15/step-15.cc | 19 +-- deal.II/examples/step-16/step-16.cc | 29 +--- deal.II/examples/step-17/step-17.cc | 17 +-- deal.II/examples/step-5/step-5.cc | 125 ++---------------- deal.II/lac/include/lac/block_matrix_array.h | 27 +--- deal.II/lac/source/solver_control.cc | 17 +-- tests/deal.II/measure_et_al.cc | 13 +- tests/fe/mapping.cc | 24 ++-- tests/fe/performance.cc | 5 - 33 files changed, 106 insertions(+), 656 deletions(-) diff --git a/deal.II/base/source/data_out_base.cc b/deal.II/base/source/data_out_base.cc index fb83d0fa55..454da55a35 100644 --- a/deal.II/base/source/data_out_base.cc +++ b/deal.II/base/source/data_out_base.cc @@ -41,11 +41,7 @@ #include #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include //TODO: Is it reasonable to have undocumented exceptions? @@ -3910,17 +3906,8 @@ DataOutReader::read (std::istream &in) std::string header; getline (in, header); -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream s; -#else - std::ostrstream s; -#endif - s << "[deal.II intermediate format graphics data]"; - -#ifndef HAVE_STD_STRINGSTREAM - s << std::ends; -#endif Assert (header == s.str(), ExcUnexpectedInput(s.str(),header)); } @@ -3928,17 +3915,8 @@ DataOutReader::read (std::istream &in) std::string header; getline (in, header); -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream s; -#else - std::ostrstream s; -#endif - s << "[written by " << PACKAGE_STRING << "]"; - -#ifndef HAVE_STD_STRINGSTREAM - s << std::ends; -#endif Assert (header == s.str(), ExcUnexpectedInput(s.str(),header)); } @@ -4080,17 +4058,8 @@ operator >> (std::istream &in, } while ((header == "") && in); -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream s; -#else - std::ostrstream s; -#endif - s << "[deal.II intermediate Patch<" << dim << ',' << spacedim << ">]"; - -#ifndef HAVE_STD_STRINGSTREAM - s << std::ends; -#endif Assert (header == s.str(), ExcUnexpectedInput(s.str(),header)); } diff --git a/deal.II/base/source/exceptions.cc b/deal.II/base/source/exceptions.cc index f24bb6aafa..192c390953 100644 --- a/deal.II/base/source/exceptions.cc +++ b/deal.II/base/source/exceptions.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 2000, 2001, 2002, 2003, 2005 by the deal.II authors +// Copyright (C) 1998, 2000, 2001, 2002, 2003, 2005, 2006 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -16,12 +16,7 @@ #include #include #include - -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include #ifdef HAVE_GLIBC_STACKTRACE # include @@ -211,11 +206,7 @@ const char * ExceptionBase::what () const throw () // convert the messages printed by // the exceptions into a // std::string -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream converter; -#else - std::ostrstream converter; -#endif converter << "--------------------------------------------------------" << std::endl; @@ -228,9 +219,6 @@ const char * ExceptionBase::what () const throw () converter << "--------------------------------------------------------" << std::endl; -#ifndef HAVE_STD_STRINGSTREAM - converter << std::ends; -#endif description = converter.str(); diff --git a/deal.II/base/source/log.cc b/deal.II/base/source/log.cc index 204220f1a0..73b1b629f5 100644 --- a/deal.II/base/source/log.cc +++ b/deal.II/base/source/log.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -25,12 +25,7 @@ #include #include #include - -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include // on SunOS 4.x, getrusage is stated in the man pages and exists, but @@ -208,16 +203,9 @@ LogStream::print_line_head() #ifdef DEALII_MEMORY_DEBUG static const pid_t id = getpid(); -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream statname; -#else - std::ostrstream statname; -#endif - statname << "/proc/" << id << "/stat"; -#ifndef HAVE_STD_STRINGSTREAM - statname << std::ends; -#endif + static long size; static string dummy; ifstream stat(statname.str()); diff --git a/deal.II/base/source/parameter_handler.cc b/deal.II/base/source/parameter_handler.cc index ccb3a5eeeb..0b0003a778 100644 --- a/deal.II/base/source/parameter_handler.cc +++ b/deal.II/base/source/parameter_handler.cc @@ -21,12 +21,7 @@ #include #include #include - -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include #ifdef HAVE_STD_NUMERIC_LIMITS # include @@ -86,11 +81,7 @@ namespace Patterns bool Integer::match (const std::string &test_string) const { -#ifdef HAVE_STD_STRINGSTREAM std::istringstream str(test_string); -#else - std::istrstream str(test_string.c_str()); -#endif int i; if (str >> i) @@ -117,18 +108,11 @@ namespace Patterns // output their values if (lower_bound <= upper_bound) { -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream description; -#else - std::ostrstream description; -#endif description << "[Integer range " << lower_bound << "..." << upper_bound << " (inclusive)]"; -#ifndef HAVE_STD_STRINGSTREAM - description << std::ends; -#endif return description.str(); } else @@ -172,11 +156,7 @@ namespace Patterns bool Double::match (const std::string &test_string) const { -#ifdef HAVE_STD_STRINGSTREAM std::istringstream str(test_string); -#else - std::istrstream str(test_string.c_str()); -#endif double d; if (str >> d) @@ -202,18 +182,11 @@ namespace Patterns // output their values if (lower_bound <= upper_bound) { -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream description; -#else - std::ostrstream description; -#endif description << "[Floating point range " << lower_bound << "..." << upper_bound << " (inclusive)]"; -#ifndef HAVE_STD_STRINGSTREAM - description << std::ends; -#endif return description.str(); } else @@ -366,20 +339,12 @@ namespace Patterns std::string List::description () const { -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream description; -#else - std::ostrstream description; -#endif description << "list of <" << pattern->description() << ">" << " of length " << min_elements << "..." << max_elements << " (inclusive)"; -#ifndef HAVE_STD_STRINGSTREAM - description << std::ends; -#endif - return description.str(); } @@ -837,16 +802,9 @@ void ParameterHandler::set (const std::string &entry_string, const double &new_value) { -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream s; -#else - std::ostrstream s; -#endif s << std::setprecision(16); s << new_value; -#ifndef HAVE_STD_STRINGSTREAM - s << std::ends; -#endif // hand this off to the function that // actually sets the value as a string @@ -859,15 +817,8 @@ void ParameterHandler::set (const std::string &entry_string, const long int &new_value) { -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream s; -#else - std::ostrstream s; -#endif s << new_value; -#ifndef HAVE_STD_STRINGSTREAM - s << std::ends; -#endif // hand this off to the function that // actually sets the value as a string @@ -880,15 +831,8 @@ void ParameterHandler::set (const std::string &entry_string, const bool &new_value) { -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream s; -#else - std::ostrstream s; -#endif s << new_value; -#ifndef HAVE_STD_STRINGSTREAM - s << std::ends; -#endif // hand this off to the function that // actually sets the value as a string diff --git a/deal.II/base/source/table_handler.cc b/deal.II/base/source/table_handler.cc index 64eb1147db..46610ddd79 100644 --- a/deal.II/base/source/table_handler.cc +++ b/deal.II/base/source/table_handler.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors +// Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -15,12 +15,7 @@ #include #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif - +#include #include #include #include @@ -265,11 +260,7 @@ void TableHandler::write_text(std::ostream &out) const // write it into a dummy // stream, just to get its // size upon output -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream dummy_out; -#else - std::ostrstream dummy_out; -#endif dummy_out << std::setprecision(column.precision); @@ -278,19 +269,12 @@ void TableHandler::write_text(std::ostream &out) const else dummy_out.setf (std::ios::fixed, std::ios::floatfield); column.entries[i]->write_text (dummy_out); -#ifndef HAVE_STD_STRINGSTREAM - dummy_out << std::ends; -#endif // get size, note that we are // not interested in the // trailing \0 -#ifdef HAVE_STD_STRINGSTREAM entry_widths[i][j] = dummy_out.str().length(); -#else - entry_widths[i][j] = strlen(dummy_out.str()); -#endif - }; + } // next compute the width each row // has to have to suit all entries diff --git a/deal.II/base/source/utilities.cc b/deal.II/base/source/utilities.cc index c1c499d7f0..310d5106e4 100644 --- a/deal.II/base/source/utilities.cc +++ b/deal.II/base/source/utilities.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2005 by the deal.II authors +// Copyright (C) 2005, 2006 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -24,11 +24,8 @@ #include #include #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include + #ifdef HAVE_STD_NUMERIC_LIMITS # include #else @@ -108,11 +105,7 @@ namespace Utilities int string_to_int (const std::string &s) { -#ifdef HAVE_STD_STRINGSTREAM std::istringstream ss(s); -#else - std::ostrstream ss(s.c_str()); -#endif #ifdef HAVE_STD_NUMERIC_LIMITS static const int max_int = std::numeric_limits::max(); @@ -263,11 +256,7 @@ namespace Utilities const std::string test_string (name.begin()+position, name.end()); -#ifdef HAVE_STD_STRINGSTREAM std::istringstream str(test_string); -#else - std::istrstream str(test_string.c_str()); -#endif int i; if (str >> i) @@ -380,17 +369,11 @@ namespace Utilities std::time_t time1= std::time (0); std::tm *time = std::localtime(&time1); -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream o; -#else - std::ostrstream o; -#endif o << time->tm_hour << ":" << (time->tm_min < 10 ? "0" : "") << time->tm_min << ":" << (time->tm_sec < 10 ? "0" : "") << time->tm_sec; -#ifndef HAVE_STD_STRINGSTREAM - o << std::ends; -#endif + return o.str(); } diff --git a/deal.II/deal.II/include/numerics/dof_print_solver_step.h b/deal.II/deal.II/include/numerics/dof_print_solver_step.h index 12877ce0d6..0e08823211 100644 --- a/deal.II/deal.II/include/numerics/dof_print_solver_step.h +++ b/deal.II/deal.II/include/numerics/dof_print_solver_step.h @@ -19,12 +19,7 @@ #include #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif - +#include #include #include @@ -118,20 +113,11 @@ DoFPrintSolverStep::print_vectors (const unsigned int step, out.add_data_vector(r, "residual"); out.add_data_vector(d, "update"); -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream filename; -#else - std::ostrstream filename; -#endif - filename << basename << std::setw(3) << std::setfill('0') << step << out.default_suffix(); -#ifndef HAVE_STD_STRINGSTREAM - filename << std::ends; -#endif - const std::string fname = filename.str(); deallog << "Writing file:" << fname << std::endl; diff --git a/deal.II/deal.II/source/fe/fe_dgp.cc b/deal.II/deal.II/source/fe/fe_dgp.cc index a7c65f3727..6cc154f601 100644 --- a/deal.II/deal.II/source/fe/fe_dgp.cc +++ b/deal.II/deal.II/source/fe/fe_dgp.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2002, 2003, 2004, 2005 by the deal.II authors +// Copyright (C) 2002, 2003, 2004, 2005, 2006 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -14,11 +14,7 @@ #include #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include template @@ -55,17 +51,9 @@ FE_DGP::get_name () const // this function returns, so they // have to be kept in synch -#ifdef HAVE_STD_STRINGSTREAM - std::ostringstream namebuf; -#else - std::ostrstream namebuf; -#endif - + std::ostringstream namebuf; namebuf << "FE_DGP<" << dim << ">(" << this->degree << ")"; -#ifndef HAVE_STD_STRINGSTREAM - namebuf << std::ends; -#endif return namebuf.str(); } diff --git a/deal.II/deal.II/source/fe/fe_dgp_monomial.cc b/deal.II/deal.II/source/fe/fe_dgp_monomial.cc index cf784b3421..841f588535 100644 --- a/deal.II/deal.II/source/fe/fe_dgp_monomial.cc +++ b/deal.II/deal.II/source/fe/fe_dgp_monomial.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2004, 2005 by the deal.II authors +// Copyright (C) 2004, 2005, 2006 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -14,11 +14,7 @@ #include #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include // namespace for some functions that are used in this file. @@ -158,17 +154,9 @@ FE_DGPMonomial::get_name () const // this function returns, so they // have to be kept in synch -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream namebuf; -#else - std::ostrstream namebuf; -#endif - namebuf << "FE_DGPMonomial<" << dim << ">(" << this->degree << ")"; -#ifndef HAVE_STD_STRINGSTREAM - namebuf << std::ends; -#endif return namebuf.str(); } diff --git a/deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc b/deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc index 7c6b1fd63d..fe355eccc4 100644 --- a/deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc +++ b/deal.II/deal.II/source/fe/fe_dgp_nonparametric.cc @@ -20,11 +20,7 @@ #include #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include template @@ -89,17 +85,9 @@ FE_DGPNonparametric::get_name () const // this function returns, so they // have to be kept in synch -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream namebuf; -#else - std::ostrstream namebuf; -#endif - namebuf << "FE_DGPNonparametric<" << dim << ">(" << degree << ")"; -#ifndef HAVE_STD_STRINGSTREAM - namebuf << std::ends; -#endif return namebuf.str(); } diff --git a/deal.II/deal.II/source/fe/fe_dgq.cc b/deal.II/deal.II/source/fe/fe_dgq.cc index c5694e7d7a..507fd0da0b 100644 --- a/deal.II/deal.II/source/fe/fe_dgq.cc +++ b/deal.II/deal.II/source/fe/fe_dgq.cc @@ -17,11 +17,7 @@ #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include @@ -239,17 +235,9 @@ FE_DGQ::get_name () const // this function returns, so they // have to be kept in synch -#ifdef HAVE_STD_STRINGSTREAM - std::ostringstream namebuf; -#else - std::ostrstream namebuf; -#endif - + std::ostringstream namebuf; namebuf << "FE_DGQ<" << dim << ">(" << this->degree << ")"; -#ifndef HAVE_STD_STRINGSTREAM - namebuf << std::ends; -#endif return namebuf.str(); } diff --git a/deal.II/deal.II/source/fe/fe_nedelec.cc b/deal.II/deal.II/source/fe/fe_nedelec.cc index 81915b73fa..82121c041b 100644 --- a/deal.II/deal.II/source/fe/fe_nedelec.cc +++ b/deal.II/deal.II/source/fe/fe_nedelec.cc @@ -22,11 +22,7 @@ #include #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include @@ -75,17 +71,9 @@ FE_Nedelec::get_name () const // this function returns, so they // have to be kept in synch -#ifdef HAVE_STD_STRINGSTREAM - std::ostringstream namebuf; -#else - std::ostrstream namebuf; -#endif - + std::ostringstream namebuf; namebuf << "FE_Nedelec<" << dim << ">(" << degree << ")"; -#ifndef HAVE_STD_STRINGSTREAM - namebuf << std::ends; -#endif return namebuf.str(); } diff --git a/deal.II/deal.II/source/fe/fe_q.cc b/deal.II/deal.II/source/fe/fe_q.cc index 80a56d2a68..d21246db90 100644 --- a/deal.II/deal.II/source/fe/fe_q.cc +++ b/deal.II/deal.II/source/fe/fe_q.cc @@ -18,11 +18,7 @@ #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include // namespace for some functions that are used in this file. they are @@ -225,17 +221,9 @@ FE_Q::get_name () const // this function returns, so they // have to be kept in synch -#ifdef HAVE_STD_STRINGSTREAM - std::ostringstream namebuf; -#else - std::ostrstream namebuf; -#endif - + std::ostringstream namebuf; namebuf << "FE_Q<" << dim << ">(" << this->degree << ")"; -#ifndef HAVE_STD_STRINGSTREAM - namebuf << std::ends; -#endif return namebuf.str(); } diff --git a/deal.II/deal.II/source/fe/fe_q_hierarchical.cc b/deal.II/deal.II/source/fe/fe_q_hierarchical.cc index 931202cd22..86d0830b1f 100644 --- a/deal.II/deal.II/source/fe/fe_q_hierarchical.cc +++ b/deal.II/deal.II/source/fe/fe_q_hierarchical.cc @@ -14,11 +14,7 @@ #include #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include namespace @@ -102,17 +98,9 @@ FE_Q_Hierarchical::get_name () const // this function returns, so they // have to be kept in synch -#ifdef HAVE_STD_STRINGSTREAM - std::ostringstream namebuf; -#else - std::ostrstream namebuf; -#endif - + std::ostringstream namebuf; namebuf << "FE_Q_Hierarchical<" << dim << ">(" << this->degree << ")"; -#ifndef HAVE_STD_STRINGSTREAM - namebuf << std::ends; -#endif return namebuf.str(); } diff --git a/deal.II/deal.II/source/fe/fe_raviart_thomas.cc b/deal.II/deal.II/source/fe/fe_raviart_thomas.cc index 4c14f9a742..6182a5ea07 100644 --- a/deal.II/deal.II/source/fe/fe_raviart_thomas.cc +++ b/deal.II/deal.II/source/fe/fe_raviart_thomas.cc @@ -24,14 +24,8 @@ #include #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif - +#include #include -using namespace std; template @@ -106,17 +100,9 @@ FE_RaviartThomas::get_name () const // this function returns, so they // have to be kept in synch -#ifdef HAVE_STD_STRINGSTREAM - std::ostringstream namebuf; -#else - std::ostrstream namebuf; -#endif - + std::ostringstream namebuf; namebuf << "FE_RaviartThomas<" << dim << ">(" << rt_order << ")"; -#ifndef HAVE_STD_STRINGSTREAM - namebuf << std::ends; -#endif return namebuf.str(); } diff --git a/deal.II/deal.II/source/fe/fe_raviart_thomas_nodal.cc b/deal.II/deal.II/source/fe/fe_raviart_thomas_nodal.cc index f01a405cbd..acf927e5d7 100644 --- a/deal.II/deal.II/source/fe/fe_raviart_thomas_nodal.cc +++ b/deal.II/deal.II/source/fe/fe_raviart_thomas_nodal.cc @@ -23,11 +23,7 @@ #include #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include template FE_RaviartThomasNodal::FE_RaviartThomasNodal (const unsigned int deg) @@ -103,17 +99,9 @@ FE_RaviartThomasNodal::get_name () const // this function returns, so they // have to be kept in synch -#ifdef HAVE_STD_STRINGSTREAM - std::ostringstream namebuf; -#else - std::ostrstream namebuf; -#endif - + std::ostringstream namebuf; namebuf << "FE_RaviartThomasNodal<" << dim << ">(" << this->degree-1 << ")"; -#ifndef HAVE_STD_STRINGSTREAM - namebuf << std::ends; -#endif return namebuf.str(); } diff --git a/deal.II/deal.II/source/fe/fe_system.cc b/deal.II/deal.II/source/fe/fe_system.cc index 8e7b4aadbe..639d82eda9 100644 --- a/deal.II/deal.II/source/fe/fe_system.cc +++ b/deal.II/deal.II/source/fe/fe_system.cc @@ -20,12 +20,9 @@ #include #include #include + #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include /* ----------------------- FESystem::InternalData ------------------- */ @@ -238,11 +235,7 @@ FESystem::get_name () const // this function returns, so they // have to be kept in synch -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream namebuf; -#else - std::ostrstream namebuf; -#endif namebuf << "FESystem<" << dim << ">["; for (unsigned int i=0; i::get_name () const } namebuf << ']'; -#ifndef HAVE_STD_STRINGSTREAM - namebuf << std::ends; -#endif return namebuf.str(); } diff --git a/deal.II/deal.II/source/fe/fe_tools.cc b/deal.II/deal.II/source/fe/fe_tools.cc index b1163d1314..0a27aa256d 100644 --- a/deal.II/deal.II/source/fe/fe_tools.cc +++ b/deal.II/deal.II/source/fe/fe_tools.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -41,12 +41,6 @@ #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif - namespace diff --git a/deal.II/deal.II/source/numerics/data_out.cc b/deal.II/deal.II/source/numerics/data_out.cc index 2c8144c92b..c569e92ee1 100644 --- a/deal.II/deal.II/source/numerics/data_out.cc +++ b/deal.II/deal.II/source/numerics/data_out.cc @@ -31,11 +31,7 @@ #include #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include @@ -271,18 +267,11 @@ add_data_vector (const VECTOR &vec, names.resize (n_components); for (unsigned int i=0; i #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include + template class DH> unsigned int @@ -151,15 +148,8 @@ void DataOutStack::add_data_vector (const Vector &vec, names.resize (n_components); for (unsigned int i=0; i +
  • + Removed: Support for gcc2.95 in particular, and all compilers that do + not support the std::ostringstream class in general, + has been removed. +
    + (WB 2006/02/03) +

    +
  • Changed: Several classes related to the storage of data in the Triangulation and DoFHandler classes have been moved into internal diff --git a/deal.II/doc/readme.html b/deal.II/doc/readme.html index ed86dc49e1..3c6a37464a 100644 --- a/deal.II/doc/readme.html +++ b/deal.II/doc/readme.html @@ -41,21 +41,20 @@ developed and tested on Unix or Unix-like systems only. It can be used positively on

      -
    • Linux on x86, with gcc 2.95, 3.0, 3.1/3.2, 3.3, 3.4, and 4.0; and +
    • Linux on x86, with gcc 3.0, 3.1/3.2, 3.3, 3.4, and 4.0; and Intel ICC 6.0, 7.0, 7.1, 8.0, and 8.1;
    • Linux on x86_64 (Opterons, AMD64, and Intel EM64T chips) using gcc 3.3, 3.4, and 4.0; -
    • Sun Solaris 2.5, 2.6, 7, 8, and 9 on Sparc, with gcc 2.95, +
    • Sun Solaris 2.5, 2.6, 7, 8, and 9 on Sparc, with gcc 3.0, and gcc 3.1/3.2;
    • Sun Solaris 9 on Sparc in 64bit mode, with gcc 3.1.1/3.2; -
    • Sun Solaris 8 on x86, with gcc 2.95; -
    • FreeBSD 4.5 on x86, with gcc 2.95; +
    • FreeBSD 4.5 on x86, with gcc newer than 2.95;
    • IBM AIX 5.1 on Power4, with gcc 3.2 and gcc 3.3; -
    • IBM AIX 4.2, with gcc 2.95 (with some restrictions on +
    • IBM AIX 4.2, with gcc newer than 2.95 (with some restrictions on the use of shared libraries);
    • SGI IRIX64, with MIPSpro 7.41;
    • Linux on IA-64 (Itanium), using gcc 3.4.2 and ICC 8.1; -
    • Linux on HP/Compaq Alpha with gcc 2.95 (courtesy of +
    • Linux on HP/Compaq Alpha with gcc newer than 2.95 (courtesy of testdrive.hp.com);
    • Linux on HPPA PA-RISC with gcc 3.0 (with some restrictions on the use of shared libraries; courtesy of @@ -73,11 +72,11 @@ our experiences on separate pages:
      • SGI - IRIX64 with gcc 2.95.x, 3.2, 3.3 and 3.4, and with MIPSpro 7.41; + IRIX64 with gcc 3.2, 3.3 and 3.4, and with MIPSpro 7.41;
      • OSF1 V5.3 on - Alpha with gcc 2.95.x (the same notes probably also apply - to Linux on DEC Alpha) and using DEC's cxx compiler version + Alpha with gcc newer than 2.95.x (the same notes probably also + apply to Linux on DEC Alpha) and using DEC's cxx compiler version 6.3; for older systems with OSF1 4.0 and cxx6.0 please see this page. @@ -117,8 +116,8 @@
        • A fairly complete C++ compiler. We usually use - gcc2.95 or - gcc3.x but also some others. Various working compilers + gcc3.x but also some + others. Various working compilers are listed above. egcs1.x and older gcc versions will not work, however. For gcc 2.96, see the Frequently Asked Questions. Also, Sun diff --git a/deal.II/examples/step-13/step-13.cc b/deal.II/examples/step-13/step-13.cc index 365415c99a..dbcc787db6 100644 --- a/deal.II/examples/step-13/step-13.cc +++ b/deal.II/examples/step-13/step-13.cc @@ -4,7 +4,7 @@ /* $Id$ */ /* Version: $Name$ */ /* */ -/* Copyright (C) 2001, 2002, 2003, 2004 by the deal.II authors */ +/* Copyright (C) 2001, 2002, 2003, 2004, 2006 by the deal.II authors */ /* */ /* This file is subject to QPL and may not be distributed */ /* without copyright and license information. Please refer */ @@ -51,19 +51,7 @@ #include #include #include - - // Just as in the step-5 example - // program (see there for a lengthy - // discussion of the subject), we - // have to work around some - // historical confusion with the - // files declaring the stringstream - // classes: -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include // @sect3{Evaluation of the solution} @@ -663,13 +651,6 @@ namespace Evaluation // value of the format descriptor // passed as second argument. // - // The somewhat complicated use of - // the stringstream class, - // involving support from the - // preprocessor, is as already - // explained in the step-5 example - // program. - // // Also note that we have to prefix // ``this->'' to access a member // variable of the template @@ -689,20 +670,12 @@ namespace Evaluation data_out.add_data_vector (solution, "solution"); data_out.build_patches (); -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream filename; -#else - std::ostrstream filename; -#endif filename << output_name_base << "-" << this->refinement_cycle << data_out.default_suffix (output_format) << std::ends; -#ifdef HAVE_STD_STRINGSTREAM std::ofstream out (filename.str().c_str()); -#else - std::ofstream out (filename.str()); -#endif data_out.write (out, output_format); } diff --git a/deal.II/examples/step-14/step-14.cc b/deal.II/examples/step-14/step-14.cc index 7acff59ef1..fd6f0ef6f0 100644 --- a/deal.II/examples/step-14/step-14.cc +++ b/deal.II/examples/step-14/step-14.cc @@ -4,7 +4,7 @@ /* $Id$ */ /* Version: $Name$ */ /* */ -/* Copyright (C) 2002, 2003, 2004, 2005 by the deal.II authors */ +/* Copyright (C) 2002, 2003, 2004, 2005, 2006 by the deal.II authors */ /* */ /* This file is subject to QPL and may not be distributed */ /* without copyright and license information. Please refer */ @@ -45,12 +45,7 @@ #include #include #include - -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include // @sect3{Evaluating the solution} @@ -423,21 +418,13 @@ namespace Evaluation GridOutput::operator () (const DoFHandler &dof_handler, const Vector &/*solution*/) const { -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream filename; -#else - std::ostrstream filename; -#endif filename << output_name_base << "-" << this->refinement_cycle << ".eps" << std::ends; -#ifdef HAVE_STD_STRINGSTREAM - std::ofstream out (filename.str().c_str()); -#else - std::ofstream out (filename.str()); -#endif + std::ofstream out (filename.str().c_str()); GridOut().write_eps (dof_handler.get_tria(), out); } } @@ -927,21 +914,13 @@ namespace LaplaceSolver data_out.add_data_vector (this->solution, "solution"); data_out.build_patches (); -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream filename; -#else - std::ostrstream filename; -#endif filename << "solution-" << this->refinement_cycle << ".gnuplot" << std::ends; -#ifdef HAVE_STD_STRINGSTREAM - std::ofstream out (filename.str().c_str()); -#else - std::ofstream out (filename.str()); -#endif + std::ofstream out (filename.str().c_str()); data_out.write (out, DataOut::gnuplot); } @@ -2846,21 +2825,13 @@ namespace LaplaceSolver data_out.build_patches (); -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream filename; -#else - std::ostrstream filename; -#endif filename << "solution-" << this->refinement_cycle << ".gnuplot" << std::ends; -#ifdef HAVE_STD_STRINGSTREAM - std::ofstream out (filename.str().c_str()); -#else - std::ofstream out (filename.str()); -#endif + std::ofstream out (filename.str().c_str()); data_out.write (out, DataOut::gnuplot); } diff --git a/deal.II/examples/step-15/step-15.cc b/deal.II/examples/step-15/step-15.cc index 31b4c04082..0b76b8f745 100644 --- a/deal.II/examples/step-15/step-15.cc +++ b/deal.II/examples/step-15/step-15.cc @@ -4,7 +4,7 @@ /* $Id$ */ /* Version: $Name$ */ /* */ -/* Copyright (C) 2002, 2003, 2004 by the deal.II authors */ +/* Copyright (C) 2002, 2003, 2004, 2006 by the deal.II authors */ /* */ /* This file is subject to QPL and may not be distributed */ /* without copyright and license information. Please refer */ @@ -48,12 +48,7 @@ // header files: #include #include - -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include // The first thing we have here is a helper @@ -833,21 +828,13 @@ MinimizationProblem::output_results () const data_out.add_data_vector (present_solution, "solution"); data_out.build_patches (); -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream filename; -#else - std::ostrstream filename; -#endif filename << "solution-" << run_number << ".gnuplot" << std::ends; -#ifdef HAVE_STD_STRINGSTREAM - std::ofstream out (filename.str().c_str()); -#else - std::ofstream out (filename.str()); -#endif + std::ofstream out (filename.str().c_str()); data_out.write_gnuplot (out); } diff --git a/deal.II/examples/step-16/step-16.cc b/deal.II/examples/step-16/step-16.cc index dde5cf2cea..3c8cf5cedc 100644 --- a/deal.II/examples/step-16/step-16.cc +++ b/deal.II/examples/step-16/step-16.cc @@ -4,7 +4,7 @@ /* $Id$ */ /* Version: $Name$ */ /* */ -/* Copyright (C) 2003, 2004, 2005 by the deal.II authors */ +/* Copyright (C) 2003, 2004, 2005, 2006 by the deal.II authors */ /* */ /* This file is subject to QPL and may not be distributed */ /* without copyright and license information. Please refer */ @@ -56,14 +56,9 @@ #include #include - // This is C++ ... see step 5 for - // further comments. + // This is C++: #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include // This class is based on the same @@ -495,29 +490,13 @@ void LaplaceProblem::output_results (const unsigned int cycle) const // The following block generates // the file name and opens the - // file. This looks awkward because - // of a change in the handling of - // string streams (See step 5 for explanation). - -#ifdef HAVE_STD_STRINGSTREAM + // file: std::ostringstream filename; -#else - std::ostrstream filename; -#endif filename << "solution-" << cycle << ".gnuplot"; -#ifndef HAVE_STD_STRINGSTREAM - filename << std::ends; -#endif - -#ifdef HAVE_STD_STRINGSTREAM std::ofstream output (filename.str().c_str()); -#else - std::ofstream output (filename.str()); -#endif - data_out.write_gnuplot (output); } diff --git a/deal.II/examples/step-17/step-17.cc b/deal.II/examples/step-17/step-17.cc index 6784b59e9d..aa78eb78fd 100644 --- a/deal.II/examples/step-17/step-17.cc +++ b/deal.II/examples/step-17/step-17.cc @@ -4,7 +4,7 @@ /* $Id$ */ /* Version: $Name$ */ /* */ -/* Copyright (C) 2000, 2004, 2005 by the deal.II authors */ +/* Copyright (C) 2000, 2004, 2005, 2006 by the deal.II authors */ /* */ /* This file is subject to QPL and may not be distributed */ /* without copyright and license information. Please refer */ @@ -96,11 +96,7 @@ // And this is simply C++ again: #include #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include // Now, here comes the declaration of the @@ -939,7 +935,7 @@ void ElasticProblem::output_results (const unsigned int cycle) const // with setting up the output file as in // step-8, and attaching the (localized) // solution vector to the output - // object. (The code to generate the output + // object:. (The code to generate the output // file name is stolen and slightly // modified from step-5, since we expect // that we can do a number of cycles @@ -947,15 +943,10 @@ void ElasticProblem::output_results (const unsigned int cycle) const // what the code in step-8 could handle.) if (this_mpi_process == 0) { -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream filename; filename << "solution-" << cycle << ".gmv"; + std::ofstream output (filename.str().c_str()); -#else - std::ostrstream filename; - filename << "solution-" << cycle << ".gmv"; - std::ofstream output (filename.str()); -#endif DataOut data_out; data_out.attach_dof_handler (dof_handler); diff --git a/deal.II/examples/step-5/step-5.cc b/deal.II/examples/step-5/step-5.cc index 8b0497a0fe..dc122bd69b 100644 --- a/deal.II/examples/step-5/step-5.cc +++ b/deal.II/examples/step-5/step-5.cc @@ -4,7 +4,7 @@ /* $Id$ */ /* Version: $Name$ */ /* */ -/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors */ +/* Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2006 by the deal.II authors */ /* */ /* This file is subject to QPL and may not be distributed */ /* without copyright and license information. Please refer */ @@ -52,61 +52,8 @@ // ... and this is too: We will // convert integers to strings using // the C++ stringstream class - // ``ostringstream''. One annoying - // complication arises here in that - // the classes ``std::istringstream'' - // and ``std::ostringstream'' (with - // these names) have not been part of - // standard libraries of C++ - // compilers for long. They have only - // been part of C++ compilers since - // around the time the C++ standard - // was made in 1999. For example, the - // gcc compiler up to and including - // version 2.95.2 did not have them, - // but instead provided classes - // ``istrstream'' and ``ostrstream'' - // with a similar, but nevertheless - // slightly different - // interface. Furthermore, they were - // declared in the include file - // ``'', while the new - // standards conforming classes are - // declared in ``''. Many - // other compilers followed the gcc - // scheme, so whenever we want to - // support versions of compilers that - // appeared before approximately - // 2000/2001, we have to support - // these old classes. - // - // Since we do want to support these - // compilers, the ``./configure'' - // script you run as the very first - // step of installing the library - // determines whether the compiler - // you want to use supports the new - // classes, or whether we have to - // fall back on the old ones. If the - // new classes are supported, then - // the preprocessor variable - // ``HAVE_STD_STRINGSTREAM'' is set - // in the ``base/config.h'' include - // file, that all include files in - // the library also include. Since we - // have included quite a number of - // files from the library at this - // point, the definition or - // non-definition of this - // preprocessor variable can now be - // used to decide whether old or new - // header names have to be used to - // import string stream classes: -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif + // ``ostringstream'': +#include // @sect3{The ``LaplaceProblem'' class template} @@ -807,36 +754,10 @@ void LaplaceProblem::output_results (const unsigned int cycle) const // strings, and one could as well // use stream modifiers such as // ``setw'', ``setprecision'', and - // so on. - // - // In C++, you can do this by using - // the so-called stringstream - // classes. As already discussed at - // the point of inclusion of the - // respective header file above, - // there is some historical - // confusion we have to work around - // here, since the class we'd like - // to use used to be called - // ``ostrstream'', but now is named - // ``ostringstream''. In the same - // way as done above in deciding - // which file to include, we here - // decide which class name to use: -#ifdef HAVE_STD_STRINGSTREAM + // so on. In C++, you can do this + // by using the so-called stringstream + // classes: std::ostringstream filename; -#else - std::ostrstream filename; -#endif - // Fortunately, the interface of - // the two classes which we might - // now be using, depending on which - // one is available, is close - // enough that we need to take care - // about the differences only once - // below, so we can use them in a - // rather straightforward way, even - // if they are not identical. // In order to now actually // generate a filename, we fill the @@ -847,33 +768,15 @@ void LaplaceProblem::output_results (const unsigned int cycle) const filename << "solution-" << cycle << ".eps"; - - // For the old string stream - // classes, we have to append the - // final '\0' that appears at the - // end of ``char *'' - // variables. This is done by the - // following construct: -#ifndef HAVE_STD_STRINGSTREAM - filename << std::ends; -#endif - // We can get whatever we wrote to - // the stream using the ``str()'' - // function. If the new - // stringstream classes are used, - // then the result is a string - // which we have to convert to a - // char* using the ``c_str()'' - // function, otherwise the result - // is a char* right away. Use that - // as filename for the output - // stream and then write the data - // to the file: -#ifdef HAVE_STD_STRINGSTREAM + + // We can get whatever we wrote to the + // stream using the ``str()'' function. The + // result is a string which we have to + // convert to a char* using the ``c_str()'' + // function. Use that as filename for the + // output stream and then write the data to + // the file: std::ofstream output (filename.str().c_str()); -#else - std::ofstream output (filename.str()); -#endif data_out.write_eps (output); } diff --git a/deal.II/lac/include/lac/block_matrix_array.h b/deal.II/lac/include/lac/block_matrix_array.h index 87320b854b..408eb8b520 100644 --- a/deal.II/lac/include/lac/block_matrix_array.h +++ b/deal.II/lac/include/lac/block_matrix_array.h @@ -24,12 +24,7 @@ #include #include #include - -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include template class BlockVector; @@ -737,25 +732,14 @@ BlockMatrixArray::print_latex (STREAM& out) const matrix_names.insert( std::pair >*, std::string> (m->matrix, std::string("M"))); -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream stream; -#else - std::ostrstream stream; -#endif - stream << matrix_number++; - -#ifndef HAVE_STD_STRINGSTREAM - stream << std::ends; -#endif - x.first->second += stream.str(); + + x.first->second += stream.str(); } -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream stream; -#else - std::ostrstream stream; -#endif + if (array(m->row, m->col) != "" && m->prefix >= 0) stream << "+"; if (m->prefix != 1.) @@ -765,9 +749,6 @@ BlockMatrixArray::print_latex (STREAM& out) const if (m->transpose) stream << "^T"; -#ifndef HAVE_STD_STRINGSTREAM - stream << std::ends; -#endif array(m->row, m->col) += stream.str(); } for (unsigned int i=0;i #include - -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif +#include /*----------------------- SolverControl ---------------------------------*/ @@ -52,17 +47,9 @@ SolverControl::NoConvergence::what () const throw () static std::string description; // convert the messages printed by the // exceptions into a std::string -#ifdef HAVE_STD_STRINGSTREAM std::ostringstream out; -#else - std::ostrstream out; -#endif - out << "Iterative method reported convergence failure in step " << last_step << " with residual " << last_residual; -#ifndef HAVE_STD_STRINGSTREAM - out << std::ends; -#endif description = out.str(); return description.c_str(); diff --git a/tests/deal.II/measure_et_al.cc b/tests/deal.II/measure_et_al.cc index e1bae432f0..03b9c9bcb5 100644 --- a/tests/deal.II/measure_et_al.cc +++ b/tests/deal.II/measure_et_al.cc @@ -1,5 +1,5 @@ // $Id$ -// Copyright (C) 2005 by the deal.II authors +// Copyright (C) 2005, 2006 by the deal.II authors // // Computes measure, center and barycenter on a variety of cells @@ -10,17 +10,6 @@ #include #include - -#ifdef HAVE_STD_STRINGSTREAM -# include -# define SSTREAM std::ostringstream -# define ENDSTRING -#else -# include -# define SSTREAM std::ostrstream -# define ENDSTRING << std::ends -#endif - #define PRECISION 5 char fname[50]; diff --git a/tests/fe/mapping.cc b/tests/fe/mapping.cc index d6b4e5cccb..27f6e73c73 100644 --- a/tests/fe/mapping.cc +++ b/tests/fe/mapping.cc @@ -1,5 +1,5 @@ // mapping.cc,v 1.19 2004/01/30 09:56:19 hartmann Exp -// Copyright (C) 2001, 2002, 2003, 2004, 2005 Ralf Hartmann +// Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006 Ralf Hartmann // // Shows the shape functions implemented and computes the area of cells. @@ -23,15 +23,7 @@ #include #include -#ifdef HAVE_STD_STRINGSTREAM -# include -# define SSTREAM std::ostringstream -# define ENDSTRING -#else -# include -# define SSTREAM std::ostrstream -# define ENDSTRING << std::ends -#endif +#include #define PRECISION 2 @@ -489,9 +481,9 @@ void mapping_test() { if (true) { - SSTREAM ost; + std::ostringstream ost; ost << "Mapping" << dim << "d-" << i << '-' - << mapping_strings[j] ENDSTRING; + << mapping_strings[j]; deallog << ost.str() << std::endl; plot_transformation(*mapping_ptr[j], fe_q4, cell, ost.str()); compute_area(*mapping_ptr[j], fe_q4, cell); @@ -499,18 +491,18 @@ void mapping_test() if (dim>1) { - SSTREAM ost; + std::ostringstream ost; ost << "MappingFace" << dim << "d-" << i << '-' - << mapping_strings[j] ENDSTRING; + << mapping_strings[j]; deallog << ost.str() << std::endl; plot_faces(*mapping_ptr[j], fe_q4, cell, ost.str()); } if (dim>1) { - SSTREAM ost; + std::ostringstream ost; ost << "MappingSubface" << dim << "d-" << i << '-' - << mapping_strings[j] ENDSTRING; + << mapping_strings[j]; deallog << ost.str() << std::endl; plot_subfaces(*mapping_ptr[j], fe_q4, cell, ost.str()); } diff --git a/tests/fe/performance.cc b/tests/fe/performance.cc index c8c5308e86..e51e79440c 100644 --- a/tests/fe/performance.cc +++ b/tests/fe/performance.cc @@ -22,11 +22,6 @@ #include #include -#ifdef HAVE_STD_STRINGSTREAM -# include -#else -# include -#endif template void performance (Triangulation& tr, -- 2.39.5