Skip to content
Snippets Groups Projects
Commit 68c111f6 authored by Elias Pipping's avatar Elias Pipping
Browse files

[Cleanup] Cosmetics

parent 842d3033
No related branches found
No related tags found
No related merge requests found
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
/** \brief Base class for problems where each block can be solved with a /** \brief Base class for problems where each block can be solved with a
* modified gradient method */ * modified gradient method */
template <class ConvexProblem> template <class ConvexProblem>
class MyBlockProblem : /* NOT PUBLIC */ BlockNonlinearGSProblem<ConvexProblem> { class MyBlockProblem : /* not public */ BlockNonlinearGSProblem<ConvexProblem> {
private: private:
typedef BlockNonlinearGSProblem<ConvexProblem> Base; typedef BlockNonlinearGSProblem<ConvexProblem> Base;
...@@ -107,8 +107,7 @@ class MyBlockProblem : /* NOT PUBLIC */ BlockNonlinearGSProblem<ConvexProblem> { ...@@ -107,8 +107,7 @@ class MyBlockProblem : /* NOT PUBLIC */ BlockNonlinearGSProblem<ConvexProblem> {
auto const psi = restrict(problem_.A, problem_.f, u, v, problem_.phi); auto const psi = restrict(problem_.A, problem_.f, u, v, problem_.phi);
Dune::Solvers::Interval<double> D; Dune::Solvers::Interval<double> D;
psi.subDiff(0, D); psi.subDiff(0, D);
// NOTE: Numerical instability can actually get us here if (D[1] > 0) // NOTE: Numerical instability can actually get us here
if (D[1] > 0)
return 0; return 0;
int bisectionsteps = 0; int bisectionsteps = 0;
...@@ -175,17 +174,15 @@ class MyBlockProblem : /* NOT PUBLIC */ BlockNonlinearGSProblem<ConvexProblem> { ...@@ -175,17 +174,15 @@ class MyBlockProblem : /* NOT PUBLIC */ BlockNonlinearGSProblem<ConvexProblem> {
auto const blockEnd = std::end((*col_it)[i]); auto const blockEnd = std::end((*col_it)[i]);
for (auto blockIt = std::begin((*col_it)[i]); blockIt != blockEnd; for (auto blockIt = std::begin((*col_it)[i]); blockIt != blockEnd;
++blockIt) ++blockIt)
if (linearization.truncation[row][i] || if (linearization.truncation[row][i] or
linearization.truncation[col][blockIt.index()]) linearization.truncation[col][blockIt.index()])
*blockIt = 0.0; *blockIt = 0.0;
} }
} }
for (size_t j = 0; j < block_size; ++j) for (size_t j = 0; j < block_size; ++j)
if (linearization.truncation[row][j]) if (linearization.truncation[row][j])
linearization.b[row][j] = 0.0; linearization.b[row][j] = 0.0;
} }
for (size_t j = 0; j < block_size; ++j) for (size_t j = 0; j < block_size; ++j)
outStream << std::setw(9) << linearization.truncation.countmasked(j); outStream << std::setw(9) << linearization.truncation.countmasked(j);
} }
...@@ -266,13 +263,9 @@ class MyBlockProblem<ConvexProblem>::IterateObject { ...@@ -266,13 +263,9 @@ class MyBlockProblem<ConvexProblem>::IterateObject {
} }
private: private:
// problem data
ConvexProblem const &problem; ConvexProblem const &problem;
std::vector<double> maxEigenvalues_; std::vector<double> maxEigenvalues_;
Bisection const bisection_; Bisection const bisection_;
// state data for smoothing procedure used by: // state data for smoothing procedure used by:
// setIterate, updateIterate, solveLocalProblem // setIterate, updateIterate, solveLocalProblem
VectorType u; VectorType u;
......
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