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

use functionality from the base class to write iterates to disc

[[Imported from SVN: r2417]]
parent e5167aba
No related branches found
No related tags found
No related merge requests found
......@@ -102,20 +102,8 @@ void CGSolver<MatrixType, VectorType>::solve()
rholast = rho; // remember rho for recurrence
// write iteration to file, if requested
if (this->historyBuffer_!="") {
VectorType intermediateSol = preconditioner_->getSol();
std::stringstream iSolFilename;
iSolFilename << this->historyBuffer_ << "/intermediatesolution_" << std::setw(4) << std::setfill('0') << i;
std::ofstream file(iSolFilename.str().c_str(), std::ios::out|std::ios::binary);
if (not(file))
DUNE_THROW(SolverError, "Couldn't open file " << iSolFilename << " for writing");
GenericVector::writeBinary(file, intermediateSol);
file.close();
}
if (this->historyBuffer_!="")
this->writeIterate(preconditioner_->getSol(), i);
// Compute error
double oldNorm = errorNorm_->operator()(oldSolution);
......
......@@ -110,20 +110,8 @@ void TruncatedCGSolver<MatrixType, VectorType>::solve()
// /////////////////////////////////////////////
// write iteration to file, if requested
// /////////////////////////////////////////////
if (this->historyBuffer_!="") {
VectorType intermediateSol = delta_j;
std::stringstream iSolFilename;
iSolFilename << this->historyBuffer_ << "/intermediatesolution_" << std::setw(4) << std::setfill('0') << i;
std::ofstream file(iSolFilename.str().c_str(), std::ios::out|std::ios::binary);
if (not(file))
DUNE_THROW(SolverError, "Couldn't open file " << iSolFilename << " for writing");
GenericVector::writeBinary(file, intermediateSol);
file.close();
}
if (this->historyBuffer_!="")
this->writeIterate(delta_j, i);
// Compute error
double oldNorm = errorNorm_->operator()(oldSolution);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment