52 ProcessScalar::create,
53 "Impose a scalar function z=f(x,y) on a surface.");
58 false,
"-1",
"Tag identifying surface/composite to process.");
60 ConfigOption(
false,
"-1",
"Number of quadrature points to generate.");
71 string surf =
m_config[
"surf"].as<
string>();
74 vector<unsigned int> surfs;
76 sort(surfs.begin(), surfs.end());
81 cout <<
"ProcessScalar: extracting surface"
82 << (surfs.size() > 1 ?
"s" :
"") <<
" " << surf << endl;
85 const int nq =
m_config[
"nq"].as<
int>();
86 string expr =
m_config[
"scalar"].as<
string>();
92 vector<ElementSharedPtr> el =
m_mesh->m_element[
m_mesh->m_expDim - 1];
95 for (i = 0; i < el.size(); ++i)
98 vector<int> inter, tags = el[i]->GetTagList();
100 sort(tags.begin(), tags.end());
101 set_intersection(surfs.begin(),
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)
133 Node disp = *n2 - *n1;
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
NekDouble m_y
Y-coordinate.
MeshSharedPtr m_mesh
Mesh object.
static bool GenerateSeqVector(const char *const str, std::vector< unsigned int > &vec)
Represents a point in the domain.
virtual void Process()
Write mesh to output file.
Represents a command-line configuration option.
boost::shared_ptr< Node > NodeSharedPtr
std::map< std::string, ConfigOption > m_config
List of configuration values.
This class defines evaluator of analytic (symbolic) mathematical expressions. Expressions are allowed...
NekDouble m_x
X-coordinate.
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...
boost::shared_ptr< Mesh > MeshSharedPtr
Shared pointer to a mesh.
Abstract base class for processing modules.
boost::shared_ptr< Face > FaceSharedPtr
NekDouble m_z
Z-coordinate.
std::pair< ModuleType, std::string > ModuleKey
ModuleFactory & GetModuleFactory()
tKey RegisterCreatorFunction(tKey idKey, CreatorFunction classCreator, tDescription pDesc="")
Register a class with the factory.