https://mooseframework.inl.gov
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 
39 void
41 {
42  _comparison_value = 0.0;
43 }
44 
45 void
47 {
49 }
50 
53 {
54  return _comparison_value;
55 }
Compares two post-processors and produces a boolean value.
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system...
virtual void execute() override
Execute method.
static InputParameters validParams()
virtual void initialize() override
Called before execute() is ever called so that data can be cleared.
const PostprocessorValue & _value_b
Second post-processor to compare.
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...
const PostprocessorValue & _value_a
First post-processor to compare.
bool comparisonIsTrue(const Real &a, const Real &b) const
Performs the selected comparison on the two values.
Real PostprocessorValue
various MOOSE typedefs
Definition: MooseTypes.h:202
virtual PostprocessorValue getValue() const override
This will get called to actually grab the final value the postprocessor has calculated.
PostprocessorComparison(const InputParameters &parameters)
PostprocessorValue _comparison_value
The comparison value; 1 for true and 0 for false.
Base class for comparing quantities and producing a boolean value.
static InputParameters validParams()
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...
registerMooseObject("MooseApp", PostprocessorComparison)