Commit a990d43c by Kilian Lackhove

interppointdatatofld: support for frompts being a csv file

parent 4402bb95
......@@ -45,6 +45,8 @@ using namespace std;
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/PtsField.h>
#include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/BasicUtils/PtsIO.h>
#include <LibUtilities/BasicUtils/CsvIO.h>
#include <boost/math/special_functions/fpclassify.hpp>
namespace bg = boost::geometry;
......@@ -84,11 +86,25 @@ void ProcessInterpPointDataToFld::Process(po::variables_map &vm)
ASSERTL0( m_config["frompts"].as<string>().compare("NotSet") != 0,
"ProcessInterpPointDataToFld requires frompts parameter");
string inFile = m_config["frompts"].as<string>().c_str();
LibUtilities::CommSharedPtr c =
LibUtilities::GetCommFactory().CreateInstance("Serial", 0, 0);
LibUtilities::PtsIOSharedPtr ptsIO =
MemoryManager<LibUtilities::PtsIO>::AllocateSharedPtr(c);
ptsIO->Import(inFile, fieldPts);
if (boost::filesystem::path(inFile).extension() == ".pts")
{
LibUtilities::PtsIOSharedPtr ptsIO =
MemoryManager<LibUtilities::PtsIO>::AllocateSharedPtr(m_f->m_comm);
ptsIO->Import(inFile, fieldPts);
}
else if (boost::filesystem::path(inFile).extension() == ".csv")
{
LibUtilities::CsvIOSharedPtr csvIO =
MemoryManager<LibUtilities::CsvIO>::AllocateSharedPtr(m_f->m_comm);
csvIO->Import(inFile, fieldPts);
}
else
{
ASSERTL0(false, "unknown frompts file type");
}
int nFields = fieldPts->GetNFields();
ASSERTL0(nFields > 0, "No field values provided in input");
......
......@@ -126,6 +126,7 @@ void ProcessInterpPoints::Process(po::variables_map &vm)
Array<OneD, Array<OneD, NekDouble> > pts;
m_f->m_fieldPts->GetPts(pts);
rng->m_checkShape = false;
rng->m_zmin = -1;
rng->m_zmax = 1;
......@@ -245,7 +246,7 @@ void ProcessInterpPoints::CreateFieldPts(po::variables_map &vm)
}
else
{
ASSERTL0(false, "no input file found");
ASSERTL0(false, "unknown topts file type");
}
}
......
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