https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ConditionalFunctionEnableControl.C
Go to the documentation of this file.
1//* This file is part of the MOOSE framework
2//* https://mooseframework.inl.gov
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
11#include "Function.h"
12
14
17{
19
20 params.addRequiredParam<FunctionName>("conditional_function",
21 "The function to give a true or false value");
22
24 "Control for enabling/disabling objects when a function value is true");
25
26 return params;
27}
28
30 const InputParameters & parameters)
31 : ConditionalEnableControl(parameters), _function(getFunction("conditional_function"))
32{
33}
34
35bool
37{
38 return _function.value(_t);
39}
registerMooseObject("MooseApp", ConditionalFunctionEnableControl)
Base class for controls that enable/disable object(s) based on some condition.
static InputParameters validParams()
Control for enabling/disabling objects when a function value is true.
virtual bool conditionMet(const unsigned int &i) override
Condition that must be true for an entry of the "enable" list to be enabled and/or an entry of the "d...
ConditionalFunctionEnableControl(const InputParameters &parameters)
const Function & _function
The function to give a true or false value.
virtual Real value(Real t, const Point &p) const
Override this to evaluate the scalar function at point (t,x,y,z), by default this returns zero,...
Definition Function.C:30
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
void addRequiredParam(const std::string &name, const std::string &doc_string)
This method adds a parameter and documentation string to the InputParameters object that will be extr...
void addClassDescription(const std::string &doc_string)
This method adds a description of the class that will be displayed in the input file syntax dump.