https://mooseframework.inl.gov
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 {
16 public:
18 
20 
21  KOKKOS_FUNCTION Kokkos::pair<Real, Real> computeValue(Datum & datum) const;
22 
23 protected:
26 };
27 
28 KOKKOS_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 Kokkos object that holds thread-private data in the parallel operations of any Kokkos object...
Definition: KokkosDatum.h:23
KokkosElementVariableStatistics(const InputParameters &parameters)
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
const Moose::Kokkos::VariableValue _v
The coupled variable used.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
static InputParameters validParams()
KOKKOS_FUNCTION unsigned int n_qps() const
Get the number of local quadrature points.
Definition: KokkosDatum.h:118
The Kokkos wrapper classes for MOOSE-like variable value access.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
KOKKOS_FUNCTION Real JxW(const unsigned int qp)
Get the transformed Jacobian weight.
Definition: KokkosDatum.h:311
KOKKOS_FUNCTION Kokkos::pair< Real, Real > computeValue(Datum &datum) const