https://mooseframework.inl.gov
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 
12 #include "KokkosIntegratedBC.h"
13 
19  : public Moose::Kokkos::IntegratedBC<KokkosCoupledVarNeumannBC>
20 {
21 public:
23 
25 
26  KOKKOS_FUNCTION Real computeQpResidual(const unsigned int i,
27  const unsigned int qp,
28  ResidualDatum & datum) const;
29  KOKKOS_FUNCTION Real computeQpOffDiagJacobian(const unsigned int i,
30  const unsigned int j,
31  const unsigned int jvar,
32  const unsigned int qp,
33  ResidualDatum & datum) const;
34 
35 protected:
38 
40  const unsigned int _coupled_num;
41 
43  const Real _coef;
44 
47 };
48 
49 KOKKOS_FUNCTION inline Real
51  const unsigned int qp,
52  ResidualDatum & datum) const
53 {
54  return -_scale_factor(datum, qp) * _coef * _test(datum, i, qp) * _coupled_var(datum, qp);
55 }
56 
57 KOKKOS_FUNCTION inline Real
59  const unsigned int j,
60  const unsigned int jvar,
61  const unsigned int qp,
62  ResidualDatum & datum) const
63 {
64  if (jvar == _coupled_num)
65  return -_scale_factor(datum, qp) * _coef * _test(datum, i, qp) * _phi(datum, j, qp);
66  else
67  return 0;
68 }
The base class for a user to derive their own Kokkos integrated boundary conditions.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseBase.h:131
const unsigned int _coupled_num
The identifying number of the coupled variable.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
const Moose::Kokkos::VariableValue _scale_factor
Scale factor.
KOKKOS_FUNCTION Real computeQpResidual(const unsigned int i, const unsigned int qp, ResidualDatum &datum) const
KokkosCoupledVarNeumannBC(const InputParameters &parameters)
KOKKOS_FUNCTION Real computeQpOffDiagJacobian(const unsigned int i, const unsigned int j, const unsigned int jvar, const unsigned int qp, ResidualDatum &datum) const
const VariableTestValue _test
Current test function.
const VariablePhiValue _phi
Current shape function.
const Real _coef
A coefficient that is multiplied with the residual contribution.
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.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
The Kokkos wrapper classes for MOOSE-like variable value access.
static InputParameters validParams()
The Kokkos object that holds thread-private data in the parallel operations of Kokkos residual object...
Definition: KokkosDatum.h:222