Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
- updated wording, file names based on suggestions
- added docstrings
- simplified test, changed dt
  • Loading branch information
anshchaube committed Nov 27, 2024
1 parent c915948 commit 3c176f1
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 117 deletions.
6 changes: 1 addition & 5 deletions framework/doc/content/source/postprocessors/NumTimeSteps.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# TimestepSize
# NumTimeSteps

!syntax description /Postprocessors/NumTimeSteps

## Description

`NumTimeSteps` reports the timestep size.

## Example Input Syntax

!listing /Users/achaube/tools/moose/test/tests/postprocessors/num_time_steps/moose.i block=Postprocessors
Expand Down
3 changes: 3 additions & 0 deletions framework/include/postprocessors/NumTimeSteps.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

#include "GeneralPostprocessor.h"

/**
* Reports on the number of time steps already taken in the transient
*/
class NumTimeSteps : public GeneralPostprocessor
{
public:
Expand Down
12 changes: 0 additions & 12 deletions test/tests/postprocessors/num_time_steps/gold/moose_out.csv

This file was deleted.

12 changes: 12 additions & 0 deletions test/tests/postprocessors/num_time_steps/gold/numtimesteps_out.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
time,timestep_ctr
0,0
0.001,1
0.002,2
0.003,3
0.004,4
0.005,5
0.006,6
0.007,7
0.008,8
0.009,9
0.01,10
98 changes: 0 additions & 98 deletions test/tests/postprocessors/num_time_steps/moose.i

This file was deleted.

23 changes: 23 additions & 0 deletions test/tests/postprocessors/num_time_steps/numtimesteps.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
[Mesh/gmg]
type = GeneratedMeshGenerator
dim = 1
[]

[Postprocessors/timestep_ctr]
type = NumTimeSteps
[]

[Problem]
solve = False
[]

[Executioner]
type = Transient
dt = 0.001
num_steps = 10
[]

[Outputs]
csv = true
exodus = false
[]
4 changes: 2 additions & 2 deletions test/tests/postprocessors/num_time_steps/tests
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
type = 'CSVDiff'
input = 'numtimesteps.i'
csvdiff = 'numtimesteps_out.csv'
requirement = 'The postprocessor `NumTimeSteps` shall count the number of time-steps accurately'
'over the course of a transient solve'
requirement = 'The postprocessor shall be able to count the number of time-steps that have been taken '
'over the course of the simulation of a transient.'
[]
[]

0 comments on commit 3c176f1

Please sign in to comment.