https://mooseframework.inl.gov
Loading...
Searching...
No Matches
PostprocessorComparison.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
13
16{
18
19 params.addRequiredParam<PostprocessorName>("value_a",
20 "The first post-processor or value in the comparison");
21 params.addRequiredParam<PostprocessorName>(
22 "value_b", "The second post-processor or value in the comparison");
23
24 params.addClassDescription("Compares two post-processors and produces a boolean value");
25
26 return params;
27}
28
30 : ComparisonPostprocessor(parameters),
31
32 _value_a(getPostprocessorValue("value_a")),
33 _value_b(getPostprocessorValue("value_b")),
34
35 _comparison_value(0.0)
36{
37}
38
39void
44
45void
50
Real PostprocessorValue
various MOOSE typedefs
Definition MooseTypes.h:230
registerMooseObject("MooseApp", PostprocessorComparison)
Base class for comparing quantities and producing a boolean value.
bool comparisonIsTrue(const Real &a, const Real &b) const
Performs the selected comparison on the two values.
static InputParameters validParams()
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.
Compares two post-processors and produces a boolean value.
virtual void execute() override
Execute method.
const PostprocessorValue & _value_a
First post-processor to compare.
PostprocessorValue _comparison_value
The comparison value; 1 for true and 0 for false.
virtual PostprocessorValue getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
static InputParameters validParams()
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
PostprocessorComparison(const InputParameters &parameters)
const PostprocessorValue & _value_b
Second post-processor to compare.