-
Notifications
You must be signed in to change notification settings - Fork 200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added diagnostic_interval int for nonlinear solver diagnostic. #5748
base: development
Are you sure you want to change the base?
added diagnostic_interval int for nonlinear solver diagnostic. #5748
Conversation
@@ -356,7 +357,8 @@ void NewtonSolver<Vec,Ops>::Solve ( Vec& a_U, | |||
} | |||
} | |||
|
|||
if (!this->m_diagnostic_file.empty() && amrex::ParallelDescriptor::IOProcessor()) { | |||
if (!this->m_diagnostic_file.empty() && amrex::ParallelDescriptor::IOProcessor() && | |||
a_step%this->m_diagnostic_interval==0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can make this change here to get the counting correct.
a_step%this->m_diagnostic_interval==0) { | |
(a_step + 1)%this->m_diagnostic_interval==0) { |
@@ -356,7 +357,8 @@ void NewtonSolver<Vec,Ops>::Solve ( Vec& a_U, | |||
} | |||
} | |||
|
|||
if (!this->m_diagnostic_file.empty() && amrex::ParallelDescriptor::IOProcessor()) { | |||
if (!this->m_diagnostic_file.empty() && amrex::ParallelDescriptor::IOProcessor() && | |||
a_step%this->m_diagnostic_interval==0) { | |||
std::ofstream diagnostic_file{this->m_diagnostic_file, std::ofstream::out | std::ofstream::app}; | |||
diagnostic_file << std::setprecision(14); | |||
diagnostic_file << a_step; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here also
diagnostic_file << a_step; | |
diagnostic_file << a_step + 1; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And also below, increment the time diagnostic_file << a_time + a_dt
;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
d518331
to
894f8ab
Compare
…near solver is time at beginning of time step and the full time step.
…ther reduced diagnostics.
894f8ab
to
aff2041
Compare
This PR adds the ability to parse in a step interval for the nonlinear diagnostic.