Skip to content
Snippets Groups Projects
Commit d07a8dbb authored by Oliver Sander's avatar Oliver Sander Committed by sander@PCPOOL.MI.FU-BERLIN.DE
Browse files

count the iteration steps that are actually taken

[[Imported from SVN: r2376]]
parent 208f032e
No related branches found
No related tags found
No related merge requests found
...@@ -360,7 +360,7 @@ int main (int argc, char *argv[]) try ...@@ -360,7 +360,7 @@ int main (int argc, char *argv[]) try
// //
double normOfOldCorrection = 0; double normOfOldCorrection = 0;
int dnStepsActuallyTaken = 0;
for (int i=0; i<maxDirichletNeumannSteps; i++) { for (int i=0; i<maxDirichletNeumannSteps; i++) {
std::cout << "----------------------------------------------------" << std::endl; std::cout << "----------------------------------------------------" << std::endl;
...@@ -530,7 +530,7 @@ int main (int argc, char *argv[]) try ...@@ -530,7 +530,7 @@ int main (int argc, char *argv[]) try
max3dRelCorrection = std::max(max3dRelCorrection, max3dRelCorrection = std::max(max3dRelCorrection,
std::fabs(oldSolution3d[j][k])/ std::fabs(x3d[j][k])); std::fabs(oldSolution3d[j][k])/ std::fabs(x3d[j][k]));
// the rod
RodDifferenceType rodDiff = computeRodDifference(oldSolutionRod, rodX); RodDifferenceType rodDiff = computeRodDifference(oldSolutionRod, rodX);
double maxRodRelCorrection = 0; double maxRodRelCorrection = 0;
for (size_t j=0; j<rodX.size(); j++) for (size_t j=0; j<rodX.size(); j++)
...@@ -538,8 +538,11 @@ int main (int argc, char *argv[]) try ...@@ -538,8 +538,11 @@ int main (int argc, char *argv[]) try
maxRodRelCorrection = std::max(maxRodRelCorrection, maxRodRelCorrection = std::max(maxRodRelCorrection,
std::fabs(rodDiff[j][k])/ std::fabs(rodX[j].r[k])); std::fabs(rodDiff[j][k])/ std::fabs(rodX[j].r[k]));
// Absolute corrections
double maxRodCorrection = computeRodDifference(oldSolutionRod, rodX).infinity_norm(); double maxRodCorrection = computeRodDifference(oldSolutionRod, rodX).infinity_norm();
double max3dCorrection = oldSolution3d.infinity_norm(); double max3dCorrection = oldSolution3d.infinity_norm();
std::cout << "rod correction: " << maxRodCorrection std::cout << "rod correction: " << maxRodCorrection
<< " rod rel correction: " << maxRodRelCorrection << " rod rel correction: " << maxRodRelCorrection
<< " 3d correction: " << max3dCorrection << " 3d correction: " << max3dCorrection
...@@ -560,6 +563,8 @@ int main (int argc, char *argv[]) try ...@@ -560,6 +563,8 @@ int main (int argc, char *argv[]) try
std::cout << "DD iteration: " << i << " -- ||u^{n+1} - u^n|| / ||u^n||: " << relativeError << ", " std::cout << "DD iteration: " << i << " -- ||u^{n+1} - u^n|| / ||u^n||: " << relativeError << ", "
<< "convrate " << convRate << "\n"; << "convrate " << convRate << "\n";
dnStepsActuallyTaken = i;
//if (relativeError < ddTolerance) //if (relativeError < ddTolerance)
if (std::max(max3dRelCorrection,maxRodRelCorrection) < ddTolerance) if (std::max(max3dRelCorrection,maxRodRelCorrection) < ddTolerance)
break; break;
...@@ -618,7 +623,7 @@ int main (int argc, char *argv[]) try ...@@ -618,7 +623,7 @@ int main (int argc, char *argv[]) try
std::string filename = resultPath + "convrate_" + levelAsAscii.str() + "_" + dampingAsAscii.str(); std::string filename = resultPath + "convrate_" + levelAsAscii.str() + "_" + dampingAsAscii.str();
int i; int i;
for (i=0; i<maxDirichletNeumannSteps; i++) { for (i=0; i<dnStepsActuallyTaken; i++) {
// ///////////////////////////////////////////////////// // /////////////////////////////////////////////////////
// Read iteration from file // Read iteration from file
......
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