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 "MOOSEPostprocessorToNEML2.h" 11 : 12 : registerMooseObject("MooseApp", MOOSEPostprocessorToNEML2); 13 : registerMooseObject("MooseApp", MOOSEOldPostprocessorToNEML2); 14 : 15 : template <unsigned int state> 16 : InputParameters 17 6122 : MOOSEPostprocessorToNEML2Templ<state>::validParams() 18 : { 19 6122 : auto params = MOOSEToNEML2Unbatched::validParams(); 20 12244 : params.addClassDescription( 21 : "Gather a MOOSE postprocessor value for insertion into the specified input variable or " 22 : "model parameter of a NEML2 model."); 23 18366 : params.addRequiredParam<PostprocessorName>("from_moose", "MOOSE postprocessor to read from"); 24 6122 : return params; 25 0 : } 26 : 27 : template <> 28 0 : MOOSEPostprocessorToNEML2Templ<0>::MOOSEPostprocessorToNEML2Templ(const InputParameters & params) 29 0 : : MOOSEToNEML2Unbatched(params) 30 : #ifdef NEML2_ENABLED 31 : , 32 0 : _moose_pp(getPostprocessorValue("from_moose")) 33 : #endif 34 : { 35 0 : } 36 : 37 : template <> 38 0 : MOOSEPostprocessorToNEML2Templ<1>::MOOSEPostprocessorToNEML2Templ(const InputParameters & params) 39 0 : : MOOSEToNEML2Unbatched(params) 40 : #ifdef NEML2_ENABLED 41 : , 42 0 : _moose_pp(getPostprocessorValueOld("from_moose")) 43 : #endif 44 : { 45 0 : } 46 : 47 : #ifdef NEML2_ENABLED 48 : template <unsigned int state> 49 : neml2::Tensor 50 0 : MOOSEPostprocessorToNEML2Templ<state>::gatheredData() const 51 : { 52 0 : return neml2::Scalar::full(_moose_pp, neml2::kFloat64); 53 : } 54 : #endif 55 : 56 : template class MOOSEPostprocessorToNEML2Templ<0>; 57 : template class MOOSEPostprocessorToNEML2Templ<1>;