]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
use PathSearch class
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 3 May 2005 06:07:36 +0000 (06:07 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 3 May 2005 06:07:36 +0000 (06:07 +0000)
git-svn-id: https://svn.dealii.org/trunk@10612 0785d39b-7218-0410-832d-ea1e28bc413d

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

index e2d3d8e594ef88a24c96656bf59dbf1fd1e7c580..55ed5dae009389589ad14fd9e16ad044a920d0e3 100644 (file)
@@ -68,7 +68,7 @@ class SubCellData;
  * further details.
  *
  *
- * @sect3{Supported input formats}
+ * <h3>Supported input formats</h3>
  *
  * At present, the following input formats are supported:
  * <ul>
@@ -100,7 +100,7 @@ class SubCellData;
  * </ul>
  *
  *
- * @sect3{Structure of input grid data. The GridReordering class}
+ * <h3>Structure of input grid data. The GridReordering class</h3>
  * 
  * 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 <code>MESH</code>.
                                      */
     void read (const std::string&, Format format=Default);
     
index b4584493e9aacd5af824b91335c14ec1f6b9d3bd..8365f8a531addd19aefa98d96828468bd9edf7b3 100644 (file)
@@ -11,6 +11,7 @@
 //
 //---------------------------------------------------------------------------
 
+#include <base/path_search.h>
 
 #include <grid/grid_in.h>
 #include <grid/tria.h>
@@ -994,20 +995,9 @@ template <int dim>
 void GridIn<dim>::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();
 }
 
 

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.