Commit 4ae64aa0 authored by David Moxey's avatar David Moxey
Browse files

Tidyup of ParseUtils classes using boost::spirit::qi vs boost::spirit::classic

parent 5133f68e
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include <Collections/CollectionOptimisation.h> #include <Collections/CollectionOptimisation.h>
#include <LibUtilities/BasicUtils/ParseUtils.hpp> #include <LibUtilities/BasicUtils/ParseUtils.h>
using namespace std; using namespace std;
...@@ -230,7 +230,7 @@ CollectionOptimisation::CollectionOptimisation( ...@@ -230,7 +230,7 @@ CollectionOptimisation::CollectionOptimisation(
else else
{ {
vector<unsigned int> orders; vector<unsigned int> orders;
ParseUtils::GenerateSeqVector(order.c_str(), orders); ParseUtils::GenerateSeqVector(order, orders);
for (int i = 0; i < orders.size(); ++i) for (int i = 0; i < orders.size(); ++i)
{ {
......
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <string> #include <string>
using namespace std; using namespace std;
#include <LibUtilities/BasicUtils/ParseUtils.h>
#include <LibUtilities/BasicUtils/PtsField.h> #include <LibUtilities/BasicUtils/PtsField.h>
#include <LibUtilities/BasicUtils/PtsIO.h> #include <LibUtilities/BasicUtils/PtsIO.h>
...@@ -106,8 +107,8 @@ void InputDat::Process(po::variables_map &vm) ...@@ -106,8 +107,8 @@ void InputDat::Process(po::variables_map &vm)
// note this expects a comma separated list but // note this expects a comma separated list but
// does not work for white space separated lists! // does not work for white space separated lists!
bool valid = ParseUtils::GenerateOrderedStringVector( bool valid = ParseUtils::GenerateVector(
line.substr(pos).c_str(), fieldNames); line.substr(pos), fieldNames);
ASSERTL0(valid, "Unable to process list of field variable in " ASSERTL0(valid, "Unable to process list of field variable in "
" VARIABLES list: " + " VARIABLES list: " +
line.substr(pos)); line.substr(pos));
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include <string> #include <string>
using namespace std; using namespace std;
#include <LibUtilities/BasicUtils/ParseUtils.h>
#include <LibUtilities/BasicUtils/Timer.h> #include <LibUtilities/BasicUtils/Timer.h>
#include "InputXml.h" #include "InputXml.h"
...@@ -115,8 +116,7 @@ void InputXml::Process(po::variables_map &vm) ...@@ -115,8 +116,7 @@ void InputXml::Process(po::variables_map &vm)
if (vm.count("range")) if (vm.count("range"))
{ {
vector<NekDouble> values; vector<NekDouble> values;
ASSERTL0(ParseUtils::GenerateUnOrderedVector( ASSERTL0(ParseUtils::GenerateVector(vm["range"].as<string>(), values),
vm["range"].as<string>().c_str(), values),
"Failed to interpret range string"); "Failed to interpret range string");
ASSERTL0(values.size() > 1, "Do not have minimum values of xmin,xmax"); ASSERTL0(values.size() > 1, "Do not have minimum values of xmin,xmax");
......
...@@ -41,7 +41,6 @@ using namespace std; ...@@ -41,7 +41,6 @@ using namespace std;
#include "ProcessAddCompositeID.h" #include "ProcessAddCompositeID.h"
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
namespace Nektar namespace Nektar
......
...@@ -39,7 +39,6 @@ using namespace std; ...@@ -39,7 +39,6 @@ using namespace std;
#include "ProcessAddFld.h" #include "ProcessAddFld.h"
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
namespace Nektar namespace Nektar
......
...@@ -39,7 +39,7 @@ using namespace std; ...@@ -39,7 +39,7 @@ using namespace std;
#include "ProcessBoundaryExtract.h" #include "ProcessBoundaryExtract.h"
#include <LibUtilities/BasicUtils/ParseUtils.hpp> #include <LibUtilities/BasicUtils/ParseUtils.h>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
namespace Nektar namespace Nektar
...@@ -107,8 +107,7 @@ void ProcessBoundaryExtract::Process(po::variables_map &vm) ...@@ -107,8 +107,7 @@ void ProcessBoundaryExtract::Process(po::variables_map &vm)
} }
else else
{ {
ASSERTL0(ParseUtils::GenerateOrderedVector(bvalues.c_str(), ASSERTL0(ParseUtils::GenerateVector(bvalues, bndRegions),
bndRegions),
"Failed to interpret bnd values string"); "Failed to interpret bnd values string");
} }
......
...@@ -39,7 +39,7 @@ using namespace std; ...@@ -39,7 +39,7 @@ using namespace std;
#include "ProcessC0Projection.h" #include "ProcessC0Projection.h"
#include <LibUtilities/BasicUtils/ParseUtils.hpp> #include <LibUtilities/BasicUtils/ParseUtils.h>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
namespace Nektar namespace Nektar
...@@ -155,7 +155,7 @@ void ProcessC0Projection::Process(po::variables_map &vm) ...@@ -155,7 +155,7 @@ void ProcessC0Projection::Process(po::variables_map &vm)
else else
{ {
ASSERTL0( ASSERTL0(
ParseUtils::GenerateOrderedVector(fields.c_str(), processFields), ParseUtils::GenerateVector(fields, processFields),
"Failed to interpret field string in C0Projection"); "Failed to interpret field string in C0Projection");
} }
......
...@@ -39,7 +39,6 @@ using namespace std; ...@@ -39,7 +39,6 @@ using namespace std;
#include "ProcessCombineAvg.h" #include "ProcessCombineAvg.h"
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
namespace Nektar namespace Nektar
......
...@@ -39,7 +39,6 @@ using namespace std; ...@@ -39,7 +39,6 @@ using namespace std;
#include "ProcessConcatenateFld.h" #include "ProcessConcatenateFld.h"
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
namespace Nektar namespace Nektar
......
...@@ -39,7 +39,6 @@ using namespace std; ...@@ -39,7 +39,6 @@ using namespace std;
#include "ProcessCreateExp.h" #include "ProcessCreateExp.h"
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/BasicUtils/Timer.h> #include <LibUtilities/BasicUtils/Timer.h>
......
...@@ -40,7 +40,6 @@ using namespace std; ...@@ -40,7 +40,6 @@ using namespace std;
#include "ProcessDisplacement.h" #include "ProcessDisplacement.h"
#include <LibUtilities/BasicUtils/HashUtils.hpp> #include <LibUtilities/BasicUtils/HashUtils.hpp>
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LocalRegions/SegExp.h> #include <LocalRegions/SegExp.h>
#include <LocalRegions/TriExp.h> #include <LocalRegions/TriExp.h>
......
...@@ -38,7 +38,6 @@ using namespace std; ...@@ -38,7 +38,6 @@ using namespace std;
#include "ProcessEquiSpacedOutput.h" #include "ProcessEquiSpacedOutput.h"
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/Foundations/Interp.h> #include <LibUtilities/Foundations/Interp.h>
#include <StdRegions/StdQuadExp.h> #include <StdRegions/StdQuadExp.h>
......
...@@ -41,7 +41,6 @@ using namespace std; ...@@ -41,7 +41,6 @@ using namespace std;
#include "ProcessMapping.h" #include "ProcessMapping.h"
#include <GlobalMapping/Mapping.h> #include <GlobalMapping/Mapping.h>
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
namespace Nektar namespace Nektar
......
...@@ -39,7 +39,6 @@ using namespace std; ...@@ -39,7 +39,6 @@ using namespace std;
#include "ProcessHomogeneousPlane.h" #include "ProcessHomogeneousPlane.h"
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
namespace Nektar namespace Nektar
......
...@@ -39,7 +39,6 @@ using namespace std; ...@@ -39,7 +39,6 @@ using namespace std;
#include "ProcessHomogeneousStretch.h" #include "ProcessHomogeneousStretch.h"
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
namespace Nektar namespace Nektar
......
...@@ -39,7 +39,7 @@ using namespace std; ...@@ -39,7 +39,7 @@ using namespace std;
#include "ProcessInnerProduct.h" #include "ProcessInnerProduct.h"
#include <LibUtilities/BasicUtils/ParseUtils.hpp> #include <LibUtilities/BasicUtils/ParseUtils.h>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
namespace Nektar namespace Nektar
...@@ -112,7 +112,7 @@ void ProcessInnerProduct::Process(po::variables_map &vm) ...@@ -112,7 +112,7 @@ void ProcessInnerProduct::Process(po::variables_map &vm)
} }
else else
{ {
ASSERTL0(ParseUtils::GenerateSeqVector(fields.c_str(), processFields), ASSERTL0(ParseUtils::GenerateVector(fields, processFields),
"Failed to interpret field string in module innerproduct"); "Failed to interpret field string in module innerproduct");
} }
...@@ -123,7 +123,7 @@ void ProcessInnerProduct::Process(po::variables_map &vm) ...@@ -123,7 +123,7 @@ void ProcessInnerProduct::Process(po::variables_map &vm)
else else
{ {
ASSERTL0( ASSERTL0(
ParseUtils::GenerateSeqVector(multifldidsstr.c_str(), multiFldIds), ParseUtils::GenerateSeqVector(multifldidsstr, multiFldIds),
"Failed to interpret multifldids string in module innerproduct"); "Failed to interpret multifldids string in module innerproduct");
int end = fromfld.find_first_of('.', 0); int end = fromfld.find_first_of('.', 0);
string endstr = fromfld.substr(end, fromfld.size()); string endstr = fromfld.substr(end, fromfld.size());
......
...@@ -40,7 +40,7 @@ using namespace std; ...@@ -40,7 +40,7 @@ using namespace std;
#include "ProcessInterpField.h" #include "ProcessInterpField.h"
#include <FieldUtils/Interpolator.h> #include <FieldUtils/Interpolator.h>
#include <LibUtilities/BasicUtils/ParseUtils.hpp> #include <LibUtilities/BasicUtils/ParseUtils.h>
#include <LibUtilities/BasicUtils/Progressbar.hpp> #include <LibUtilities/BasicUtils/Progressbar.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <boost/math/special_functions/fpclassify.hpp> #include <boost/math/special_functions/fpclassify.hpp>
...@@ -87,8 +87,7 @@ void ProcessInterpField::Process(po::variables_map &vm) ...@@ -87,8 +87,7 @@ void ProcessInterpField::Process(po::variables_map &vm)
std::vector<std::string> files; std::vector<std::string> files;
// set up session file for from field // set up session file for from field
ParseUtils::GenerateOrderedStringVector( ParseUtils::GenerateVector(m_config["fromxml"].as<string>(), files);
m_config["fromxml"].as<string>().c_str(), files);
fromField->m_session = fromField->m_session =
LibUtilities::SessionReader::CreateInstance(0, 0, files); LibUtilities::SessionReader::CreateInstance(0, 0, files);
......
...@@ -42,7 +42,6 @@ using namespace std; ...@@ -42,7 +42,6 @@ using namespace std;
#include "ProcessInterpPointDataToFld.h" #include "ProcessInterpPointDataToFld.h"
#include <FieldUtils/Interpolator.h> #include <FieldUtils/Interpolator.h>
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/PtsField.h> #include <LibUtilities/BasicUtils/PtsField.h>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/BasicUtils/PtsIO.h> #include <LibUtilities/BasicUtils/PtsIO.h>
......
...@@ -41,7 +41,7 @@ using namespace std; ...@@ -41,7 +41,7 @@ using namespace std;
#include <boost/geometry.hpp> #include <boost/geometry.hpp>
#include "ProcessInterpPoints.h" #include "ProcessInterpPoints.h"
#include <LibUtilities/BasicUtils/ParseUtils.hpp> #include <LibUtilities/BasicUtils/ParseUtils.h>
#include <LibUtilities/BasicUtils/Progressbar.hpp> #include <LibUtilities/BasicUtils/Progressbar.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/BasicUtils/PtsIO.h> #include <LibUtilities/BasicUtils/PtsIO.h>
...@@ -107,8 +107,7 @@ void ProcessInterpPoints::Process(po::variables_map &vm) ...@@ -107,8 +107,7 @@ void ProcessInterpPoints::Process(po::variables_map &vm)
FieldSharedPtr fromField = std::shared_ptr<Field>(new Field()); FieldSharedPtr fromField = std::shared_ptr<Field>(new Field());
std::vector<std::string> files; std::vector<std::string> files;
ParseUtils::GenerateOrderedStringVector( ParseUtils::GenerateVector(m_config["fromxml"].as<string>(), files);
m_config["fromxml"].as<string>().c_str(), files);
// set up session file for from field // set up session file for from field
fromField->m_session = fromField->m_session =
LibUtilities::SessionReader::CreateInstance(0, 0, files); LibUtilities::SessionReader::CreateInstance(0, 0, files);
...@@ -252,8 +251,8 @@ void ProcessInterpPoints::CreateFieldPts(po::variables_map &vm) ...@@ -252,8 +251,8 @@ void ProcessInterpPoints::CreateFieldPts(po::variables_map &vm)
else if (m_config["line"].as<string>().compare("NotSet") != 0) else if (m_config["line"].as<string>().compare("NotSet") != 0)
{ {
vector<NekDouble> values; vector<NekDouble> values;
ASSERTL0(ParseUtils::GenerateUnOrderedVector( ASSERTL0(ParseUtils::GenerateVector(
m_config["line"].as<string>().c_str(), values), m_config["line"].as<string>(), values),
"Failed to interpret line string"); "Failed to interpret line string");
ASSERTL0(values.size() > 2, ASSERTL0(values.size() > 2,
...@@ -307,8 +306,8 @@ void ProcessInterpPoints::CreateFieldPts(po::variables_map &vm) ...@@ -307,8 +306,8 @@ void ProcessInterpPoints::CreateFieldPts(po::variables_map &vm)
else if (m_config["plane"].as<string>().compare("NotSet") != 0) else if (m_config["plane"].as<string>().compare("NotSet") != 0)
{ {
vector<NekDouble> values; vector<NekDouble> values;
ASSERTL0(ParseUtils::GenerateUnOrderedVector( ASSERTL0(ParseUtils::GenerateVector(
m_config["plane"].as<string>().c_str(), values), m_config["plane"].as<string>(), values),
"Failed to interpret plane string"); "Failed to interpret plane string");
ASSERTL0(values.size() > 9, ASSERTL0(values.size() > 9,
...@@ -378,8 +377,8 @@ void ProcessInterpPoints::CreateFieldPts(po::variables_map &vm) ...@@ -378,8 +377,8 @@ void ProcessInterpPoints::CreateFieldPts(po::variables_map &vm)
else if (m_config["box"].as<string>().compare("NotSet") != 0) else if (m_config["box"].as<string>().compare("NotSet") != 0)
{ {
vector<NekDouble> values; vector<NekDouble> values;
ASSERTL0(ParseUtils::GenerateUnOrderedVector( ASSERTL0(ParseUtils::GenerateVector(
m_config["box"].as<string>().c_str(), values), m_config["box"].as<string>(), values),
"Failed to interpret box string"); "Failed to interpret box string");
ASSERTL0(values.size() == 9, ASSERTL0(values.size() == 9,
...@@ -499,9 +498,8 @@ void ProcessInterpPoints::calcCp0() ...@@ -499,9 +498,8 @@ void ProcessInterpPoints::calcCp0()
vector<int> velid; vector<int> velid;
vector<NekDouble> values; vector<NekDouble> values;
ASSERTL0(ParseUtils::GenerateUnOrderedVector( ASSERTL0(ParseUtils::GenerateVector(m_config["cp"].as<string>(), values),
m_config["cp"].as<string>().c_str(),values), "Failed to interpret cp string");
"Failed to interpret cp string");
ASSERTL0(values.size() == 2, ASSERTL0(values.size() == 2,
"cp string should contain 2 values " "cp string should contain 2 values "
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
using namespace std; using namespace std;
#include <FieldUtils/Interpolator.h> #include <FieldUtils/Interpolator.h>
#include <LibUtilities/BasicUtils/ParseUtils.hpp> #include <LibUtilities/BasicUtils/ParseUtils.h>
#include <LibUtilities/BasicUtils/Progressbar.hpp> #include <LibUtilities/BasicUtils/Progressbar.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/BasicUtils/PtsIO.h> #include <LibUtilities/BasicUtils/PtsIO.h>
...@@ -157,8 +157,8 @@ void ProcessInterpPtsToPts::CreateFieldPts(po::variables_map &vm) ...@@ -157,8 +157,8 @@ void ProcessInterpPtsToPts::CreateFieldPts(po::variables_map &vm)
else if (m_config["line"].as<string>().compare("NotSet") != 0) else if (m_config["line"].as<string>().compare("NotSet") != 0)
{ {
vector<NekDouble> values; vector<NekDouble> values;
ASSERTL0(ParseUtils::GenerateUnOrderedVector( ASSERTL0(ParseUtils::GenerateVector(
m_config["line"].as<string>().c_str(), values), m_config["line"].as<string>(), values),
"Failed to interpret line string"); "Failed to interpret line string");
ASSERTL0(values.size() > 2, ASSERTL0(values.size() > 2,
...@@ -212,8 +212,8 @@ void ProcessInterpPtsToPts::CreateFieldPts(po::variables_map &vm) ...@@ -212,8 +212,8 @@ void ProcessInterpPtsToPts::CreateFieldPts(po::variables_map &vm)
else if (m_config["plane"].as<string>().compare("NotSet") != 0) else if (m_config["plane"].as<string>().compare("NotSet") != 0)
{ {
vector<NekDouble> values; vector<NekDouble> values;
ASSERTL0(ParseUtils::GenerateUnOrderedVector( ASSERTL0(ParseUtils::GenerateVector(
m_config["plane"].as<string>().c_str(), values), m_config["plane"].as<string>(), values),
"Failed to interpret plane string"); "Failed to interpret plane string");
ASSERTL0(values.size() > 9, ASSERTL0(values.size() > 9,
...@@ -283,8 +283,8 @@ void ProcessInterpPtsToPts::CreateFieldPts(po::variables_map &vm) ...@@ -283,8 +283,8 @@ void ProcessInterpPtsToPts::CreateFieldPts(po::variables_map &vm)
else if (m_config["box"].as<string>().compare("NotSet") != 0) else if (m_config["box"].as<string>().compare("NotSet") != 0)
{ {
vector<NekDouble> values; vector<NekDouble> values;
ASSERTL0(ParseUtils::GenerateUnOrderedVector( ASSERTL0(ParseUtils::GenerateVector(
m_config["box"].as<string>().c_str(), values), m_config["box"].as<string>(), values),
"Failed to interpret box string"); "Failed to interpret box string");
ASSERTL0(values.size() == 9, ASSERTL0(values.size() == 9,
...@@ -405,8 +405,8 @@ void ProcessInterpPtsToPts::calcCp0() ...@@ -405,8 +405,8 @@ void ProcessInterpPtsToPts::calcCp0()
vector<int> velid; vector<int> velid;
vector<NekDouble> values; vector<NekDouble> values;
ASSERTL0(ParseUtils::GenerateUnOrderedVector( ASSERTL0(ParseUtils::GenerateVector(
m_config["cp"].as<string>().c_str(),values), m_config["cp"].as<string>(),values),
"Failed to interpret cp string"); "Failed to interpret cp string");
ASSERTL0(values.size() == 2, ASSERTL0(values.size() == 2,
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
#include <LibUtilities/BasicUtils/Timer.h> #include <LibUtilities/BasicUtils/Timer.h>
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/Progressbar.hpp> #include <LibUtilities/BasicUtils/Progressbar.hpp>
#include <boost/math/special_functions/fpclassify.hpp> #include <boost/math/special_functions/fpclassify.hpp>
......
...@@ -39,7 +39,6 @@ using namespace std; ...@@ -39,7 +39,6 @@ using namespace std;
#include "ProcessJacobianEnergy.h" #include "ProcessJacobianEnergy.h"
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
namespace Nektar namespace Nektar
......
...@@ -39,7 +39,6 @@ using namespace std; ...@@ -39,7 +39,6 @@ using namespace std;
#include "ProcessMapping.h" #include "ProcessMapping.h"
#include <LibUtilities/BasicUtils/ParseUtils.hpp>
#include <LibUtilities/BasicUtils/SharedArray.hpp> #include <LibUtilities/BasicUtils/SharedArray.hpp>
namespace Nektar namespace Nektar
......
...@@ -39,7 +39,6 @@ using namespace std; ...@@ -39,7 +39,6 @@ using namespace std;