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