Skip to content

Commit

Permalink
Made changes to fix fails in the moosebuild
Browse files Browse the repository at this point in the history
-Added PNGOutput.md file
-Added "design" parameter in test input files
-Lowered the resolution of created images to avoid getting timed out
  • Loading branch information
Samuel Tew committed Jul 12, 2019
1 parent f88c6f7 commit fb059a3
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 11 deletions.
18 changes: 18 additions & 0 deletions framework/doc/content/source/outputs/png/PNGOutput.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# PNGOutput (Outputs)

The PNGOutput object is the class for writing png files from the input files.

Following is an example of all the different input variables that can be used.

```
[Outputs]
[png]
type = PNGOutput
transparent = true #indicates whether the background will be transparent
resolution = 50 #resolution of each point
color = RWB #indicates which color scheme to use (required)
out_bounds_shade = .5 #value from 0-1 indicating shade to use as background
transparency = 1 #value from 0(transparent)-1(opaque) for image.
[]
[]
```
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ class PNGOutput : public FileOutput
MooseEnum _color;

// Indicates whether to make the background transparent.
bool _transparent;
bool _transparent_background;

// Controls transparency level for the general image.
Real _transparency;

/// Pointer the libMesh::MeshFunction object that the read data is stored
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ InputParameters
validParams<PNGOutput>()
{
InputParameters params = validParams<FileOutput>();
params.addParam<bool>(
"transparent", true, "Determination of whether the background will be transparent.");
params.addParam<unsigned int>("resolution", 2000, "The resolution of the image.");
params.addParam<bool>("transparent_background",
false,
"Determination of whether the background will be transparent.");
params.addParam<unsigned int>("resolution", 1, "The resolution of the image.");
MooseEnum color("GRAY BRYW BCR RWB BR");
params.addParam<MooseEnum>("color", color, "Choose the color scheme to use.");
params.addRangeCheckedParam<Real>("out_bounds_shade",
Expand All @@ -46,7 +47,7 @@ PNGOutput::PNGOutput(const InputParameters & parameters)
: FileOutput(parameters),
_resolution(getParam<unsigned int>("resolution")),
_color(parameters.get<MooseEnum>("color")),
_transparent(getParam<bool>("transparent")),
_transparent_background(getParam<bool>("transparent_background")),
_transparency(getParam<Real>("transparency")),
_out_bounds_shade(getParam<Real>("out_bounds_shade"))
{
Expand All @@ -60,7 +61,7 @@ PNGOutput::makeMeshFunc()
const std::vector<unsigned int> var_nums = {0};

// If we want the background to be transparent, we need a number over 1.
if (_transparent)
if (_transparent_background)
_out_bounds_shade = 2;
// Find the values that will be used for rescaling purposes.
calculateRescalingValues();
Expand Down
2 changes: 1 addition & 1 deletion test/tests/outputs/png/adv_diff_reaction_test.i
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
[Outputs]
[png]
type = PNGOutput
resolution = 250
resolution = 1
color = BCR
[]
[]
2 changes: 1 addition & 1 deletion test/tests/outputs/png/adv_diff_reaction_transient_test.i
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
[Outputs]
[png]
type = PNGOutput
resolution = 250
resolution = 1
color = RWB
[]
[]
2 changes: 1 addition & 1 deletion test/tests/outputs/png/simple_transient_diffusion.i
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
[Outputs]
[png]
type = PNGOutput
resolution = 250
resolution = 1
color = RWB
[]
[]
3 changes: 3 additions & 0 deletions test/tests/outputs/png/tests
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,23 @@
[adv_diff_reaction]
type = 'CheckFiles'
input = 'adv_diff_reaction_test.i'
design = 'PNGOutput.md'
check_files = 'adv_diff_reaction_test_png_001.png'
issues = '#12846'
requirement = 'MOOSE shall be able to produce png images'
[]
[simple_transient_diff]
type = 'CheckFiles'
input = 'simple_transient_diffusion.i'
design = 'PNGOutput.md'
check_files = 'simple_transient_diffusion_png_001.png'
issues = '#12846'
requirement = 'MOOSE shall be able to produce png images'
[]
[wedge]
type = 'CheckFiles'
input = 'wedge.i'
design = 'PNGOutput.md'
check_files = 'wedge_png_001.png'
issues = '#12846'
requirement = 'MOOSE shall be able to produce png images'
Expand Down
3 changes: 1 addition & 2 deletions test/tests/outputs/png/wedge.i
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,7 @@
[Outputs]
[png]
type = PNGOutput
resolution = 500
transparency = 1
resolution = 1
color = RWB
[]
[]

0 comments on commit fb059a3

Please sign in to comment.