www.mooseframework.org
functional_expansion_tools
src
functions
MutableCoefficientsFunctionInterface.C
Go to the documentation of this file.
1
//* This file is part of the MOOSE framework
2
//* https://www.mooseframework.org
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
10
#include "
MutableCoefficientsFunctionInterface.h
"
11
12
template
<>
13
InputParameters
14
validParams<MutableCoefficientsFunctionInterface>
()
15
{
16
InputParameters params =
validParams<MemoizedFunctionInterface>
();
17
18
params +=
validParams<MutableCoefficientsInterface>
();
19
20
params.addClassDescription(
"Interface based on MutableCoefficientsInterface for natively "
21
"supporting operations based on an array of coefficients"
);
22
23
params.addParam<std::vector<Real>>(
"coefficients"
,
"Coefficients required by the function."
);
24
25
return
params;
26
}
27
28
MutableCoefficientsFunctionInterface::MutableCoefficientsFunctionInterface
(
29
const
MooseObject * moose_object,
const
InputParameters & parameters)
30
:
MemoizedFunctionInterface
(parameters),
31
FunctionInterface(this),
32
MutableCoefficientsInterface
(moose_object, parameters)
33
{
34
if
(isParamValid(
"coefficients"
))
35
setCoefficients
(getParam<std::vector<Real>>(
"coefficients"
)),
enforceSize
(
true
);
36
}
37
38
void
39
MutableCoefficientsFunctionInterface::coefficientsChanged
()
40
{
41
// The coefficients have changed, which invalidates the cache
42
invalidateCache
();
43
}
MemoizedFunctionInterface
Implementation of Function that memoizes (caches) former evaluations in an unordered map using a hash...
Definition:
MemoizedFunctionInterface.h:28
MutableCoefficientsFunctionInterface::MutableCoefficientsFunctionInterface
MutableCoefficientsFunctionInterface(const MooseObject *moose_object, const InputParameters ¶meters)
Definition:
MutableCoefficientsFunctionInterface.C:28
MutableCoefficientsFunctionInterface::coefficientsChanged
virtual void coefficientsChanged() override
Called when the coefficients have been changed.
Definition:
MutableCoefficientsFunctionInterface.C:39
validParams< MutableCoefficientsFunctionInterface >
InputParameters validParams< MutableCoefficientsFunctionInterface >()
Definition:
MutableCoefficientsFunctionInterface.C:14
MemoizedFunctionInterface::invalidateCache
void invalidateCache()
Called by derived classes to invalidate the cache, perhaps due to a state change.
Definition:
MemoizedFunctionInterface.C:84
validParams< MutableCoefficientsInterface >
InputParameters validParams< MutableCoefficientsInterface >()
Definition:
MutableCoefficientsInterface.C:19
validParams< MemoizedFunctionInterface >
InputParameters validParams< MemoizedFunctionInterface >()
Definition:
MemoizedFunctionInterface.C:14
MutableCoefficientsInterface::enforceSize
void enforceSize(bool enforce)
Toggle whether the size of the coefficient array can be changed.
Definition:
MutableCoefficientsInterface.C:111
MutableCoefficientsFunctionInterface.h
MutableCoefficientsInterface::setCoefficients
void setCoefficients(const std::vector< Real > &new_coefficients)
Set the coefficients using a copy operation.
Definition:
MutableCoefficientsInterface.C:156
MutableCoefficientsInterface
This class is designed to provide a uniform interface for any class that uses an array of coefficient...
Definition:
MutableCoefficientsInterface.h:30
Generated on Sat Jan 25 2020 12:04:37 for www.mooseframework.org by
1.8.16