Skip to content

Commit

Permalink
Simplify Nek time stepper.
Browse files Browse the repository at this point in the history
  • Loading branch information
aprilnovak committed Jan 20, 2023
1 parent 01c12ab commit 2b5479b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 30 deletions.
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,6 @@ export CPPFLAGS := $(libmesh_CPPFLAGS)
export LDFLAGS := $(libmesh_LDFLAGS)
export LIBS := $(libmesh_LIBS)

CXXFLAGS += -DNEKRS_VERSION=21
CXXFLAGS += -DNEKRS_SUBVERSION=1
CXXFLAGS += -DGITCOMMITHASH=\"51d5bf5f2042e231d1770400c160d5623b19b4c8\"

export CARDINAL_DIR

APPLICATION_DIR := $(CARDINAL_DIR)
Expand Down
34 changes: 8 additions & 26 deletions src/timesteppers/NekTimeStepper.C
Original file line number Diff line number Diff line change
Expand Up @@ -58,32 +58,14 @@ NekTimeStepper::NekTimeStepper(const InputParameters & parameters)
"when other applications (i.e. MOOSE) are consuming the same wall time.\n\nPlease set "
"'stopAt' to either 'numSteps' or 'endTime' in your .par file.");

// The NekTimeStepper will take the end simulation control from the nekRS .par file,
// unless NekRSProblem is a sub-app to a higher-up master app. In that case,
// we will use whatever end control is specified by the controlling app.
MooseApp & app = getMooseApp();
if (app.isUltimateMaster())
{
// The MOOSE Transient executioner will end the simulation if _either_ the number
// of time steps is greater than Transient::_num_steps or the time is greater than
// or equal to Transient::_end_time. To avoid conflicts with NekTimeStepper, below
// we throw an error if the user tries to set num_steps or end_time from the Nek
// input file. This guarantees that the MOOSE defaults of numeric_max are kept for
// both end_time and num_steps, such that our nekRS setting will prevail.
if (nekrs::endControlTime())
_end_time = nekrs::endTime();

if (nekrs::endControlNumSteps())
forceNumSteps(nekrs::numSteps());
}
else
{
// To allow the controlling app to dictate when the nekRS solution ends, we
// just need to have the Nek have a very large end_time (that presumably
// the controlling app would not try to simulate beyond). We don't need to do
// anything here, since the mooseError below ensures that we retain the MOOSE defaults
// of numeric_max for both end_time and num_steps.
}
// The NekTimeStepper will take the end simulation control from the nekRS .par file.
// If the Nek app is a sub-app, then the higher-up master app will automatically take
// control of when the overall simulation ends.
if (nekrs::endControlTime())
_end_time = nekrs::endTime();

if (nekrs::endControlNumSteps())
forceNumSteps(nekrs::numSteps());

// If running in JIT build mode, we don't want to do any time steps
if (nekrs::buildOnly())
Expand Down

0 comments on commit 2b5479b

Please sign in to comment.