https://mooseframework.inl.gov
KokkosLinearFVSource.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 #include "KokkosParsedFunction.h"
14 
20 {
21 public:
23 
25 
26  template <typename Derived>
27  KOKKOS_FUNCTION Real computeRightHandSideContribution(const FVDatum & datum) const;
28 
29 private:
34 };
35 
36 template <typename Derived>
37 KOKKOS_FUNCTION inline Real
39 {
40  const auto centroid = datum.elementCentroid();
41  return _scale->value(_t, centroid) * _source_density->value(_t, centroid) * datum.elementVolume();
42 }
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
static InputParameters validParams()
KOKKOS_FUNCTION Real3 elementCentroid() const
Get the current element centroid.
Definition: KokkosDatum.h:225
KOKKOS_FUNCTION Real value(Real t, Real3 p) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Moose::Kokkos::ReferenceWrapper< const KokkosParsedFunction > _scale
Coefficient for multiplying the surface density.
const Moose::Kokkos::ReferenceWrapper< const KokkosParsedFunction > _source_density
The source density.
KOKKOS_FUNCTION Real computeRightHandSideContribution(const FVDatum &datum) const
Device-side geometric context for finite volume kernels and boundary conditions.
Definition: KokkosDatum.h:167
KokkosLinearFVSource(const InputParameters &parameters)
Base class for Kokkos linear finite volume kernels that contribute on elements (volumetric terms) ...
Kokkos linear finite volume elemental kernel that adds a scaled volumetric source to the right-hand s...
Scalar< Real > _t
TODO: Move to TransientInterface.
KOKKOS_FUNCTION Real elementVolume() const
Get the coordinate-weighted current element volume.
Definition: KokkosDatum.h:232