https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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{
19public:
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
31protected:
33
35 const unsigned int _v_num;
37 const Real _u_coeff;
39 const Real _v_coeff;
40};
41
42template <typename Derived>
43KOKKOS_FUNCTION Real
44KokkosMatchedValueBC::computeQpResidual(const unsigned int qp, AssemblyDatum & datum) const
45{
46 return _u_coeff * _u(datum, qp) - _v_coeff * _v(datum, qp);
47}
48
49template <typename Derived>
50KOKKOS_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}
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 Moose::Kokkos::VariableValue _v
KOKKOS_FUNCTION Real computeQpOffDiagJacobian(const unsigned int jvar, const unsigned int qp, AssemblyDatum &datum) const
const unsigned int _v_num
The id of the coupled variable.
KOKKOS_FUNCTION Real computeQpResidual(const unsigned int qp, AssemblyDatum &datum) const
const Real _u_coeff
Coefficient for primary variable.
KokkosMatchedValueBC(const InputParameters &parameters)
static InputParameters validParams()
const Real _v_coeff
Coefficient for coupled variable.
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 nodal boundary conditions.
const VariableValue _u
Current solution at nodes.
The Kokkos wrapper classes for MOOSE-like variable value access.