Skip to content
Snippets Groups Projects

Feature/proximal newton solver

2 files
+ 9
10
Compare changes
  • Side-by-side
  • Inline
Files
2
@@ -403,6 +403,7 @@ void RiemannianTrustRegionSolver<Basis,TargetSpace>::solve()
@@ -403,6 +403,7 @@ void RiemannianTrustRegionSolver<Basis,TargetSpace>::solve()
*hessianMatrix_,
*hessianMatrix_,
i==0 // assemble occupation pattern only for the first call
i==0 // assemble occupation pattern only for the first call
);
);
 
std::cout << "Assembly took " << gradientTimer.elapsed() << " sec." << std::endl;
rhs *= -1; // The right hand side is the _negative_ gradient
rhs *= -1; // The right hand side is the _negative_ gradient
@@ -418,11 +419,12 @@ void RiemannianTrustRegionSolver<Basis,TargetSpace>::solve()
@@ -418,11 +419,12 @@ void RiemannianTrustRegionSolver<Basis,TargetSpace>::solve()
if ((*mgStep->ignoreNodes_)[j][k]) // global Dirichlet nodes set
if ((*mgStep->ignoreNodes_)[j][k]) // global Dirichlet nodes set
gradient[j][k] = 0;
gradient[j][k] = 0;
 
if (this->verbosity_ == Solver::FULL and rank==0) {
 
std::cout << "Gradient operator norm: " << l2Norm_->operator()(gradient) << std::endl;
 
std::cout << "Gradient norm: " << gradient.two_norm() << std::endl;
 
}
if (this->verbosity_ == Solver::FULL and rank==0)
if (this->verbosity_ == Solver::FULL and rank==0)
std::cout << "Gradient norm: " << l2Norm_->operator()(gradient) << std::endl;
std::cout << "Oveall assembly took " << gradientTimer.elapsed() << " sec." << std::endl;
if (this->verbosity_ == Solver::FULL)
std::cout << "Assembly took " << gradientTimer.elapsed() << " sec." << std::endl;
totalAssemblyTime += gradientTimer.elapsed();
totalAssemblyTime += gradientTimer.elapsed();
// Transfer matrix data
// Transfer matrix data
@@ -467,8 +469,7 @@ void RiemannianTrustRegionSolver<Basis,TargetSpace>::solve()
@@ -467,8 +469,7 @@ void RiemannianTrustRegionSolver<Basis,TargetSpace>::solve()
if (mgStep && solved)
if (mgStep && solved)
corr_global = mgStep->getSol();
corr_global = mgStep->getSol();
std::cout << "Two norm of the correction: " << corr_global.two_norm() << std::endl;
//std::cout << "Correction: " << std::endl << corr_global << std::endl;
}
}
// Distribute solution
// Distribute solution
Loading