21 "Removes elements such that the parsed expression is evaluated as strictly positive. "
22 "The parameters of the parsed expression can be the X,Y,Z coordinates of the "
23 "element vertex average (must be 'x','y','z' in the expression), the element volume "
24 "(must be 'volume' in the expression) and the element id ('id' in the expression).");
26 "expression",
"Expression to evaluate to decide whether an element should be deleted");
27 params.
addParam<std::vector<std::string>>(
28 "constant_names", {},
"Vector of constants used in the parsed function");
29 params.
addParam<std::vector<std::string>>(
30 "constant_expressions",
32 "Vector of values for the constants in constant_names (can be an FParser expression)");
40 _function = std::make_shared<SymFunction>();
42 getParam<ParsedFunctionExpression>(
"expression"),
44 getParam<std::vector<std::string>>(
"constant_names"),
45 getParam<std::vector<std::string>>(
"constant_expressions"),
54 const auto vertex_average = elem->vertex_average();
55 for (
const auto i : make_range(3))
registerMooseObject("MooseApp", ParsedElementDeletionGenerator)
This class deletes elements from the mesh data structure after it has been generated or read but befo...
static InputParameters validParams()
std::vector< GenericReal< is_ad > > _func_params
Array to stage the parameters passed to the functions when calling Eval.
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.
GenericReal< is_ad > evaluate(SymFunctionPtr &, const std::string &object_name="")
Evaluate FParser object and check EvalError.
static InputParameters validParams()
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Deletes elements based on the evaluation of a parsed expression, involving the coordinates of their v...
static InputParameters validParams()
virtual bool shouldDelete(const Elem *elem) override
Method that returns a Boolean indicating whether an element should be removed from the mesh.
SymFunctionPtr _function
the function
ParsedElementDeletionGenerator(const InputParameters ¶meters)
const Parallel::Communicator & comm() const