Skip to content

Commit

Permalink
Merge pull request #61 from visit-dav/bug/markcmiller86/11Feb19_mfem_…
Browse files Browse the repository at this point in the history
…read_gz

adding use of visit_gzstream to support compressed MFEM files
  • Loading branch information
markcmiller86 committed Feb 11, 2019
2 parents 1fa3895 + cede2fd commit 52bcaf4
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/databases/MFEM/avtMFEMFileFormat.C
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
#include <avtResolutionSelection.h>

#include <StringHelpers.h>
#include <visit_gzstream.h>
#include <vtkUnstructuredGrid.h>
#include <vtkCell.h>
#include <vtkLine.h>
Expand Down Expand Up @@ -664,8 +665,8 @@ avtMFEMFileFormat::FetchMesh(const std::string &mesh_name,int domain)
return new Mesh(imeshstr, 1, 0, false);
}

ifstream imesh(mesh_path.c_str());
if(!imesh)
visit_ifstream imesh(mesh_path.c_str());
if(imesh().fail())
{
//failed to open mesh file
ostringstream msg;
Expand All @@ -678,7 +679,7 @@ avtMFEMFileFormat::FetchMesh(const std::string &mesh_name,int domain)
EXCEPTION1(InvalidFilesException, msg.str());
}

return new Mesh(imesh, 1, 0, false);
return new Mesh(imesh(), 1, 0, false);
}

// ****************************************************************************
Expand Down Expand Up @@ -867,8 +868,8 @@ avtMFEMFileFormat::GetRefinedVar(const std::string &var_name,

if (!gf)
{
ifstream igf(field_path.c_str());
if (!igf)
visit_ifstream igf(field_path.c_str());
if (igf().fail())
{
//failed to open gf file
ostringstream msg;
Expand All @@ -881,7 +882,7 @@ avtMFEMFileFormat::GetRefinedVar(const std::string &var_name,

EXCEPTION1(InvalidFilesException, msg.str());
}
gf = new GridFunction(mesh,igf);
gf = new GridFunction(mesh,igf());
}

int npts=0;
Expand Down

0 comments on commit 52bcaf4

Please sign in to comment.