Skip to content

Commit

Permalink
Restore original logic
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrete committed Nov 29, 2024
1 parent 0385587 commit 90ecfb0
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/outputs/outputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,16 @@ Outputs::Outputs(Mesh *pm, ParameterInput *pin, SimTime *tm) {
op.block_number = atoi(outn.c_str());
op.block_name.assign(pib->block_name);

Real dt = -1.0;
Real dt = 0.0; // default value == 0 means that initial data is written by default
int dn = -1;
if (tm != nullptr) {
dt = pin->GetOrAddReal(op.block_name, "dt", -1.0);
dn = pin->GetOrAddInteger(op.block_name, "dn", -1.0);

// If this is a dn controlled output (dn >= 0), soft disable dt based triggering
// (-> dt = -1), otherwise setting dt to tlim ensures a final output is also
// written for temporal drivers.
const auto tlim = dn >= 0 ? -1 : tm->tlim;
dt = pin->GetOrAddReal(op.block_name, "dt", tlim);
}
// if this output is "soft-disabled" (negative value) skip processing
if (dt < 0.0 && dn < 0) {
Expand Down

0 comments on commit 90ecfb0

Please sign in to comment.