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 "KokkosNodalSum.h" 11 : 12 363195 : registerKokkosUserObject("MooseApp", KokkosNodalSum); 13 : 14 : InputParameters 15 4332 : KokkosNodalSum::validParams() 16 : { 17 4332 : InputParameters params = KokkosNodalVariablePostprocessor::validParams(); 18 8664 : params.set<bool>("unique_node_execute") = true; 19 4332 : params.addClassDescription("Computes the sum of all of the nodal values of the specified " 20 : "variable. Note: This object sets the default \"unique_node_execute\" " 21 : "flag to true to avoid double counting nodes between shared blocks."); 22 4332 : return params; 23 0 : } 24 : 25 68 : KokkosNodalSum::KokkosNodalSum(const InputParameters & parameters) 26 36 : : KokkosNodalVariablePostprocessor(parameters) 27 : { 28 68 : } 29 : 30 : void 31 120 : KokkosNodalSum::initialize() 32 : { 33 120 : allocateReductionBuffer(1); 34 120 : } 35 : 36 : void 37 120 : KokkosNodalSum::finalize() 38 : { 39 240 : gatherSum(_reduction_buffer(0)); 40 120 : } 41 : 42 : Real 43 90 : KokkosNodalSum::getValue() const 44 : { 45 180 : return _reduction_buffer(0); 46 : }