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  KOKKOS_FUNCTION Real computeQpResidual(const unsigned int qp, ResidualDatum & datum) const;
25  KOKKOS_FUNCTION Real computeQpOffDiagJacobian(const unsigned int jvar,
26  const unsigned int qp,
27  ResidualDatum & datum) const;
28 
29 protected:
31 
33  const unsigned int _v_num;
35  const Real _u_coeff;
37  const Real _v_coeff;
38 };
39 
40 KOKKOS_FUNCTION inline Real
41 KokkosMatchedValueBC::computeQpResidual(const unsigned int qp, ResidualDatum & datum) const
42 {
43  return _u_coeff * _u(datum, qp) - _v_coeff * _v(datum, qp);
44 }
45 
46 KOKKOS_FUNCTION inline Real
48  const unsigned int /* qp */,
49  ResidualDatum & /* datum */) const
50 {
51  if (jvar == _v_num)
52  return -_v_coeff;
53  else
54  return 0;
55 }
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, ResidualDatum &datum) const
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 wrapper classes for MOOSE-like variable value access.
The Kokkos object that holds thread-private data in the parallel operations of Kokkos residual object...
Definition: KokkosDatum.h:245
The base class for a user to derive their own Kokkos nodal boundary conditions.
Definition: KokkosNodalBC.h:36
KOKKOS_FUNCTION Real computeQpResidual(const unsigned int qp, ResidualDatum &datum) const