www.mooseframework.org
SamplerReceiver.C
Go to the documentation of this file.
1 /****************************************************************/
2 /* DO NOT MODIFY THIS HEADER */
3 /* MOOSE - Multiphysics Object Oriented Simulation Environment */
4 /* */
5 /* (c) 2010 Battelle Energy Alliance, LLC */
6 /* ALL RIGHTS RESERVED */
7 /* */
8 /* Prepared by Battelle Energy Alliance, LLC */
9 /* Under Contract No. DE-AC07-05ID14517 */
10 /* With the U. S. Department of Energy */
11 /* */
12 /* See COPYRIGHT for full restrictions */
13 /****************************************************************/
14 
15 // MOOSE includes
16 #include "SamplerReceiver.h"
17 #include "Function.h"
18 
19 template <>
20 InputParameters
22 {
23  InputParameters params = validParams<Control>();
24  params.addClassDescription("Control for receiving data from a Sampler via SamplerTransfer.");
25  params.set<MultiMooseEnum>("execute_on") = "timestep_begin";
26  return params;
27 }
28 
29 SamplerReceiver::SamplerReceiver(const InputParameters & parameters) : Control(parameters) {}
30 
31 void
33 {
34  for (auto & param_pair : _parameters)
35  setControllableValueByName<Real>(param_pair.first, param_pair.second);
36 }
37 
38 void
40 {
41  _parameters.clear();
42 }
43 
44 void
45 SamplerReceiver::addControlParameter(const std::string & name, const Real & value)
46 {
47  _parameters[name] = value;
48 }
void addControlParameter(const std::string &name, const Real &value)
Appends the list of parameters to modify.
SamplerReceiver(const InputParameters &parameters)
void reset()
Clears the list of parameters to modify.
InputParameters validParams< SamplerReceiver >()
virtual void execute() override
std::map< std::string, Real > _parameters
Storage for the parameters to control.