51 ProcessScalar::create,
52 "Impose a scalar function z=f(x,y) on a surface.");
57 false,
"-1",
"Tag identifying surface/composite to process.");
59 ConfigOption(
false,
"-1",
"Number of quadrature points to generate.");
70 string surf =
m_config[
"surf"].as<
string>();
73 vector<unsigned int> surfs;
75 sort(surfs.begin(), surfs.end());
80 cout <<
"ProcessScalar: extracting surface" 81 << (surfs.size() > 1 ?
"s" :
"") <<
" " << surf << endl;
84 const int nq =
m_config[
"nq"].as<
int>();
85 string expr =
m_config[
"scalar"].as<
string>();
91 vector<ElementSharedPtr> el =
m_mesh->m_element[
m_mesh->m_expDim - 1];
94 for (i = 0; i < el.size(); ++i)
97 vector<int> inter, tags = el[i]->GetTagList();
99 sort(tags.begin(), tags.end());
100 set_intersection(surfs.begin(),
104 back_inserter(inter));
107 if (inter.size() != 1)
116 for (j = 0; j < 4; ++j)
119 n->m_z = rEval.Evaluate(rExprId, n->m_x, n->m_y, 0.0, 0.0);
128 for (j = 0; j < f->m_edgeList.size(); ++j)
132 Node disp = *n2 - *n1;
134 f->m_edgeList[j]->m_edgeNodes.clear();
136 for (k = 1; k < nq - 1; ++k)
138 Node n = *n1 + disp * k / (nq - 1.0);
139 n.
m_z = rEval.Evaluate(rExprId, n.
m_x, n.
m_y, 0.0, 0.0);
145 f->m_edgeList[j]->m_edgeNodes.push_back(
int DefineFunction(const std::string &vlist, const std::string &expr)
Defines a function for the purposes of evaluation.
NekDouble m_y
Y-coordinate.
MeshSharedPtr m_mesh
Mesh object.
std::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
Represents a point in the domain.
std::shared_ptr< Node > NodeSharedPtr
std::shared_ptr< Face > FaceSharedPtr
std::pair< ModuleType, std::string > ModuleKey
virtual void Process()
Write mesh to output file.
Represents a command-line configuration option.
std::map< std::string, ConfigOption > m_config
List of configuration values.
Interpreter class for the evaluation of mathematical expressions.
NekDouble m_x
X-coordinate.
Abstract base class for processing modules.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, std::string pDesc="")
Register a class with the factory.
NekDouble m_z
Z-coordinate.
std::pair< ModuleType, std::string > ModuleKey
ModuleFactory & GetModuleFactory()
static bool GenerateSeqVector(const std::string &str, std::vector< unsigned int > &out)
Takes a comma-separated compressed string and converts it to entries in a vector. ...