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 : #include "KokkosNodalVariablePostprocessor.h" 13 : #include "KokkosExtremeValueBase.h" 14 : 15 : class KokkosNodalExtremeValue : public KokkosExtremeValueBase<KokkosNodalVariablePostprocessor> 16 : { 17 : public: 18 : static InputParameters validParams(); 19 : 20 : KokkosNodalExtremeValue(const InputParameters & parameters); 21 : 22 : KOKKOS_FUNCTION Kokkos::pair<Real, Real> getProxyValuePair(const unsigned int qp, 23 : Datum & datum) const; 24 : 25 : template <typename Derived> 26 : KOKKOS_FUNCTION void reduce(Datum & datum, Real * result) const; 27 : 28 : protected: 29 : const Moose::Kokkos::VariableValue _proxy_variable; 30 : }; 31 : 32 : KOKKOS_FUNCTION inline Kokkos::pair<Real, Real> 33 132905 : KokkosNodalExtremeValue::getProxyValuePair(const unsigned int qp, Datum & datum) const 34 : { 35 265810 : return Kokkos::make_pair(_proxy_variable(datum, qp), _u(datum, qp)); 36 : } 37 : 38 : template <typename Derived> 39 : KOKKOS_FUNCTION void 40 132905 : KokkosNodalExtremeValue::reduce(Datum & datum, Real * result) const 41 : { 42 132905 : if (datum.isNodalDefined(_u.variable())) 43 : { 44 : KOKKOS_ASSERT(datum.isNodalDefined(_proxy_variable.variable())); 45 : 46 132905 : static_cast<const Derived *>(this)->template computeExtremeValue<Derived>(0, datum, result); 47 : } 48 132905 : }