https://mooseframework.inl.gov
Loading...
Searching...
No Matches
KokkosElementVariableStatistics.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
13
15{
16public:
18
20
21 KOKKOS_FUNCTION Kokkos::pair<Real, Real> computeValue(Datum & datum) const;
22
23protected:
26};
27
28KOKKOS_FUNCTION inline Kokkos::pair<Real, Real>
30{
31 Real val = 0;
32 Real vol = 0;
33
34 for (unsigned int qp = 0; qp < datum.n_qps(); ++qp)
35 {
36 val += _v(datum, qp) * datum.JxW(qp);
37 vol += datum.JxW(qp);
38 }
39
40 val /= vol;
41
42 return {val, vol};
43}
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
static InputParameters validParams()
KokkosElementVariableStatistics(const InputParameters &parameters)
KOKKOS_FUNCTION Kokkos::pair< Real, Real > computeValue(Datum &datum) const
const Moose::Kokkos::VariableValue _v
The coupled variable used.
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 Real JxW(const unsigned int qp)
Get the transformed Jacobian weight.
KOKKOS_FUNCTION unsigned int n_qps() const
Get the number of local quadrature points.
The Kokkos wrapper classes for MOOSE-like variable value access.