mirror of
https://github.com/paboyle/Grid.git
synced 2025-04-09 21:50:45 +01:00
ConjugateGradient: cleaner output
This commit is contained in:
parent
92c2c7d3b5
commit
fa59789580
@ -84,7 +84,7 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout<<GridLogIterative << std::setprecision(4)<< "ConjugateGradient: k=0 residual "<<cp<<" rsq"<<rsq<<std::endl;
|
std::cout<<GridLogIterative << std::setprecision(4)<< "ConjugateGradient: k=0 residual "<<cp<<" target "<<rsq<<std::endl;
|
||||||
|
|
||||||
GridStopWatch LinalgTimer;
|
GridStopWatch LinalgTimer;
|
||||||
GridStopWatch MatrixTimer;
|
GridStopWatch MatrixTimer;
|
||||||
@ -115,7 +115,7 @@ public:
|
|||||||
p = p*b+r;
|
p = p*b+r;
|
||||||
|
|
||||||
LinalgTimer.Stop();
|
LinalgTimer.Stop();
|
||||||
std::cout<<GridLogIterative<<"ConjugateGradient: Iteration " <<k<<" residual "<<cp<< " target"<< rsq<<std::endl;
|
std::cout<<GridLogIterative<<"ConjugateGradient: Iteration " <<k<<" residual "<<cp<< " target "<< rsq<<std::endl;
|
||||||
|
|
||||||
// Stopping condition
|
// Stopping condition
|
||||||
if ( cp <= rsq ) {
|
if ( cp <= rsq ) {
|
||||||
@ -132,9 +132,9 @@ public:
|
|||||||
|
|
||||||
std::cout<<GridLogMessage<<"ConjugateGradient: Converged on iteration " <<k
|
std::cout<<GridLogMessage<<"ConjugateGradient: Converged on iteration " <<k
|
||||||
<<" computed residual "<<sqrt(cp/ssq)
|
<<" computed residual "<<sqrt(cp/ssq)
|
||||||
<<" true residual "<<true_residual
|
<<" true residual " <<true_residual
|
||||||
<<" target "<<Tolerance<<std::endl;
|
<<" target "<<Tolerance<<std::endl;
|
||||||
std::cout<<GridLogMessage<<" Time elapsed: Total "<< SolverTimer.Elapsed() << " Matrix "<<MatrixTimer.Elapsed() << " Linalg "<<LinalgTimer.Elapsed();
|
std::cout<<GridLogMessage<<"Time elapsed: Total "<< SolverTimer.Elapsed() << " Matrix "<<MatrixTimer.Elapsed() << " Linalg "<<LinalgTimer.Elapsed();
|
||||||
std::cout<<std::endl;
|
std::cout<<std::endl;
|
||||||
|
|
||||||
assert(true_residual/Tolerance < 1000.0);
|
assert(true_residual/Tolerance < 1000.0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user