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

[Extend] Allow lambda to be specified

parent d0deb527
No related branches found
No related tags found
No related merge requests found
...@@ -61,6 +61,7 @@ tolerance = 1e-10 ...@@ -61,6 +61,7 @@ tolerance = 1e-10
maximumIterations = 10000 maximumIterations = 10000
relaxation = 0.5 relaxation = 0.5
requiredReduction = 0.5 requiredReduction = 0.5
lambda = 0.5
[solver.tnnmg.linear] [solver.tnnmg.linear]
maxiumumIterations = 100000 maxiumumIterations = 100000
......
...@@ -369,6 +369,7 @@ int main(int argc, char *argv[]) { ...@@ -369,6 +369,7 @@ int main(int argc, char *argv[]) {
auto const printProgress = parset.get<bool>("io.printProgress"); auto const printProgress = parset.get<bool>("io.printProgress");
auto const verbosity = auto const verbosity =
parset.get<Solver::VerbosityMode>("v.solver.verbosity"); parset.get<Solver::VerbosityMode>("v.solver.verbosity");
auto const lambda = parset.get<double>("v.fpi.lambda");
for (size_t timeStep = 1; timeStep <= timeSteps; ++timeStep) { for (size_t timeStep = 1; timeStep <= timeSteps; ++timeStep) {
if (printProgress) if (printProgress)
std::cout << std::setw(7) << timeStep << " " << std::flush; std::cout << std::setw(7) << timeStep << " " << std::flush;
...@@ -415,8 +416,8 @@ int main(int argc, char *argv[]) { ...@@ -415,8 +416,8 @@ int main(int argc, char *argv[]) {
double lastStateCorrection; double lastStateCorrection;
for (size_t stateFPI = 1; stateFPI <= maximumStateFPI; ++stateFPI) { for (size_t stateFPI = 1; stateFPI <= maximumStateFPI; ++stateFPI) {
timeSteppingScheme->extractOldVelocity(v_m); timeSteppingScheme->extractOldVelocity(v_m);
v_m *= 0.5; v_m *= 1.0 - lambda;
Arithmetic::addProduct(v_m, 0.5, v); Arithmetic::addProduct(v_m, lambda, v);
stateUpdater->solve(v_m); stateUpdater->solve(v_m);
stateUpdater->extractLogState(alpha); stateUpdater->extractLogState(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