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 "KokkosElementUserObject.h" 11 : 12 : namespace Moose::Kokkos 13 : { 14 : 15 : InputParameters 16 20274 : ElementUserObject::validParams() 17 : { 18 20274 : InputParameters params = UserObject::validParams(); 19 20274 : params += ElementReducer::validParams(); 20 20274 : params += ::MaterialPropertyInterface::validParams(); 21 20274 : params += ::TransientInterface::validParams(); 22 20274 : params += ::RandomInterface::validParams(); 23 20274 : return params; 24 0 : } 25 : 26 698 : ElementUserObject::ElementUserObject(const InputParameters & parameters) 27 : : UserObject(parameters), 28 : ElementReducer(this), 29 : ::MaterialPropertyInterface(this, blockIDs(), Moose::EMPTY_BOUNDARY_IDS), 30 : ::CoupleableMooseVariableDependencyIntermediateInterface(this, false), 31 : ::TransientInterface(this), 32 394 : ::RandomInterface(parameters, _fe_problem, _tid, false), 33 394 : ::ElementIDInterface(this) 34 : { 35 698 : } 36 : 37 4575 : ElementUserObject::ElementUserObject(const ElementUserObject & object) 38 : : UserObject(object), 39 : ElementReducer(object), 40 : ::MaterialPropertyInterface(object, {}), 41 : ::CoupleableMooseVariableDependencyIntermediateInterface(object, {}), 42 : ::TransientInterface(object, {}), 43 : ::RandomInterface(object, {}), 44 2946 : ::ElementIDInterface(object, {}) 45 : { 46 4575 : } 47 : 48 : void 49 1245 : ElementUserObject::compute() 50 : { 51 1245 : if (DispatcherRegistry::hasUserMethod<DefaultLoop>(type()) == 52 818 : DispatcherRegistry::hasUserMethod<ReducerLoop>(type())) 53 0 : mooseError("Cannot determine whether '", 54 0 : name(), 55 : "' is a regular user object or a reducer object. Either none or both of the " 56 : "execute() and reduce() methods were specified. Check if they were defined properly " 57 : "and override compute() if you want to manually choose the behavior."); 58 : 59 1245 : if (DispatcherRegistry::hasUserMethod<ReducerLoop>(type())) 60 1230 : computeReducer(); 61 : else 62 15 : computeUserObject(); 63 1245 : } 64 : 65 : } // namespace Moose::Kokkos