Commit ec3d866d by Kilian Lackhove

adjusted InputPts to new FieldUtils structure

parent 08375931
......@@ -83,63 +83,26 @@ InputPts::~InputPts()
*/
void InputPts::Process(po::variables_map &vm)
{
if (m_f->m_verbose)
{
if (m_f->m_comm->TreatAsRankZero())
{
cout << "Processing input pts file" << endl;
}
}
string inFile = m_config["infile"].as<string>();
string ptsending;
// Determine appropriate field input
if (m_f->m_inputfiles.count("pts") != 0)
{
ptsending = "pts";
LibUtilities::CsvIOSharedPtr csvIO =
MemoryManager<LibUtilities::CsvIO>::AllocateSharedPtr(m_f->m_comm);
csvIO->Import(inFile, m_f->m_fieldPts);
}
else if (m_f->m_inputfiles.count("csv") != 0)
{
ptsending = "csv";
LibUtilities::PtsIOSharedPtr ptsIO =
MemoryManager<LibUtilities::PtsIO>::AllocateSharedPtr(m_f->m_comm);
ptsIO->Import(inFile, m_f->m_fieldPts);
}
else
{
ASSERTL0(false, "no input file found");
ASSERTL0(false, "unknown input file type");
}
string inFile = m_config["infile"].as<string>();
LibUtilities::PtsIOSharedPtr ptsIO;
if (m_f->m_session)
{
if (!ptsending.compare("pts"))
{
ptsIO = MemoryManager<LibUtilities::PtsIO>::AllocateSharedPtr(
m_f->m_session->GetComm());
}
else
{
ptsIO = MemoryManager<LibUtilities::CsvIO>::AllocateSharedPtr(
m_f->m_session->GetComm());
}
}
else // serial communicator
{
LibUtilities::CommSharedPtr c =
LibUtilities::GetCommFactory().CreateInstance("Serial", 0, 0);
if (!ptsending.compare("pts"))
{
ptsIO = MemoryManager<LibUtilities::PtsIO>::AllocateSharedPtr(c);
}
else
{
ptsIO = MemoryManager<LibUtilities::CsvIO>::AllocateSharedPtr(c);
}
}
ptsIO->Import(inFile, m_f->m_fieldPts);
// save field names
for (int j = 0; j < m_f->m_fieldPts->GetNFields(); ++j)
{
......
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 sign in to comment