Skip to content

Commit

Permalink
Addressing comment idaholab#1. Using tsteps instead of time.
Browse files Browse the repository at this point in the history
  • Loading branch information
cbolisetti authored and jbadger95 committed Aug 9, 2021
1 parent a5a01fa commit 3a65618
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions framework/include/timeintegrators/NewmarkBeta.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ class NewmarkBeta : public TimeIntegrator
/// Newmark time integration parameter-gamma
Real _gamma;

/// Active time
Real _active_t;
/// Inactive time steps
int _inactive_tsteps;

/// solution vector for \f$ {du^dotdot}\over{du} \f$
Real & _du_dotdot_du;
Expand Down
8 changes: 4 additions & 4 deletions framework/src/timeintegrators/NewmarkBeta.C
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ NewmarkBeta::validParams()
"Computes the first and second time derivative of variable using Newmark-Beta method.");
params.addRangeCheckedParam<Real>("beta", 0.25, "beta > 0.0", "beta value");
params.addRangeCheckedParam<Real>("gamma", 0.5, "gamma >= 0.5", "gamma value");
params.addParam<Real>(
"active_time", -1.0e100, "If t is less than this time, the time derivatives will be zero.");
params.addParam<int>(
"inactive_tsteps", 0, "The time derivatives will set to be zero for this number of time steps.");
return params;
}

NewmarkBeta::NewmarkBeta(const InputParameters & parameters)
: TimeIntegrator(parameters),
_beta(getParam<Real>("beta")),
_gamma(getParam<Real>("gamma")),
_active_t(getParam<Real>("active_time")),
_inactive_tsteps(getParam<int>("inactive_tsteps")),
_du_dotdot_du(_sys.duDotDotDu())
{
_fe_problem.setUDotOldRequested(true);
Expand Down Expand Up @@ -76,7 +76,7 @@ NewmarkBeta::computeTimeDerivatives()
NumericVector<Number> & u_dot_old = *_sys.solutionUDotOld();
NumericVector<Number> & u_dotdot_old = *_sys.solutionUDotDotOld();

if (_fe_problem.time() <= _active_t)
if (_fe_problem.timeStep() <= _inactive_tsteps)
{
u_dot.zero();
u_dotdot.zero();
Expand Down

0 comments on commit 3a65618

Please sign in to comment.