36 #include "../MeshElements.h"
54 "Impose a scalar function z=f(x,y) on a surface.");
59 "Tag identifying surface/composite to process.");
61 "Number of quadrature points to generate.");
63 "Expression to evaluate.");
73 string surf =
m_config[
"surf"].as<
string>();
76 vector<unsigned int> surfs;
78 sort(surfs.begin(), surfs.end());
83 cout <<
"ProcessScalar: extracting surface"
84 << (surfs.size() > 1 ?
"s" :
"") <<
" " << surf << endl;
87 const int nq =
m_config[
"nq"].as<
int>();
88 string expr =
m_config[
"scalar"].as<
string>();
94 vector<ElementSharedPtr> el =
m_mesh->m_element[
m_mesh->m_expDim-1];
97 for (i = 0; i < el.size(); ++i)
100 vector<int> inter, tags = el[i]->GetTagList();
102 sort(tags.begin(), tags.end());
103 set_intersection(surfs.begin(), surfs.end(),
104 tags .begin(), tags .end(),
105 back_inserter(inter));
108 if (inter.size() != 1)
117 for (j = 0; j < 4; ++j)
120 n->m_z = rEval.Evaluate(rExprId, n->m_x, n->m_y, 0.0, 0.0);
129 for (j = 0; j < f->m_edgeList.size(); ++j)
135 f->m_edgeList[j]->m_edgeNodes.clear();
137 for (k = 1; k < nq-1; ++k)
139 Node n = *n1 + disp * k / (nq-1.0);
140 n.
m_z = rEval.Evaluate(rExprId, n.
m_x, n.
m_y, 0.0, 0.0);
146 f->m_edgeList[j]->m_edgeNodes.push_back(
pair< ModuleType, string > ModuleKey
map< string, ConfigOption > m_config
List of configuration values.
MeshSharedPtr m_mesh
Mesh object.
boost::shared_ptr< Face > FaceSharedPtr
Shared pointer to a face.
boost::shared_ptr< Node > NodeSharedPtr
Shared pointer to a Node.
static bool GenerateSeqVector(const char *const str, std::vector< unsigned int > &vec)
NekDouble m_x
X-coordinate.
virtual void Process()
Write mesh to output file.
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
NekDouble m_y
Y-coordinate.
Represents a point in the domain.
This class defines evaluator of analytic (symbolic) mathematical expressions. Expressions are allowed...
Represents a command-line configuration option.
int DefineFunction(const std::string &vlist, const std::string &function)
This function allows one to define a function to evaluate. The first argument (vlist) is a list of va...
NekDouble m_z
Z-coordinate.
ModuleFactory & GetModuleFactory()
Abstract base class for processing modules.
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.