Cardinal
NekScalarValue.h
Go to the documentation of this file.
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 #pragma once
20 
21 #include "GeneralUserObject.h"
22 
28 class NekScalarValue : public GeneralUserObject
29 {
30 public:
31  static InputParameters validParams();
32 
33  NekScalarValue(const InputParameters & parameters);
34 
36  virtual void execute() override {}
37 
38  virtual void initialize() override {}
39  virtual void finalize() override {}
40 
42  virtual void setValue();
43 
48  Real getValue() const;
49 
50  virtual unsigned int usrwrkSlot() const { return _usrwrk_slot; }
51 
52  virtual void setCounter(const unsigned int & counter) { _counter = counter; }
53 
58  virtual const unsigned int & counter() const { return _counter; }
59 
60 protected:
62  const Real & _value;
63 
65  const Real & _scaling;
66 
68  unsigned int _usrwrk_slot;
69 
71  unsigned int _counter;
72 };
virtual unsigned int usrwrkSlot() const
Definition: NekScalarValue.h:50
virtual void execute() override
We don't want this user object to execute in MOOSE's control.
Definition: NekScalarValue.h:36
unsigned int _usrwrk_slot
Slot in usrwrk to write the scalar value.
Definition: NekScalarValue.h:68
virtual void setCounter(const unsigned int &counter)
Definition: NekScalarValue.h:52
Real getValue() const
NekScalarValue(const InputParameters &parameters)
Definition: NekScalarValue.h:28
const Real & _scaling
A multiplier to apply to 'value'.
Definition: NekScalarValue.h:65
virtual const unsigned int & counter() const
Definition: NekScalarValue.h:58
virtual void finalize() override
Definition: NekScalarValue.h:39
const Real & _value
The value to send into NekRS.
Definition: NekScalarValue.h:62
virtual void setValue()
Instead, we want to have a separate method that we can call from NekRSProblemBase.
static InputParameters validParams()
virtual void initialize() override
Definition: NekScalarValue.h:38
unsigned int _counter
Counter of this object, to be set by NekRSProblem.
Definition: NekScalarValue.h:71