51 "Modify an existing or create a new field from the existing fields as "
52 "specified by a string using a required argument of the form "
53 "fieldstr=\"x + y + u\" ");
61 "name for modified new field, default is \"newfield\" (optional)");
76 int nfields =
m_f->m_variables.size();
79 string fieldName =
m_config[
"fieldname"].as<
string>();
86 if (it !=
m_f->m_variables.end())
89 fieldID = std::distance(
m_f->m_variables.begin(), it);
96 m_f->m_variables.push_back(fieldName);
100 if (
m_f->m_exp[0]->GetNumElmts() == 0)
107 m_f->m_session->LoadParameter(
"Strip_Z", nstrips, 1);
109 "Routine is currently only setup for non-strip files");
113 m_f->m_exp.resize(nfields + 1);
114 m_f->m_exp[nfields] =
m_f->AppendExpList(
m_f->m_numHomogeneousDir);
119 vector<Array<OneD, const NekDouble>> interpfields;
123 int npoints =
m_f->m_exp[0]->GetTotPoints();
127 m_f->m_exp[0]->GetCoords(x, y,
z);
128 interpfields.push_back(x);
129 interpfields.push_back(y);
130 interpfields.push_back(
z);
133 for (
int i = 0; i < nfields; ++i)
135 varstr +=
" " +
m_f->m_variables[i];
136 interpfields.push_back(
m_f->m_exp[i]->GetPhys());
142 string fieldstr =
m_config[
"fieldstr"].as<
string>();
146 strEval.
Evaluate(exprId, interpfields,
m_f->m_exp[fieldID]->UpdatePhys());
148 m_f->m_exp[fieldID]->FwdTransLocalElmt(
m_f->m_exp[fieldID]->GetPhys(),
149 m_f->m_exp[fieldID]->UpdateCoeffs());
#define ASSERTL0(condition, msg)
FieldSharedPtr m_f
Field object.
std::map< std::string, ConfigOption > m_config
List of configuration values.
void v_Process(po::variables_map &vm) override
static ModuleKey className
static std::shared_ptr< Module > create(FieldSharedPtr f)
Creates an instance of this class.
ProcessFieldFromString(FieldSharedPtr f)
~ProcessFieldFromString() override
Abstract base class for processing modules.
Interpreter class for the evaluation of mathematical expressions.
int DefineFunction(const std::string &vlist, const std::string &expr)
Defines a function for the purposes of evaluation.
NekDouble Evaluate(const int id)
Evaluate a function which depends only on constants and/or parameters.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
std::shared_ptr< Field > FieldSharedPtr
std::pair< ModuleType, std::string > ModuleKey
ModuleFactory & GetModuleFactory()
InputIterator find(InputIterator first, InputIterator last, InputIterator startingpoint, const EqualityComparable &value)
std::vector< double > z(NPUPPER)
Represents a command-line configuration option.