Line data Source code
1 : /********************************************************************/ 2 : /* SOFTWARE COPYRIGHT NOTIFICATION */ 3 : /* Cardinal */ 4 : /* */ 5 : /* (c) 2021 UChicago Argonne, LLC */ 6 : /* ALL RIGHTS RESERVED */ 7 : /* */ 8 : /* Prepared by UChicago Argonne, LLC */ 9 : /* Under Contract No. DE-AC02-06CH11357 */ 10 : /* With the U. S. Department of Energy */ 11 : /* */ 12 : /* Prepared by Battelle Energy Alliance, LLC */ 13 : /* Under Contract No. DE-AC07-05ID14517 */ 14 : /* With the U. S. Department of Energy */ 15 : /* */ 16 : /* See LICENSE for full restrictions */ 17 : /********************************************************************/ 18 : 19 : #ifdef ENABLE_NEK_COUPLING 20 : 21 : #include "NekPostprocessorValue.h" 22 : 23 : registerMooseObject("CardinalApp", NekPostprocessorValue); 24 : 25 : InputParameters 26 16 : NekPostprocessorValue::validParams() 27 : { 28 16 : auto params = ScalarTransferBase::validParams(); 29 16 : params.addClassDescription("Transfers a postprocessor value into NekRS"); 30 16 : params.registerBase("ScalarTransfer"); 31 16 : params.registerSystemAttributeName("ScalarTransfer"); 32 16 : return params; 33 0 : } 34 : 35 8 : NekPostprocessorValue::NekPostprocessorValue(const InputParameters & parameters) 36 8 : : ScalarTransferBase(parameters) 37 : { 38 8 : addExternalPostprocessor(name(), 0 /* initial value */); 39 8 : _postprocessor = &getPostprocessorValueByName(name()); 40 8 : } 41 : 42 : void 43 8 : NekPostprocessorValue::sendDataToNek() 44 : { 45 8 : _console << "Sending postprocessor " << name() << " (" 46 8 : << Moose::stringify(*_postprocessor * _scaling) << ") to NekRS..." << std::endl; 47 : 48 8 : nrs_t * nrs = (nrs_t *)nekrs::nrsPtr(); 49 8 : nrs->usrwrk[_usrwrk_slot * nekrs::fieldOffset() + _offset] = *_postprocessor * _scaling; 50 8 : } 51 : 52 : #endif