https://mooseframework.inl.gov
MOOSEPostprocessorToNEML2.C
Go to the documentation of this file.
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 
11 
14 
15 template <unsigned int state>
18 {
19  auto params = MOOSEToNEML2Unbatched::validParams();
20  params.addClassDescription(NEML2Utils::docstring(
21  "Gather a MOOSE postprocessor value for insertion into the specified input variable or "
22  "model parameter of a NEML2 model."));
23  params.addRequiredParam<PostprocessorName>(
24  "from_moose", NEML2Utils::docstring("MOOSE postprocessor to read from"));
25  return params;
26 }
27 
28 template <>
30  : MOOSEToNEML2Unbatched(params)
31 #ifdef NEML2_ENABLED
32  ,
33  _moose_pp(getPostprocessorValue("from_moose"))
34 #endif
35 {
36 }
37 
38 template <>
40  : MOOSEToNEML2Unbatched(params)
41 #ifdef NEML2_ENABLED
42  ,
43  _moose_pp(getPostprocessorValueOld("from_moose"))
44 #endif
45 {
46 }
47 
48 #ifdef NEML2_ENABLED
49 template <unsigned int state>
50 neml2::Tensor
52 {
53  return neml2::Scalar::full(_moose_pp, neml2::kFloat64);
54 }
55 #endif
56 
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
neml2::Tensor gatheredData() const override
Convert data gathered from MOOSE into neml2::Tensor.
Gather a MOOSE postprocessor value for insertion into the NEML2 model.
std::string docstring(const std::string &desc)
Augment docstring if NEML2 is not enabled.
Definition: NEML2Utils.C:77
registerMooseObject("MooseApp", MOOSEPostprocessorToNEML2)
static InputParameters validParams()
MOOSEPostprocessorToNEML2Templ(const InputParameters &params)