13 #include <libmesh/int_range.h> 18 "x_function",
"y_function",
"z_function"};
26 params.
addRequiredParam<MeshGeneratorName>(
"input",
"The mesh we want to modify");
28 params.
addParam<ParsedFunctionExpression>(
29 _func_name[0],
"x",
"Function for the updated x component of the node");
30 params.
addParam<ParsedFunctionExpression>(
31 _func_name[1],
"y",
"Function for the updated y component of the node");
32 params.
addParam<ParsedFunctionExpression>(
33 _func_name[2],
"z",
"Function for the updated z component of the node");
35 params.
addParam<std::vector<std::string>>(
36 "constant_names", {},
"Vector of constants used in the parsed function");
37 params.
addParam<std::vector<std::string>>(
38 "constant_expressions",
40 "Vector of values for the constants in constant_names (can be an FParser expression)");
51 _functions[i] = std::make_shared<SymFunction>();
53 getParam<ParsedFunctionExpression>(
_func_name[i]),
55 getParam<std::vector<std::string>>(
"constant_names"),
56 getParam<std::vector<std::string>>(
"constant_expressions"),
63 std::unique_ptr<MeshBase>
66 std::unique_ptr<MeshBase>
mesh = std::move(
_input);
68 for (
auto & node :
mesh->node_ptr_range())
GenericReal< is_ad > evaluate(SymFunctionPtr &, const std::string &object_name="")
Evaluate FParser object and check EvalError.
const Parallel::Communicator & comm() const
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
void parsedFunctionSetup(SymFunctionPtr &function, const std::string &expression, const std::string &variables, const std::vector< std::string > &constant_names, const std::vector< std::string > &constant_expressions, const libMesh::Parallel::Communicator &comm) const
Performs setup steps on a SymFunction.
static InputParameters validParams()
std::vector< GenericReal< is_ad > > _func_params
Array to stage the parameters passed to the functions when calling Eval.
IntRange< T > make_range(T beg, T end)
static InputParameters validParams()
MeshGenerators are objects that can modify or add to an existing mesh.
auto index_range(const T &sizable)