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 : #include "KokkosIntegratedBC.h" 11 : 12 : namespace Moose 13 : { 14 : namespace Kokkos 15 : { 16 : 17 : InputParameters 18 55066 : IntegratedBC::validParams() 19 : { 20 55066 : InputParameters params = IntegratedBCBase::validParams(); 21 55066 : return params; 22 : } 23 : 24 201 : IntegratedBC::IntegratedBC(const InputParameters & parameters) 25 : : IntegratedBCBase(parameters, Moose::VarFieldType::VAR_FIELD_STANDARD), 26 : _test(), 27 : _grad_test(), 28 : _phi(), 29 : _grad_phi(), 30 154 : _u(_var), 31 154 : _grad_u(_var) 32 : { 33 201 : addMooseVariableDependency(&_var); 34 201 : } 35 : 36 : void 37 8336 : IntegratedBC::computeResidual() 38 : { 39 8336 : Policy policy(0, numKokkosBoundarySides()); 40 : 41 8336 : if (!_residual_dispatcher) 42 175 : _residual_dispatcher = DispatcherRegistry::build<ResidualLoop>(this, type()); 43 : 44 8336 : _residual_dispatcher->parallelFor(policy); 45 8336 : } 46 : 47 : void 48 730 : IntegratedBC::computeJacobian() 49 : { 50 730 : if (DispatcherRegistry::hasUserMethod<JacobianLoop>(type())) 51 : { 52 222 : Policy policy(0, numKokkosBoundarySides()); 53 : 54 222 : if (!_jacobian_dispatcher) 55 22 : _jacobian_dispatcher = DispatcherRegistry::build<JacobianLoop>(this, type()); 56 : 57 222 : _jacobian_dispatcher->parallelFor(policy); 58 222 : } 59 : 60 730 : if (DispatcherRegistry::hasUserMethod<OffDiagJacobianLoop>(type())) 61 : { 62 74 : auto & sys = kokkosSystem(_kokkos_var.sys()); 63 : 64 148 : _thread.resize({sys.getCoupling(_kokkos_var.var()).size(), numKokkosBoundarySides()}); 65 : 66 74 : Policy policy(0, _thread.size()); 67 : 68 74 : if (!_offdiag_jacobian_dispatcher) 69 37 : _offdiag_jacobian_dispatcher = DispatcherRegistry::build<OffDiagJacobianLoop>(this, type()); 70 : 71 74 : _offdiag_jacobian_dispatcher->parallelFor(policy); 72 74 : } 73 730 : } 74 : 75 : } // namespace Kokkos 76 : } // namespace Moose