Skip to content

Commit 894f8ab

Browse files
adjusting step and time for solver diagnostic to be consistent with other reduced diagnostics.
1 parent f68acea commit 894f8ab

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
@@ -360,12 +360,12 @@ void NewtonSolver<Vec,Ops>::Solve ( Vec& a_U,
360360
}
361361

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

Source/NonlinearSolvers/PicardSolver.H

+3-4
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,6 @@ void PicardSolver<Vec,Ops>::Solve ( Vec& a_U,
170170
WARPX_ALWAYS_ASSERT_WITH_MESSAGE(
171171
this->m_is_defined,
172172
"PicardSolver::Solve() called on undefined object");
173-
amrex::ignore_unused(a_dt);
174173
using namespace amrex::literals;
175174

176175
//
@@ -246,12 +245,12 @@ void PicardSolver<Vec,Ops>::Solve ( Vec& a_U,
246245
}
247246

248247
if (!this->m_diagnostic_file.empty() && amrex::ParallelDescriptor::IOProcessor() &&
249-
a_step%this->m_diagnostic_interval==0) {
248+
(a_step%this->m_diagnostic_interval==0 || a_step==0)) {
250249
std::ofstream diagnostic_file{this->m_diagnostic_file, std::ofstream::out | std::ofstream::app};
251250
diagnostic_file << std::setprecision(14);
252-
diagnostic_file << a_step;
251+
diagnostic_file << a_step+1;
253252
diagnostic_file << " ";
254-
diagnostic_file << a_time;
253+
diagnostic_file << a_time + a_dt;
255254
diagnostic_file << " ";
256255
diagnostic_file << iter;
257256
diagnostic_file << " ";

0 commit comments

Comments
 (0)