Skip to content

Commit

Permalink
[oneD] adjusted loglevels for more output
Browse files Browse the repository at this point in the history
  • Loading branch information
wandadars authored and speth committed Aug 18, 2024
1 parent 1704029 commit 1730a37
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/oneD/MultiNewton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ int MultiNewton::solve(double* x0, double* x1, OneDim& r, MultiJac& jac, int log
while (true) {
// Check whether the Jacobian should be re-evaluated.
if (jac.age() > m_maxAge) {
if (loglevel > 0) {
if (loglevel > 1) {
writelog("\n Maximum Jacobian age reached ({}), updating it.", m_maxAge);
}
forceNewJac = true;
Expand Down Expand Up @@ -365,7 +365,7 @@ int MultiNewton::solve(double* x0, double* x1, OneDim& r, MultiJac& jac, int log
break;
}
nJacReeval++;
if (loglevel > 0) {
if (loglevel > 1) {
writelog("\n Re-evaluating Jacobian (damping coefficient not found"
" with this Jacobian)");
}
Expand Down
6 changes: 3 additions & 3 deletions src/oneD/OneDim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ int OneDim::solve(double* x, double* xnew, int loglevel)
m_jac->updateTransient(m_rdt, m_mask.data());
m_jac_ok = true;
}
return m_newt->solve(x, xnew, *this, *m_jac, loglevel-1);
return m_newt->solve(x, xnew, *this, *m_jac, loglevel);
}

void OneDim::evalSSJacobian(double* x, double* xnew)
Expand Down Expand Up @@ -361,7 +361,7 @@ double OneDim::timeStep(int nsteps, double dt, double* x, double* r, int logleve
int j0 = m_jac->nEvals(); // Store the current number of Jacobian evaluations

// solve the transient problem
int status = solve(x, r, loglevel-1);
int status = solve(x, r, loglevel);

// successful time step. Copy the new solution in r to
// the current solution in x.
Expand Down Expand Up @@ -418,7 +418,7 @@ double OneDim::timeStep(int nsteps, double dt, double* x, double* r, int logleve
writelog("\n============================");
} else if (loglevel > 1) {
double ss = ssnorm(x, r);
writelog("\nTimestep({}) dt= {:<11.4e} log10(ss)= {:<7.4f}\n", n, dt, log10(ss));
writelog("\nTimestep ({}) dt= {:<11.4e} log10(ss)= {:<7.4f}\n", n, dt, log10(ss));
}

// return the value of the last stepsize, which may be smaller
Expand Down
4 changes: 2 additions & 2 deletions src/oneD/Sim1D.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ void Sim1D::solve(int loglevel, bool refine_grid)
setSteadyMode();
newton().setOptions(m_ss_jac_age);
debuglog("\nAttempt Newton solution of steady-state problem.", loglevel);
int status = newtonSolve(loglevel-1);
int status = newtonSolve(loglevel);

if (status == 0) {
if (loglevel > 0) {
Expand Down Expand Up @@ -490,7 +490,7 @@ void Sim1D::solve(int loglevel, bool refine_grid)
if (loglevel > 0) {
writeline('.', 78, true, true);
}
if (loglevel > 2) {
if (loglevel > 3) {
show();
}

Expand Down

0 comments on commit 1730a37

Please sign in to comment.