https://mooseframework.inl.gov
Loading...
Searching...
No Matches
KokkosNodalExtremeValue.h
Go to the documentation of this file.
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
14
15class KokkosNodalExtremeValue : public KokkosExtremeValueBase<KokkosNodalVariablePostprocessor>
16{
17public:
19
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
28protected:
30};
31
32KOKKOS_FUNCTION inline Kokkos::pair<Real, Real>
33KokkosNodalExtremeValue::getProxyValuePair(const unsigned int qp, Datum & datum) const
34{
35 return Kokkos::make_pair(_proxy_variable(datum, qp), _u(datum, qp));
36}
37
38template <typename Derived>
39KOKKOS_FUNCTION void
40KokkosNodalExtremeValue::reduce(Datum & datum, Real * result) const
41{
42 if (datum.isNodalDefined(_u.variable()))
43 {
44 KOKKOS_ASSERT(datum.isNodalDefined(_proxy_variable.variable()));
45
46 static_cast<const Derived *>(this)->template computeExtremeValue<Derived>(0, datum, result);
47 }
48}
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
KokkosNodalExtremeValue(const InputParameters &parameters)
KOKKOS_FUNCTION void reduce(Datum &datum, Real *result) const
KOKKOS_FUNCTION Kokkos::pair< Real, Real > getProxyValuePair(const unsigned int qp, Datum &datum) const
static InputParameters validParams()
const Moose::Kokkos::VariableValue _proxy_variable
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
The Kokkos object that holds thread-private data in the parallel operations of any Kokkos object.
KOKKOS_FUNCTION bool isNodalDefined(const Variable &var) const
Get whether the a variable is defined on the current node.
The Kokkos wrapper classes for MOOSE-like variable value access.
KOKKOS_FUNCTION const Variable & variable() const
Get the Kokkos variable.