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

[Cleanup] Rename state_fpi_*

parent e0100f06
No related branches found
No related tags found
No related merge requests found
...@@ -474,7 +474,7 @@ int main(int argc, char *argv[]) { ...@@ -474,7 +474,7 @@ int main(int argc, char *argv[]) {
SingletonVectorType alpha(finestSize); SingletonVectorType alpha(finestSize);
auto const timesteps = parset.get<size_t>("timeSteps.number"), auto const timesteps = parset.get<size_t>("timeSteps.number"),
state_fpi_max = parset.get<size_t>("v.fpi.maximumIterations"), maximumStateFPI = parset.get<size_t>("v.fpi.maximumIterations"),
maximumIterations = maximumIterations =
parset.get<size_t>("v.solver.maximumIterations"); parset.get<size_t>("v.solver.maximumIterations");
auto const tau = parset.get<double>("problem.finalTime") / timesteps, auto const tau = parset.get<double>("problem.finalTime") / timesteps,
...@@ -533,17 +533,16 @@ int main(int argc, char *argv[]) { ...@@ -533,17 +533,16 @@ int main(int argc, char *argv[]) {
VectorType u_saved; VectorType u_saved;
SingletonVectorType alpha_saved; SingletonVectorType alpha_saved;
double lastStateCorrection; double lastStateCorrection;
for (size_t state_fpi = 1; state_fpi <= state_fpi_max; ++state_fpi) { for (size_t stateFPI = 1; stateFPI <= maximumStateFPI; ++stateFPI) {
stateUpdater->solve(v); stateUpdater->solve(v);
stateUpdater->extractState(alpha); stateUpdater->extractState(alpha);
if (state_fpi == 1) if (stateFPI == 1)
relaxationWriter << "N "; relaxationWriter << "N ";
else { else {
double const stateCorrection = double const stateCorrection =
stateEnergyNorm.diff(alpha, alpha_saved); stateEnergyNorm.diff(alpha, alpha_saved);
if (state_fpi <= if (stateFPI <= 2 // lastStateCorrection is only set for stateFPI > 2
2 // lastStateCorrection is only set for state_fpi > 2
or stateCorrection < requiredReduction * lastStateCorrection) or stateCorrection < requiredReduction * lastStateCorrection)
relaxationWriter << "N "; relaxationWriter << "N ";
else { else {
...@@ -563,12 +562,12 @@ int main(int argc, char *argv[]) { ...@@ -563,12 +562,12 @@ int main(int argc, char *argv[]) {
if (printProgress) if (printProgress)
(std::cout << '.').flush(); (std::cout << '.').flush();
if (state_fpi > 1) { if (stateFPI > 1) {
double const velocityCorrection = AMNorm.diff(u_saved, u); double const velocityCorrection = AMNorm.diff(u_saved, u);
if (velocityCorrection < fixedPointTolerance) if (velocityCorrection < fixedPointTolerance)
break; break;
} }
if (state_fpi == state_fpi_max) if (stateFPI == maximumStateFPI)
DUNE_THROW(Dune::Exception, "FPI failed to converge"); DUNE_THROW(Dune::Exception, "FPI failed to converge");
alpha_saved = alpha; alpha_saved = alpha;
......
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