Finishing the workflow.

This commit is contained in:
Kai Bao
2014-05-20 19:52:15 +02:00
parent 0e244a4845
commit 44a3dbd732

View File

@@ -277,6 +277,7 @@ namespace {
bool converged = false;
double omega = 1.;
const double r0 = residualNorm();
{
const std::vector<double> rLpInfinity = residuals();
@@ -303,16 +304,31 @@ namespace {
linearSize += residual_.well_eq.size();
std::cout << " the size of the linear system is " << linearSize << std::endl;
std::cin.ignore();
// std::cin.ignore();
V dxOld = V::Zero(linearSize);
bool isOscillate;
bool isStagnat;
bool isOscillate = false;
bool isStagnate = false;
const double relaxRelTol = 0.2;
while ((!converged) && (it < maxit)) {
V dx = solveJacobianSystem();
detectNewtonOscillations(residual_history, it, relaxRelTol, isOscillate, isStagnate);
if (isOscillate) {
omega -= 0.1;
omega = std::max(omega, 0.5);
std::cout << " Oscillating behavior detected: Relaxation set to " << omega << std::endl;
// std::cin.ignore();
}
enum RelaxType relaxType = DAMPEN;
std::cout << " omega " << omega << std::endl;
stablizeNewton( dx, dxOld, isOscillate, isStagnate, omega, relaxType );
updateState(dx, x, xw);
assemble(pvdt, x, xw);
@@ -323,7 +339,6 @@ namespace {
residual_history.push_back(rLpInfinity);
}
const double relaxRelTol = 0.2;
converged = getConvergence(dt);