Browse Source

Small chaange with reading VTU files so that char and string methods are congruent.

master
T-bone 8 years ago
parent
commit
2f99b8218c
2 changed files with 5 additions and 13 deletions
  1. 2
    2
      include/FEM4EllipticPDE.h
  2. 3
    11
      src/FEM4EllipticPDE.cpp

+ 2
- 2
include/FEM4EllipticPDE.h View File

144
             /**
144
             /**
145
              *  Read grid in from VTK file
145
              *  Read grid in from VTK file
146
              */
146
              */
147
-            void SetVTUGridFile( std::string& vtkGridFile );
147
+            void SetVTUGridFile( const std::string& vtkGridFile );
148
 
148
 
149
             /**
149
             /**
150
              *  Read grid in from VTK file
150
              *  Read grid in from VTK file
151
              */
151
              */
152
-            void SetVTUGridFile( char* vtkGridFile );
152
+            void SetVTUGridFile( const char* vtkGridFile );
153
 
153
 
154
             /** Sets up a DC problem with a survey
154
             /** Sets up a DC problem with a survey
155
              *  @param[in] ij is the injection index
155
              *  @param[in] ij is the injection index

+ 3
- 11
src/FEM4EllipticPDE.cpp View File

128
     //       Class:  FEM4EllipticPDE
128
     //       Class:  FEM4EllipticPDE
129
     //      Method:  SetVTUGridFile
129
     //      Method:  SetVTUGridFile
130
     //--------------------------------------------------------------------------------------
130
     //--------------------------------------------------------------------------------------
131
-    void FEM4EllipticPDE::SetVTUGridFile ( std::string& fname  ) {
132
-        std::cout  << "Loading VTK .vtu file " << fname;
133
-        vtkXMLUnstructuredGridReader* MeshReader = vtkXMLUnstructuredGridReader::New();
134
-        MeshReader->SetFileName(fname.c_str());
135
-        MeshReader->Update();
136
-        //vtkGrid->DeepCopy( MeshReader->GetOutput() );
137
-        //vtkGrid->ShallowCopy( MeshReader->GetOutput() );
138
-        vtkGrid = MeshReader->GetOutput();
139
-        MeshReader->Delete();
140
-        std::cout  << " Finished! " << std::endl;
131
+    void FEM4EllipticPDE::SetVTUGridFile ( const std::string& fname  ) {
132
+        SetVTUGridFile( fname.c_str() );
141
         return ;
133
         return ;
142
     }		// -----  end of method FEM4EllipticPDE::SetVTKGridFile  -----
134
     }		// -----  end of method FEM4EllipticPDE::SetVTKGridFile  -----
143
 
135
 
145
     //       Class:  FEM4EllipticPDE
137
     //       Class:  FEM4EllipticPDE
146
     //      Method:  SetVTUGridFile
138
     //      Method:  SetVTUGridFile
147
     //--------------------------------------------------------------------------------------
139
     //--------------------------------------------------------------------------------------
148
-    void FEM4EllipticPDE::SetVTUGridFile ( char* fname  ) {
140
+    void FEM4EllipticPDE::SetVTUGridFile ( const char* fname  ) {
149
         std::cout  << "Loading VTK .vtu file " << fname;
141
         std::cout  << "Loading VTK .vtu file " << fname;
150
         vtkXMLUnstructuredGridReader* MeshReader = vtkXMLUnstructuredGridReader::New();
142
         vtkXMLUnstructuredGridReader* MeshReader = vtkXMLUnstructuredGridReader::New();
151
         MeshReader->SetFileName(fname);
143
         MeshReader->SetFileName(fname);

Loading…
Cancel
Save