Line data Source code
1 : //* This file is part of the MOOSE framework 2 : //* https://www.mooseframework.org 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 "KokkosKernel.h" 13 : 14 : /** 15 : * This kernel implements the Laplacian operator: 16 : * $\nabla u \cdot \nabla \phi_i$ 17 : */ 18 : class KokkosDiffusion : public Moose::Kokkos::Kernel 19 : { 20 : public: 21 : static InputParameters validParams(); 22 : 23 : KokkosDiffusion(const InputParameters & parameters); 24 : 25 : template <typename Derived> 26 : KOKKOS_FUNCTION Real computeQpResidual(const unsigned int i, 27 : const unsigned int qp, 28 : AssemblyDatum & datum) const; 29 : template <typename Derived> 30 : KOKKOS_FUNCTION Real computeQpJacobian(const unsigned int i, 31 : const unsigned int j, 32 : const unsigned int qp, 33 : AssemblyDatum & datum) const; 34 : }; 35 : 36 : template <typename Derived> 37 : KOKKOS_FUNCTION Real 38 10838208 : KokkosDiffusion::computeQpResidual(const unsigned int i, 39 : const unsigned int qp, 40 : AssemblyDatum & datum) const 41 : { 42 10838208 : return _grad_u(datum, qp) * _grad_test(datum, i, qp); 43 : } 44 : 45 : template <typename Derived> 46 : KOKKOS_FUNCTION Real 47 5806848 : KokkosDiffusion::computeQpJacobian(const unsigned int i, 48 : const unsigned int j, 49 : const unsigned int qp, 50 : AssemblyDatum & datum) const 51 : { 52 5806848 : return _grad_phi(datum, j, qp) * _grad_test(datum, i, qp); 53 : }