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 : 17 : /** 18 : * Positions from the extrema of a functor 19 : */ 20 : class FunctorExtremaPositions : public Positions, 21 : public NonADFunctorInterface, 22 : public BlockRestrictable 23 : { 24 : public: 25 : static InputParameters validParams(); 26 : FunctorExtremaPositions(const InputParameters & parameters); 27 24 : virtual ~FunctorExtremaPositions() = default; 28 : 29 : void initialize() override; 30 : 31 : private: 32 : /// Functor providing the value 33 : const Moose::Functor<Real> & _functor; 34 : 35 : /// Number of extrema to keep track of 36 : const unsigned int _n_extrema; 37 : 38 : /// Type of extreme value we are going to compute 39 : enum class ExtremeType 40 : { 41 : MAX, 42 : MIN, 43 : MAX_ABS 44 : } _type; 45 : 46 : /// Values of the functor at the extrema 47 : std::vector<Real> & _positions_values; 48 : };