https://mooseframework.inl.gov
Loading...
Searching...
No Matches
KokkosCoupledVarNeumannBC.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
19{
20public:
22
24
25 template <typename Derived>
26 KOKKOS_FUNCTION Real precomputeQpResidual(const unsigned int qp, AssemblyDatum & datum) const;
27 template <typename Derived>
28 KOKKOS_FUNCTION Real precomputeQpOffDiagJacobian(const unsigned int j,
29 const unsigned int jvar,
30 const unsigned int qp,
31 AssemblyDatum & datum) const;
32
33protected:
36
38 const unsigned int _coupled_num;
39
41 const Real _coef;
42
45};
46
47template <typename Derived>
48KOKKOS_FUNCTION Real
50{
51 return -_scale_factor(datum, qp) * _coef * _coupled_var(datum, qp);
52}
53
54template <typename Derived>
55KOKKOS_FUNCTION Real
57 const unsigned int jvar,
58 const unsigned int qp,
59 AssemblyDatum & datum) const
60{
61 if (jvar == _coupled_num)
62 return -_scale_factor(datum, qp) * _coef * _phi(datum, j, qp);
63 else
64 return 0;
65}
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Implements a Neumann BC where grad(u)=_coupled_var on the boundary.
const Moose::Kokkos::VariableValue _coupled_var
Variable providing the value of grad(u) on the boundary.
static InputParameters validParams()
const Real _coef
A coefficient that is multiplied with the residual contribution.
const Moose::Kokkos::VariableValue _scale_factor
Scale factor.
KOKKOS_FUNCTION Real precomputeQpResidual(const unsigned int qp, AssemblyDatum &datum) const
KOKKOS_FUNCTION Real precomputeQpOffDiagJacobian(const unsigned int j, const unsigned int jvar, const unsigned int qp, AssemblyDatum &datum) const
const unsigned int _coupled_num
The identifying number of the coupled variable.
KokkosCoupledVarNeumannBC(const InputParameters &parameters)
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 Kokkos kernels.
The base class for a user to derive their own Kokkos integrated boundary conditions where the residua...
const VariablePhiValue _phi
Current shape function.
The Kokkos wrapper classes for MOOSE-like variable value access.