Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://mooseframework.inl.gov 3 : //* 4 : //* All rights reserved, see COPYRIGHT for full restrictions 5 : //* https://github.com/idaholab/moose/blob/master/COPYRIGHT 6 : //* 7 : //* Licensed under LGPL 2.1, please see LICENSE for details 8 : //* https://www.gnu.org/licenses/lgpl-2.1.html 9 : 10 : #pragma once 11 : 12 : // Moose includes 13 : #include "Positions.h" 14 : #include "FunctorInterface.h" 15 : #include "BlockRestrictable.h" 16 : #include "FunctionParserUtils.h" 17 : 18 : /** 19 : * Positions of the centroids of all elements meeting the parsed expression criterion 20 : */ 21 : class ParsedDownSelectionPositions : public Positions, 22 : public NonADFunctorInterface, 23 : public BlockRestrictable, 24 : public FunctionParserUtils<false> 25 : { 26 : public: 27 : static InputParameters validParams(); 28 : ParsedDownSelectionPositions(const InputParameters & parameters); 29 24 : virtual ~ParsedDownSelectionPositions() = default; 30 : 31 : void initialize() override; 32 : 33 : private: 34 : /// function expression 35 : std::string _expression; 36 : 37 : /// coordinate and time variable names 38 : const std::vector<std::string> _xyzt; 39 : 40 : /// function parser object for the local value of the expression 41 : SymFunctionPtr _func_F; 42 : 43 : usingFunctionParserUtilsMembers(false); 44 : 45 : /// Functors to use in the parsed expression 46 : const std::vector<MooseFunctorName> & _functor_names; 47 : 48 : /// Number of functors 49 : const unsigned int _n_functors; 50 : 51 : /// Symbolic name to use for each functor 52 : const std::vector<std::string> _functor_symbols; 53 : 54 : /// Vector of pointers to functors 55 : std::vector<const Moose::Functor<Real> *> _functors; 56 : 57 : /// Vector of pointers to positions objects 58 : std::vector<const Positions *> _positions_ptrs; 59 : 60 : enum PositionSelection : short 61 : { 62 : Error = 0, 63 : Discard = 1, 64 : Keep = 2 65 : }; 66 : };