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

[Cleanup] Rename corrections

parent e3ac74b1
No related branches found
No related tags found
No related merge requests found
...@@ -531,16 +531,17 @@ int main(int argc, char *argv[]) { ...@@ -531,16 +531,17 @@ int main(int argc, char *argv[]) {
// Q: is this reasonable? // Q: is this reasonable?
VectorType u; VectorType u;
VectorType u_saved; VectorType u_saved;
double lastCorrection; double lastStateCorrection;
for (size_t state_fpi = 1; state_fpi <= state_fpi_max; ++state_fpi) { for (size_t state_fpi = 1; state_fpi <= state_fpi_max; ++state_fpi) {
stateUpdater->solve(v); stateUpdater->solve(v);
{ {
SingletonVectorType computed_state; SingletonVectorType computed_state;
stateUpdater->extractState(computed_state); stateUpdater->extractState(computed_state);
double const correction = stateEnergyNorm.diff(computed_state, alpha); double const stateCorrection =
stateEnergyNorm.diff(computed_state, alpha);
if (state_fpi <= 2 or correction < if (state_fpi <= 2 or stateCorrection <
requiredReduction * lastCorrection) { requiredReduction * lastStateCorrection) {
alpha = computed_state; alpha = computed_state;
relaxationWriter << "N "; relaxationWriter << "N ";
} else { } else {
...@@ -548,7 +549,7 @@ int main(int argc, char *argv[]) { ...@@ -548,7 +549,7 @@ int main(int argc, char *argv[]) {
Arithmetic::addProduct(alpha, 1.0 - relaxation, computed_state); Arithmetic::addProduct(alpha, 1.0 - relaxation, computed_state);
relaxationWriter << "Y "; relaxationWriter << "Y ";
} }
lastCorrection = correction; lastStateCorrection = stateCorrection;
} }
solveVelocityProblem(velocityIterate, alpha); solveVelocityProblem(velocityIterate, alpha);
...@@ -561,8 +562,8 @@ int main(int argc, char *argv[]) { ...@@ -561,8 +562,8 @@ int main(int argc, char *argv[]) {
(std::cout << '.').flush(); (std::cout << '.').flush();
if (state_fpi > 1) { if (state_fpi > 1) {
double const correctionNorm = AMNorm.diff(u_saved, u); double const velocityCorrection = AMNorm.diff(u_saved, u);
if (correctionNorm < fixedPointTolerance) if (velocityCorrection < fixedPointTolerance)
break; break;
} }
if (state_fpi == state_fpi_max) if (state_fpi == state_fpi_max)
......
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