www.mooseframework.org
MaterialAuxBase.h
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 #ifndef MATERIALAUXBASE_H
16 #define MATERIALAUXBASE_H
17 
18 // MOOSE includes
19 #include "AuxKernel.h"
20 
21 // Forward declarations
22 template <typename T = Real>
24 
25 template <>
26 InputParameters validParams<MaterialAuxBase<>>();
27 
31 template <typename T>
32 class MaterialAuxBase : public AuxKernel
33 {
34 public:
40 
41 protected:
42  virtual Real computeValue() override;
43 
45  virtual Real getRealValue() = 0;
46 
49 
50 private:
52  const Real _factor;
53 
55  const Real _offset;
56 };
57 
58 template <typename T>
60  : AuxKernel(parameters),
61  _prop(getMaterialProperty<T>("property")),
62  _factor(getParam<Real>("factor")),
63  _offset(getParam<Real>("offset"))
64 {
65 }
66 
67 template <typename T>
68 Real
70 {
71  return _factor * getRealValue() + _offset;
72 }
73 
74 #endif // MATERIALAUXBASE_H
MaterialAuxBase(const InputParameters &parameters)
Class constructor.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
A base class for the various Material related AuxKernal objects.
const MaterialProperty< T > & _prop
Reference to the material property for this AuxKernel.
virtual Real getRealValue()=0
Returns material property values at quadrature points.
Base class for creating new auxiliary kernels and auxiliary boundary conditions.
Definition: AuxKernel.h:51
const Real _factor
Multiplier for the material property.
const T & getParam(const std::string &name) const
Retrieve a parameter for the object.
Definition: MooseObject.h:122
virtual Real computeValue() override
Concrete definition of a parameter value for a specified type.
const InputParameters & parameters() const
Get the parameters of the object.
Definition: MooseObject.h:53
const MaterialProperty< T > & getMaterialProperty(const std::string &name)
Override functions from MaterialPropertyInterface for error checking.
Definition: AuxKernel.h:214
const Real _offset
Value to be added to the material property.