Line data Source code
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 : #include "KokkosNodalUserObject.h" 11 : 12 : namespace Moose::Kokkos 13 : { 14 : 15 : InputParameters 16 13262 : NodalUserObject::validParams() 17 : { 18 13262 : InputParameters params = UserObject::validParams(); 19 13262 : params += NodalReducer::validParams(); 20 13262 : params += ::BoundaryRestrictable::validParams(); 21 13262 : params += ::TransientInterface::validParams(); 22 13262 : params += ::RandomInterface::validParams(); 23 : 24 13262 : return params; 25 0 : } 26 : 27 255 : NodalUserObject::NodalUserObject(const InputParameters & parameters) 28 : : UserObject(parameters), 29 : NodalReducer(this), 30 : ::CoupleableMooseVariableDependencyIntermediateInterface(this, true), 31 : ::TransientInterface(this), 32 135 : ::RandomInterface(parameters, _fe_problem, _tid, false) 33 : { 34 255 : } 35 : 36 2600 : NodalUserObject::NodalUserObject(const NodalUserObject & object) 37 : : UserObject(object), 38 : NodalReducer(object), 39 : ::CoupleableMooseVariableDependencyIntermediateInterface(object, {}), 40 : ::TransientInterface(object, {}), 41 1392 : ::RandomInterface(object, {}) 42 : { 43 : // Kokkos user objects currently only consume variable information through finite element bases 44 : // and quadrature points 45 2600 : for (auto * const var : getMooseVariableDependencies()) 46 0 : var->requireQpComputations(); 47 2600 : } 48 : 49 : void 50 799 : NodalUserObject::compute() 51 : { 52 799 : if (DispatcherRegistry::hasUserMethod<DefaultLoop>(type()) == 53 428 : DispatcherRegistry::hasUserMethod<ReducerLoop>(type())) 54 0 : mooseError("Cannot determine whether '", 55 0 : name(), 56 : "' is a regular user object or a reducer object. Either none or both of the " 57 : "execute() and reduce() methods were specified. Check if they were defined properly " 58 : "and override compute() if you want to manually choose the behavior."); 59 : 60 799 : if (DispatcherRegistry::hasUserMethod<ReducerLoop>(type())) 61 784 : computeReducer(); 62 : else 63 15 : computeUserObject(); 64 799 : } 65 : 66 : } // namespace Moose::Kokkos