10#ifdef MOOSE_LIBTORCH_ENABLED
24 "The name of the LibtorchNeuralNetControl object.");
25 params.
addParam<
unsigned int>(
"signal_index",
27 "The index of the signal from the LibtorchNeuralNetControl object. "
28 "This assumes indexing between [0,num_signals).");
49 "The supplied control object is not derived from LibtorchNeuralNetControl!");
53 "The given control object only has ",
registerMooseObject("MooseApp", LibtorchControlValuePostprocessor)
void ErrorVector unsigned int
ExecuteMooseObjectWarehouse< Control > & getControlWarehouse()
Reference to the control logic warehouse.
This class is here to combine the Postprocessor interface and the base class Postprocessor object alo...
static InputParameters validParams()
A class for querying output signals from LibtorchNeuralNetControl and derived objects.
const LibtorchNeuralNetControl * _libtorch_nn_control
unsigned int _signal_index
LibtorchControlValuePostprocessor(const InputParameters ¶meters)
Class constructor.
void initialSetup() override
We override this to setup the linking withthe control object.
static InputParameters validParams()
virtual Real getValue() const override
Returns the value of the latest response of a neural-network-based controller.
A time-dependent, neural network-based control of multiple input parameters.
Real getSignal(const unsigned int signal_index) const
Get the (signal_index)-th signal of the control neural net.
unsigned int numberOfControlSignals() const
Get the number of controls this object is computing.
void paramError(const std::string ¶m, Args... args) const
Emits an error prefixed with the file and line number of the given param (from the input file) along ...
std::shared_ptr< T > getActiveObject(const std::string &name, THREAD_ID tid=0) const
virtual void initialSetup()
Gets called at the beginning of the simulation before this object is asked to do its job.
FEProblemBase & _fe_problem
Reference to the FEProblemBase for this user object.