Commit 312cc844 authored by Douglas Serson's avatar Douglas Serson

Adjust expansion from file to Hdf5

parent 67ed2eb6
...@@ -298,10 +298,20 @@ namespace Nektar ...@@ -298,10 +298,20 @@ namespace Nektar
"A filename must be specified for the FILE " "A filename must be specified for the FILE "
"attribute of expansion"); "attribute of expansion");
// Create fieldIO object to load file
// need a serial communicator to avoid problems with
// shared file system
CommSharedPtr comm=
GetCommFactory().CreateInstance("Serial", 0, 0);
std::string iofmt = FieldIO::GetFileType(
filenameStr, comm);
FieldIOSharedPtr f = GetFieldIOFactory().CreateInstance(
iofmt,
comm,
pSession->GetSharedFilesystem());
// Load field definitions from file // Load field definitions from file
std::vector<LibUtilities::FieldDefinitionsSharedPtr> fielddefs; std::vector<LibUtilities::FieldDefinitionsSharedPtr> fielddefs;
LibUtilities::FieldIO f(pSession->GetComm()); f->Import(filenameStr, fielddefs);
f.Import(filenameStr, fielddefs);
// Parse field definitions // Parse field definitions
for (int i = 0; i < fielddefs.size(); ++i) for (int i = 0; i < fielddefs.size(); ++i)
......
...@@ -1067,8 +1067,10 @@ namespace Nektar ...@@ -1067,8 +1067,10 @@ namespace Nektar
"attribute of expansion"); "attribute of expansion");
std::vector<LibUtilities::FieldDefinitionsSharedPtr> fielddefs; std::vector<LibUtilities::FieldDefinitionsSharedPtr> fielddefs;
LibUtilities::FieldIO f(m_session->GetComm()); LibUtilities::FieldIOSharedPtr f =
f.Import(filenameStr, fielddefs); LibUtilities::FieldIO::CreateForFile(
m_session, filenameStr);
f->Import(filenameStr, fielddefs);
SetExpansions(fielddefs); SetExpansions(fielddefs);
} }
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment