Преглед изворни кода

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

master
T-bone пре 8 година
родитељ
комит
2f99b8218c
2 измењених фајлова са 5 додато и 13 уклоњено
  1. 2
    2
      include/FEM4EllipticPDE.h
  2. 3
    11
      src/FEM4EllipticPDE.cpp

+ 2
- 2
include/FEM4EllipticPDE.h Прегледај датотеку

@@ -144,12 +144,12 @@ namespace Lemma {
144 144
             /**
145 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 150
              *  Read grid in from VTK file
151 151
              */
152
-            void SetVTUGridFile( char* vtkGridFile );
152
+            void SetVTUGridFile( const char* vtkGridFile );
153 153
 
154 154
             /** Sets up a DC problem with a survey
155 155
              *  @param[in] ij is the injection index

+ 3
- 11
src/FEM4EllipticPDE.cpp Прегледај датотеку

@@ -128,16 +128,8 @@ namespace Lemma {
128 128
     //       Class:  FEM4EllipticPDE
129 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 133
         return ;
142 134
     }		// -----  end of method FEM4EllipticPDE::SetVTKGridFile  -----
143 135
 
@@ -145,7 +137,7 @@ namespace Lemma {
145 137
     //       Class:  FEM4EllipticPDE
146 138
     //      Method:  SetVTUGridFile
147 139
     //--------------------------------------------------------------------------------------
148
-    void FEM4EllipticPDE::SetVTUGridFile ( char* fname  ) {
140
+    void FEM4EllipticPDE::SetVTUGridFile ( const char* fname  ) {
149 141
         std::cout  << "Loading VTK .vtu file " << fname;
150 142
         vtkXMLUnstructuredGridReader* MeshReader = vtkXMLUnstructuredGridReader::New();
151 143
         MeshReader->SetFileName(fname);

Loading…
Откажи
Сачувај