https://mooseframework.inl.gov
KokkosMatchedValueBC.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 "KokkosNodalBC.h"
13 
18 {
19 public:
21 
23 
24  template <typename Derived>
25  KOKKOS_FUNCTION Real computeQpResidual(const unsigned int qp, AssemblyDatum & datum) const;
26  template <typename Derived>
27  KOKKOS_FUNCTION Real computeQpOffDiagJacobian(const unsigned int jvar,
28  const unsigned int qp,
29  AssemblyDatum & datum) const;
30 
31 protected:
33 
35  const unsigned int _v_num;
37  const Real _u_coeff;
39  const Real _v_coeff;
40 };
41 
42 template <typename Derived>
43 KOKKOS_FUNCTION Real
44 KokkosMatchedValueBC::computeQpResidual(const unsigned int qp, AssemblyDatum & datum) const
45 {
46  return _u_coeff * _u(datum, qp) - _v_coeff * _v(datum, qp);
47 }
48 
49 template <typename Derived>
50 KOKKOS_FUNCTION Real
52  const unsigned int /* qp */,
53  AssemblyDatum & /* datum */) const
54 {
55  if (jvar == _v_num)
56  return -_v_coeff;
57  else
58  return 0;
59 }
KOKKOS_FUNCTION Real computeQpResidual(const unsigned int qp, AssemblyDatum &datum) const
const Real _v_coeff
Coefficient for coupled variable.
KokkosMatchedValueBC(const InputParameters &parameters)
const Moose::Kokkos::VariableValue _v
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...
Implements a simple coupled boundary condition where u=v on the boundary.
const Real _u_coeff
Coefficient for primary variable.
KOKKOS_FUNCTION Real computeQpOffDiagJacobian(const unsigned int jvar, const unsigned int qp, AssemblyDatum &datum) const
The Kokkos wrapper classes for MOOSE-like variable value access.
const unsigned int _v_num
The id of the coupled variable.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const VariableValue _u
Current solution at nodes.
static InputParameters validParams()
The Kokkos object that holds thread-private data in the parallel operations of Kokkos kernels...
Definition: KokkosDatum.h:364
The base class for a user to derive their own Kokkos nodal boundary conditions.
Definition: KokkosNodalBC.h:36