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

show assembly timings and the multigrid output

[[Imported from SVN: r7354]]
parent fbeefe40
No related branches found
No related tags found
No related merge requests found
#include <dune/common/bitsetvector.hh> #include <dune/common/bitsetvector.hh>
#include <dune/common/timer.hh>
#include <dune/istl/io.hh> #include <dune/istl/io.hh>
...@@ -104,7 +105,7 @@ setup(const GridType& grid, ...@@ -104,7 +105,7 @@ setup(const GridType& grid,
innerIterations_, innerIterations_,
innerTolerance_, innerTolerance_,
h1SemiNorm_, h1SemiNorm_,
Solver::QUIET)); Solver::FULL));
// Write all intermediate solutions, if requested // Write all intermediate solutions, if requested
if (instrumented_ if (instrumented_
...@@ -178,7 +179,8 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve() ...@@ -178,7 +179,8 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve()
// Trust-Region Solver // Trust-Region Solver
// ///////////////////////////////////////////////////// // /////////////////////////////////////////////////////
for (int i=0; i<maxTrustRegionSteps_; i++) { for (int i=0; i<maxTrustRegionSteps_; i++) {
Dune::Timer totalTimer;
if (this->verbosity_ == Solver::FULL) { if (this->verbosity_ == Solver::FULL) {
std::cout << "----------------------------------------------------" << std::endl; std::cout << "----------------------------------------------------" << std::endl;
std::cout << " Trust-Region Step Number: " << i std::cout << " Trust-Region Step Number: " << i
...@@ -191,11 +193,15 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve() ...@@ -191,11 +193,15 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve()
CorrectionType corr(x_.size()); CorrectionType corr(x_.size());
corr = 0; corr = 0;
Dune::Timer gradientTimer;
assembler_->assembleGradient(x_, rhs); assembler_->assembleGradient(x_, rhs);
std::cout << "gradient assembly took " << gradientTimer.elapsed() << " sec." << std::endl;
gradientTimer.reset();
assembler_->assembleMatrix(x_, assembler_->assembleMatrix(x_,
*hessianMatrix_, *hessianMatrix_,
i==0 // assemble occupation pattern only for the first call i==0 // assemble occupation pattern only for the first call
); );
std::cout << "hessian assembly took " << gradientTimer.elapsed() << " sec." << std::endl;
//gradientFDCheck(x_, rhs, *rodAssembler_); //gradientFDCheck(x_, rhs, *rodAssembler_);
//hessianFDCheck(x_, *hessianMatrix_, *rodAssembler_); //hessianFDCheck(x_, *hessianMatrix_, *rodAssembler_);
...@@ -419,7 +425,7 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve() ...@@ -419,7 +425,7 @@ void RiemannianTrustRegionSolver<GridType,TargetSpace>::solve()
fclose(fpRod); fclose(fpRod);
} }
std::cout << "iteration took " << totalTimer.elapsed() << " sec." << std::endl;
} }
// ////////////////////////////////////////////// // //////////////////////////////////////////////
......
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