Commit 7cd08f41 authored by Dave Moxey's avatar Dave Moxey
Browse files

Fix some issues inside FieldConvert

parent d8790366
......@@ -258,7 +258,9 @@ LIB_UTILITIES_EXPORT void Import(
}
#endif
CommSharedPtr c = GetCommFactory().CreateInstance("Serial", 0, 0);
FieldIOSharedPtr f = GetFieldIOFactory().CreateInstance("Xml", c, false);
const std::string iofmt = FieldIO::GetFileType(infilename, c);
std::cout << "LOADING " << iofmt << std::endl;
FieldIOSharedPtr f = GetFieldIOFactory().CreateInstance(iofmt, c, false);
f->Import(infilename, fielddefs, fielddata, fieldinfomap, ElementIDs);
}
......
......@@ -56,7 +56,6 @@
#include <MultiRegions/DisContField2D.h>
#include <MultiRegions/DisContField3D.h>
using namespace std;
namespace Nektar
......@@ -96,7 +95,6 @@ struct Field {
LibUtilities::CommSharedPtr m_comm;
LibUtilities::SessionReaderSharedPtr m_session;
SpatialDomains::MeshGraphSharedPtr m_graph;
LibUtilities::FieldIOSharedPtr m_fld;
LibUtilities::PtsIOSharedPtr m_ptsIO;
map<string, vector<string> > m_inputfiles;
......@@ -112,6 +110,7 @@ struct Field {
MultiRegions::AssemblyMapCGSharedPtr m_locToGlobalMap;
LibUtilities::FieldMetaDataMap m_fieldMetaDataMap;
map<string, LibUtilities::FieldIOSharedPtr> m_fld;
MultiRegions::ExpListSharedPtr SetUpFirstExpList(int NumHomogeneousDir,
bool fldfilegiven = false)
......@@ -400,6 +399,17 @@ struct Field {
return exp;
};
FieldIOSharedPtr FieldIOForFile(string filename)
{
string fmt = FieldIO::GetFileType(filename, session->GetComm());
map<string, LibUtilities::FieldIOSharedPtr>::iterator it =
m_fld.find(fmt);
if (it == m_fld.end())
{
}
}
MultiRegions::ExpListSharedPtr AppendExpList(int NumHomogeneousDir,
string var = "DefaultVar",
bool NewField = false)
......
......@@ -125,24 +125,21 @@ void InputFld::Process(po::variables_map &vm)
ASSERTL0(false,"no input file found");
}
if(!m_f->m_fld)
const std::string& filename = m_f->m_inputfiles[fldending][0];
if(m_f->m_session)
{
const std::string& filename = m_f->m_inputfiles[fldending][0];
if(m_f->m_session)
{
m_f->m_fld = LibUtilities::MakeFieldIOForFile(
m_f->m_session, filename);
}
else // serial communicator
{
LibUtilities::CommSharedPtr c =
LibUtilities::GetCommFactory().CreateInstance("Serial", 0, 0);
const std::string iofmt =
LibUtilities::FieldIO::GetFileType(
filename, m_f->m_session->GetComm());
m_f->m_fld = LibUtilities::GetFieldIOFactory().CreateInstance(
iofmt, c, false);
}
m_f->m_fld = LibUtilities::MakeFieldIOForFile(
m_f->m_session, filename);
}
else // serial communicator
{
LibUtilities::CommSharedPtr c =
LibUtilities::GetCommFactory().CreateInstance("Serial", 0, 0);
const std::string iofmt =
LibUtilities::FieldIO::GetFileType(
filename, m_f->m_session->GetComm());
m_f->m_fld = LibUtilities::GetFieldIOFactory().CreateInstance(
iofmt, c, false);
}
......
......@@ -281,9 +281,8 @@ void InputXml::Process(po::variables_map &vm)
timerpart.Start();
}
}
m_f->m_graph = SpatialDomains::MeshGraph::Read(m_f->m_session,rng);
m_f->m_fld = LibUtilities::MakeDefaultFieldIO(m_f->m_session);
if(m_f->m_verbose)
{
......@@ -330,8 +329,10 @@ void InputXml::Process(po::variables_map &vm)
{
ElementGIDs[i++] = expIt->second->m_geomShPtr->GetGlobalID();
}
m_f->m_fld->Import(m_f->m_inputfiles[fldending][0],m_f->m_fielddef,
m_f->m_fld = LibUtilities::MakeFieldIOForFile(
m_f->m_session, m_f->m_inputfiles[fldending][0]);
m_f->m_fld->Import(m_f->m_inputfiles[fldending][0], m_f->m_fielddef,
LibUtilities::NullVectorNekDoubleVector,
LibUtilities::NullFieldMetaDataMap,
ElementGIDs);
......
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