Skip to content
Snippets Groups Projects
Commit 17d43125 authored by Markus Blatt's avatar Markus Blatt
Browse files

Do not be so verbose.

[[Imported from SVN: r801]]
parent 61a09330
No related branches found
No related tags found
No related merge requests found
......@@ -80,7 +80,7 @@ namespace Dune
char equed;
void *work;
int lwork;
bool first;
bool first, verbose;
};
......@@ -115,7 +115,7 @@ namespace Dune
template<typename T, typename A, int n, int m>
SuperLU<BCRSMatrix<FieldMatrix<T,n,m>,A> >
::SuperLU(const Matrix& mat_)
: a(0), lwork(0), work(0), first(true)
: a(0), lwork(0), work(0), first(true), verbose(false)
{
setMatrix(mat_);
......@@ -167,26 +167,28 @@ namespace Dune
&L, &U, work, lwork, &B, &X, &rpg, &rcond, &ferr,
&berr, &memusage, &stat, &info);
dinfo<<"LU factorization: dgssvx() returns info "<< info<<std::endl;
if ( info == 0 || info == n+1 ) {
if ( options.PivotGrowth )
dinfo<<"Recip. pivot growth = "<<rpg<<std::endl;
if ( options.ConditionNumber )
dinfo<<"Recip. condition number = %e\n"<< rcond<<std::endl;
SCformat* Lstore = (SCformat *) L.Store;
NCformat* Ustore = (NCformat *) U.Store;
dinfo<<"No of nonzeros in matrix ="<<mat.Nnz()<<std::endl;
dinfo<<"No of nonzeros in factor L = "<< Lstore->nnz<<std::endl;
dinfo<<"No of nonzeros in factor U = "<< Ustore->nnz<<std::endl;
dinfo<<"No of nonzeros in L+U = "<< Lstore->nnz + Ustore->nnz - n<<std::endl;
dinfo<<"L\\U MB "<<memusage.for_lu/1e6<<" \ttotal MB needed "<<memusage.total_needed/1e6
<<" \texpansions "<<memusage.expansions<<std::endl;
} else if ( info > 0 && lwork == -1 ) {
dinfo<<"** Estimated memory: "<< info - n<<std::endl;
if(verbose) {
dinfo<<"LU factorization: dgssvx() returns info "<< info<<std::endl;
if ( info == 0 || info == n+1 ) {
if ( options.PivotGrowth )
dinfo<<"Recip. pivot growth = "<<rpg<<std::endl;
if ( options.ConditionNumber )
dinfo<<"Recip. condition number = %e\n"<< rcond<<std::endl;
SCformat* Lstore = (SCformat *) L.Store;
NCformat* Ustore = (NCformat *) U.Store;
dinfo<<"No of nonzeros in matrix ="<<mat.Nnz()<<std::endl;
dinfo<<"No of nonzeros in factor L = "<< Lstore->nnz<<std::endl;
dinfo<<"No of nonzeros in factor U = "<< Ustore->nnz<<std::endl;
dinfo<<"No of nonzeros in L+U = "<< Lstore->nnz + Ustore->nnz - n<<std::endl;
dinfo<<"L\\U MB "<<memusage.for_lu/1e6<<" \ttotal MB needed "<<memusage.total_needed/1e6
<<" \texpansions "<<memusage.expansions<<std::endl;
} else if ( info > 0 && lwork == -1 ) {
dinfo<<"** Estimated memory: "<< info - n<<std::endl;
}
if ( options.PrintStat ) StatPrint(&stat);
}
if ( options.PrintStat ) StatPrint(&stat);
StatFree(&stat);
options.Fact = FACTORED;
}
......@@ -218,14 +220,12 @@ namespace Dune
a->usmv(-1, x, d);
double def0=d.two_norm();
options.IterRefine=DOUBLE;
dgssvx(&options, &static_cast<SuperMatrix&>(mat), perm_c, perm_r, etree, &equed, R, C,
&L, &U, work, lwork, &B, &X, &rpg, &rcond, &ferr, &berr,
&memusage, &stat, &info);
dinfo<<"Triangular solve: dgssvx() returns info "<< info<<std::endl;
res.iterations=1;
if(options.Equil==YES)
......@@ -240,16 +240,23 @@ namespace Dune
res.conv_rate = res.reduction;
res.converged=(res.reduction<1e-10||d.two_norm()<1e-18);
if ( info == 0 || info == n+1 ) {
if(verbose) {
if ( options.IterRefine ) {
dinfo<<"Iterative Refinement: steps="
<<stat.RefineSteps<<" FERR="<<ferr<<" BERR="<<berr<<std::endl;
dinfo<<"Triangular solve: dgssvx() returns info "<< info<<std::endl;
if ( info == 0 || info == n+1 ) {
if ( options.IterRefine ) {
dinfo<<"Iterative Refinement: steps="
<<stat.RefineSteps<<" FERR="<<ferr<<" BERR="<<berr<<std::endl;
}else
dinfo<<" FERR="<<ferr<<" BERR="<<berr<<std::endl;
} else if ( info > 0 && lwork == -1 ) {
dinfo<<"** Estimated memory: "<< info - n<<" bytes"<<std::endl;
}
} else if ( info > 0 && lwork == -1 ) {
dinfo<<"** Estimated memory: "<< info - n<<" bytes"<<std::endl;
if ( options.PrintStat ) StatPrint(&stat);
}
if ( options.PrintStat ) StatPrint(&stat);
StatFree(&stat);
}
......
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