Skip to content

Commit d518331

Browse files
adjusting step and time for solver diagnostic to be consistent with other reduced diagnostics.
1 parent 3932e46 commit d518331

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Source/NonlinearSolvers/NewtonSolver.H

+3-3
Original file line numberDiff line numberDiff line change
@@ -358,12 +358,12 @@ void NewtonSolver<Vec,Ops>::Solve ( Vec& a_U,
358358
}
359359

360360
if (!this->m_diagnostic_file.empty() && amrex::ParallelDescriptor::IOProcessor() &&
361-
a_step%this->m_diagnostic_interval==0) {
361+
((a_step+1)%this->m_diagnostic_interval==0 || a_step==0)) {
362362
std::ofstream diagnostic_file{this->m_diagnostic_file, std::ofstream::out | std::ofstream::app};
363363
diagnostic_file << std::setprecision(14);
364-
diagnostic_file << a_step;
364+
diagnostic_file << a_step+1;
365365
diagnostic_file << " ";;
366-
diagnostic_file << a_time;
366+
diagnostic_file << a_time + a_dt;
367367
diagnostic_file << " ";;
368368
diagnostic_file << iter;
369369
diagnostic_file << " ";;

Source/NonlinearSolvers/PicardSolver.H

+3-4
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,6 @@ void PicardSolver<Vec,Ops>::Solve ( Vec& a_U,
168168
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
169169
this->m_is_defined,
170170
"PicardSolver::Solve() called on undefined object");
171-
amrex::ignore_unused(a_dt);
172171
using namespace amrex::literals;
173172

174173
//
@@ -244,12 +243,12 @@ void PicardSolver<Vec,Ops>::Solve ( Vec& a_U,
244243
}
245244

246245
if (!this->m_diagnostic_file.empty() && amrex::ParallelDescriptor::IOProcessor() &&
247-
a_step%this->m_diagnostic_interval==0) {
246+
(a_step%this->m_diagnostic_interval==0 || a_step==0)) {
248247
std::ofstream diagnostic_file{this->m_diagnostic_file, std::ofstream::out | std::ofstream::app};
249248
diagnostic_file << std::setprecision(14);
250-
diagnostic_file << a_step;
249+
diagnostic_file << a_step+1;
251250
diagnostic_file << " ";
252-
diagnostic_file << a_time;
251+
diagnostic_file << a_time + a_dt;
253252
diagnostic_file << " ";
254253
diagnostic_file << iter;
255254
diagnostic_file << " ";

0 commit comments

Comments
 (0)