Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
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 
23  params.addClassDescription(
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 
35 bool
37 {
38  return _function.value(_t);
39 }
registerMooseObject("MooseApp", ConditionalFunctionEnableControl)
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...
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...
static InputParameters validParams()
Control for enabling/disabling objects when a function value is true.
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...
Base class for controls that enable/disable object(s) based on some condition.
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:44
const Function & _function
The function to give a true or false value.
ConditionalFunctionEnableControl(const InputParameters &parameters)