Skip to content
Snippets Groups Projects
Commit e3ac74b1 authored by Elias Pipping's avatar Elias Pipping
Browse files

[Cleanup] Kill comments, use `or`

parent 6f6e3b37
No related branches found
No related tags found
No related merge requests found
...@@ -538,11 +538,12 @@ int main(int argc, char *argv[]) { ...@@ -538,11 +538,12 @@ int main(int argc, char *argv[]) {
SingletonVectorType computed_state; SingletonVectorType computed_state;
stateUpdater->extractState(computed_state); stateUpdater->extractState(computed_state);
double const correction = stateEnergyNorm.diff(computed_state, alpha); double const correction = stateEnergyNorm.diff(computed_state, alpha);
if (state_fpi <= 2 // Let the first two steps pass through unchanged
|| correction < requiredReduction * lastCorrection) { if (state_fpi <= 2 or correction <
requiredReduction * lastCorrection) {
alpha = computed_state; alpha = computed_state;
relaxationWriter << "N "; relaxationWriter << "N ";
} else { // alpha is still the old time step here } else {
alpha *= relaxation; alpha *= relaxation;
Arithmetic::addProduct(alpha, 1.0 - relaxation, computed_state); Arithmetic::addProduct(alpha, 1.0 - relaxation, computed_state);
relaxationWriter << "Y "; relaxationWriter << "Y ";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment