Nektar++
Classes | Static Public Member Functions | List of all members
Nektar::ParseUtils Class Reference

#include <ParseUtils.hpp>

Classes

struct  fctor1
 
struct  fctor2
 
struct  fctor3
 
struct  fctor4
 
struct  fctor5
 
struct  SymbolFunctor
 
struct  ValueFunctor
 

Static Public Member Functions

static bool ParseRealAssignment (const char *const str, std::string &symbol, NekDouble &value)
 
static bool GenerateSeqVector (const char *const str, std::vector< unsigned int > &vec)
 
static bool GenerateOrderedVector (const char *const str, std::vector< unsigned int > &vec)
 
static bool GenerateOrderedVector (const char *const str, std::vector< NekDouble > &vec)
 
static bool GenerateUnOrderedVector (const char *const str, std::vector< NekDouble > &vec)
 
static bool GenerateOrderedStringVector (const char *const str, std::vector< std::string > &vec)
 

Detailed Description

Definition at line 59 of file ParseUtils.hpp.

Member Function Documentation

static bool Nektar::ParseUtils::GenerateOrderedStringVector ( const char *const  str,
std::vector< std::string > &  vec 
)
inlinestatic

Definition at line 142 of file ParseUtils.hpp.

Referenced by Nektar::LibUtilities::PtsIO::Import(), Nektar::LibUtilities::FieldIO::ImportFieldDefs(), Nektar::Utilities::InputDat::Process(), Nektar::LibUtilities::MeshPartition::ReadExpansions(), and Nektar::SpatialDomains::MeshGraph::ReadExpansions().

143  {
144  // Functors used to parse the sequence.
145  fctor3 functor3(&vec);
146 
147  return parse(str,
148  // Begin grammar
149  (
150  (+(print_p - ','))[functor3] >> *(',' >> (+(print_p - ','))[functor3])
151  )
152  ,
153  // End grammar
154 
155  space_p).full;
156  }
static bool Nektar::ParseUtils::GenerateOrderedVector ( const char *const  str,
std::vector< unsigned int > &  vec 
)
inlinestatic

Definition at line 96 of file ParseUtils.hpp.

Referenced by Nektar::LibUtilities::FieldIO::ImportFieldDefs(), Nektar::Utilities::ProcessBoundaryExtract::Process(), Nektar::Utilities::ProcessWSS::Process(), Nektar::Utilities::ProcessScalGrad::Process(), Nektar::Utilities::ProcessC0Projection::Process(), Nektar::LibUtilities::MeshPartition::ReadExpansions(), and Nektar::SpatialDomains::MeshGraph::ReadExpansions().

97  {
98  // Functors used to parse the sequence.
99  fctor1 functor1(&vec);
100 
101  return parse(str,
102  // Begin grammar
103  (
104  uint_p[functor1] >> *(',' >> uint_p[functor1])
105  )
106  ,
107  // End grammar
108 
109  space_p).full;
110  }
static bool Nektar::ParseUtils::GenerateOrderedVector ( const char *const  str,
std::vector< NekDouble > &  vec 
)
inlinestatic

Definition at line 112 of file ParseUtils.hpp.

113  {
114  // Functors used to parse the sequence.
115  fctor4 functor4(&vec);
116 
117  return parse(str,
118  // Begin grammar
119  (
120  real_p[functor4] >> *(',' >> real_p[functor4])
121  )
122  ,
123  // End grammar
124  space_p).full;
125  }
static bool Nektar::ParseUtils::GenerateSeqVector ( const char *const  str,
std::vector< unsigned int > &  vec 
)
inlinestatic
static bool Nektar::ParseUtils::GenerateUnOrderedVector ( const char *const  str,
std::vector< NekDouble > &  vec 
)
inlinestatic

Definition at line 127 of file ParseUtils.hpp.

Referenced by Nektar::LibUtilities::FieldIO::ImportFieldDefs(), Nektar::Utilities::InputXml::Process(), Nektar::Utilities::ProcessSpherigon::Process(), and Nektar::Utilities::ProcessInterpPoints::Process().

128  {
129  // Functors used to parse the sequence.
130  fctor5 functor5(&vec);
131 
132  return parse(str,
133  // Begin grammar
134  (
135  real_p[functor5] >> *(',' >> real_p[functor5])
136  )
137  ,
138  // End grammar
139  space_p).full;
140  }
static bool Nektar::ParseUtils::ParseRealAssignment ( const char *const  str,
std::string &  symbol,
NekDouble value 
)
inlinestatic

Definition at line 62 of file ParseUtils.hpp.

63  {
64  SymbolFunctor symbolFunctor(&symbol);
65  ValueFunctor valueFunctor(&value);
66 
67  return parse(str,
68  // Begin grammar
69  (
70  lexeme_d[alpha_p >> *alnum_p][symbolFunctor] >> "=" >> real_p[valueFunctor]
71  )
72  ,
73  // End grammar
74 
75  space_p).full;
76  }