forked from idaholab/moose
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add object for outputting Reporter debug information
refs idaholab#17605
- Loading branch information
1 parent
686a234
commit 3bbc7d7
Showing
9 changed files
with
162 additions
and
3 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
framework/doc/content/source/outputs/ReporterDebugOutput.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# ReporterDebugOutput | ||
|
||
!syntax description /Outputs/ReporterDebugOutput | ||
|
||
## Overview | ||
|
||
The ReporterDebugOutput object is, as the name suggests, designed to write out material | ||
property information for debugging purposes. Please refer to the [Debug/index.md] for | ||
more information. | ||
|
||
!syntax parameters /Outputs/ReporterDebugOutput | ||
|
||
!syntax inputs /Outputs/ReporterDebugOutput | ||
|
||
!syntax children /Outputs/ReporterDebugOutput |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#pragma once | ||
|
||
// MOOSE includes | ||
#include "Output.h" | ||
|
||
/** | ||
* Produces debug output for displaying Reporter information | ||
*/ | ||
class ReporterDebugOutput : public Output | ||
{ | ||
public: | ||
static InputParameters validParams(); | ||
ReporterDebugOutput(const InputParameters & parameters); | ||
|
||
protected: | ||
/** | ||
* Perform the debugging output | ||
* For this object this is empty; the output is preformed in the constructor | ||
*/ | ||
void output(const ExecFlagType & type) override; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//* This file is part of the MOOSE framework | ||
//* https://www.mooseframework.org | ||
//* | ||
//* All rights reserved, see COPYRIGHT for full restrictions | ||
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT | ||
//* | ||
//* Licensed under LGPL 2.1, please see LICENSE for details | ||
//* https://www.gnu.org/licenses/lgpl-2.1.html | ||
|
||
#include "ReporterDebugOutput.h" | ||
|
||
// MOOSE includes | ||
#include "FEProblemBase.h" | ||
|
||
registerMooseObject("MooseApp", ReporterDebugOutput); | ||
|
||
InputParameters | ||
ReporterDebugOutput::validParams() | ||
{ | ||
InputParameters params = Output::validParams(); | ||
params.addClassDescription("Debug output object for displaying Reporter information."); | ||
params.set<ExecFlagEnum>("execute_on") = EXEC_INITIAL; | ||
return params; | ||
} | ||
|
||
ReporterDebugOutput::ReporterDebugOutput(const InputParameters & parameters) : Output(parameters) {} | ||
|
||
void | ||
ReporterDebugOutput::output(const ExecFlagType & /*type*/) | ||
{ | ||
_console << "\nDeclared/requested Reporter Information:\n\n " | ||
<< MooseUtils::replaceAll( | ||
_problem_ptr->getReporterData().getReporterInfo(), "\n", "\n ") | ||
<< "\n"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
46 changes: 46 additions & 0 deletions
46
test/tests/actions/debug_show_reporters/debug_show_reporters.i
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[Mesh] | ||
[gmg] | ||
type = GeneratedMeshGenerator | ||
dim = 1 | ||
[] | ||
[] | ||
|
||
[Postprocessors] | ||
[scale] | ||
type = ScalePostprocessor | ||
value = function | ||
scaling_factor = 2 | ||
[] | ||
[function] | ||
type = FunctionValuePostprocessor | ||
function = 1 | ||
[] | ||
[] | ||
|
||
[VectorPostprocessors/constant_vpp] | ||
type = ConstantVectorPostprocessor | ||
vector_names = 'value1 value2' | ||
value = '1; 2' | ||
[] | ||
|
||
[Reporters/constant_reporter] | ||
type = ConstantReporter | ||
integer_names = integer | ||
integer_values = 1 | ||
real_names = real | ||
real_values = 2 | ||
string_names = string | ||
string_values = 'funny' | ||
[] | ||
|
||
[Debug] | ||
show_reporters = true | ||
[] | ||
|
||
[Problem] | ||
solve = false | ||
[] | ||
|
||
[Executioner] | ||
type = Steady | ||
[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Tests] | ||
[test] | ||
type = RunApp | ||
input = 'debug_show_reporters.i' | ||
expect_out = 'Reporter "constant_reporter/integer":.*ReporterGeneralContext<std::string>.*VectorPostprocessor "constant_vpp/value1":.*Postprocessor "function":.*ScalePostprocessor "scale" \(mode: ROOT\)' | ||
|
||
requirement = 'The system shall support the detailed on-screen output of all of the Reporters that were declared and requested, including type, producer, context, and consumers.' | ||
[] | ||
[] |