From 59f99c05533668da0e9e18dfd0c6effa1dfb94cf Mon Sep 17 00:00:00 2001 From: guido Date: Tue, 3 May 2005 06:07:36 +0000 Subject: [PATCH] use PathSearch class git-svn-id: https://svn.dealii.org/trunk@10612 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/grid/grid_in.h | 9 ++++++--- deal.II/deal.II/source/grid/grid_in.cc | 16 +++------------- 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/deal.II/deal.II/include/grid/grid_in.h b/deal.II/deal.II/include/grid/grid_in.h index e2d3d8e594..55ed5dae00 100644 --- a/deal.II/deal.II/include/grid/grid_in.h +++ b/deal.II/deal.II/include/grid/grid_in.h @@ -68,7 +68,7 @@ class SubCellData; * further details. * * - * @sect3{Supported input formats} + *

Supported input formats

* * At present, the following input formats are supported: * * * - * @sect3{Structure of input grid data. The GridReordering class} + *

Structure of input grid data. The GridReordering class

* * It is your duty to use a correct numbering of vertices in the cell * list, i.e. for lines in 1d, you have to first give the vertex with @@ -203,7 +203,10 @@ class GridIn /** * Open the file given by the * string and call the previous - * function read(). + * function read(). This function + * uses the PathSearch mechanism + * to find files. The file class + * used is MESH. */ void read (const std::string&, Format format=Default); diff --git a/deal.II/deal.II/source/grid/grid_in.cc b/deal.II/deal.II/source/grid/grid_in.cc index b4584493e9..8365f8a531 100644 --- a/deal.II/deal.II/source/grid/grid_in.cc +++ b/deal.II/deal.II/source/grid/grid_in.cc @@ -11,6 +11,7 @@ // //--------------------------------------------------------------------------- +#include #include #include @@ -994,20 +995,9 @@ template void GridIn::read (const std::string& filename, Format format) { - std::ifstream in(filename.c_str()); - - Assert (in.is_open(), ExcFileNotOpen(filename.c_str())); - -//TODO:[GK] Do we really need the following, which does not compile with gcc 2.95? -// if (!in) -// { -// std::ios_base::iostate state = in.rdstate(); -// std::cerr << "File open, but error " << state << std::endl; -// exit(1); -// } - + PathSearch search("MESH"); + std::istream& in = search.open(filename.c_str()); read(in, format); - in.close(); } -- 2.39.5