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 
17 class KokkosMatchedValueBC final : public Moose::Kokkos::NodalBC<KokkosMatchedValueBC>
18 {
19 public:
21 
23 
24  KOKKOS_FUNCTION Real computeQpResidual(const ContiguousNodeID node) const;
25  KOKKOS_FUNCTION Real computeQpOffDiagJacobian(const unsigned int jvar,
26  const ContiguousNodeID node) const;
27 
28 protected:
30 
32  const unsigned int _v_num;
34  const Real _u_coeff;
36  const Real _v_coeff;
37 };
38 
39 KOKKOS_FUNCTION inline Real
41 {
42  return _u_coeff * _u(node) - _v_coeff * _v(node);
43 }
44 
45 KOKKOS_FUNCTION inline Real
47  const ContiguousNodeID /* node */) const
48 {
49  if (jvar == _v_num)
50  return -_v_coeff;
51  else
52  return 0;
53 }
KOKKOS_FUNCTION Real computeQpResidual(const ContiguousNodeID node) const
const Real _v_coeff
Coefficient for coupled variable.
const Moose::Kokkos::VariableNodalValue _v
KokkosMatchedValueBC(const InputParameters &parameters)
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...
KOKKOS_FUNCTION Real computeQpOffDiagJacobian(const unsigned int jvar, const ContiguousNodeID node) const
Implements a simple coupled boundary condition where u=v on the boundary.
const Real _u_coeff
Coefficient for primary variable.
dof_id_type ContiguousNodeID
Definition: KokkosMesh.h:21
const unsigned int _v_num
The id of the coupled variable.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
const VariableNodalValue _u
Current solution at nodes.
The base class for a user to derive their own Kokkos nodal boundary conditions.
Definition: KokkosNodalBC.h:49