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

Cleanup / comments

parent b2a3ba9e
No related branches found
No related tags found
No related merge requests found
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#include <dune/common/bitsetvector.hh> #include <dune/common/bitsetvector.hh>
#include <dune/tnnmg/problem-classes/bisection.hh> #include <dune/tnnmg/problem-classes/bisection.hh>
//#include <dune/tnnmg/problem-classes/convexproblem.hh>
#include <dune/tnnmg/problem-classes/nonlinearity.hh> #include <dune/tnnmg/problem-classes/nonlinearity.hh>
#include <dune/tnnmg/problem-classes/onedconvexfunction.hh> #include <dune/tnnmg/problem-classes/onedconvexfunction.hh>
...@@ -15,8 +14,8 @@ ...@@ -15,8 +14,8 @@
#include "nicefunction.hh" #include "nicefunction.hh"
#include "samplefunctional.hh" #include "samplefunctional.hh"
/** \brief Base class for problems where each block can be solved with a scalar /** \brief Base class for problems where each block can be solved with a
* Gauss-Seidel method */ * modified gradient method */
template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem { template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
public: public:
typedef MyConvexProblemTypeTEMPLATE MyConvexProblemType; typedef MyConvexProblemTypeTEMPLATE MyConvexProblemType;
...@@ -28,7 +27,7 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem { ...@@ -28,7 +27,7 @@ template <class MyConvexProblemTypeTEMPLATE> class MyBlockProblem {
static const int block_size = MyConvexProblemType::block_size; static const int block_size = MyConvexProblemType::block_size;
/** \brief Solves one local system using a scalar Gauss-Seidel method */ /** \brief Solves one local system using a modified gradient method */
class IterateObject; class IterateObject;
MyBlockProblem(MyConvexProblemType& problem) : problem(problem) { MyBlockProblem(MyConvexProblemType& problem) : problem(problem) {
...@@ -54,8 +53,7 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject { ...@@ -54,8 +53,7 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
protected: protected:
/** \brief Constructor, protected so only friends can instantiate it /** \brief Constructor, protected so only friends can instantiate it
* \param bisection The class used to do a scalar bisection * \param bisection The class used to do a scalar bisection
* \param problem The problem including quadratic part and nonlinear/nonsmooth * \param problem The problem including quadratic part and nonlinear part
* part
*/ */
IterateObject(const Bisection& bisection, MyConvexProblemType& problem) IterateObject(const Bisection& bisection, MyConvexProblemType& problem)
: problem(problem), bisection(bisection) {}; : problem(problem), bisection(bisection) {};
...@@ -63,24 +61,12 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject { ...@@ -63,24 +61,12 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
public: public:
/** \brief Set the current iterate */ /** \brief Set the current iterate */
void setIterate(VectorType& u) { void setIterate(VectorType& u) {
// TODO How should the rang-1 term be handled
// ????????????????????????????????
// s = problem.Am*u;
// problem.phi.setVector(u);
this->u = u; this->u = u;
return; return;
}; };
/** \brief Update the i-th block of the current iterate */ /** \brief Update the i-th block of the current iterate */
void updateIterate(const LocalVectorType& ui, int i) { void updateIterate(const LocalVectorType& ui, int i) {
// TODO How should the rang-1 term be handled
// ????????????????????????????????
// s += (ui-u[i]) * problem.Am[i];
// for(size_t j=0; j<block_size; ++j)
// problem.phi.updateEntry(i, ui[j], j);
u[i] = ui; u[i] = ui;
return; return;
}; };
...@@ -95,7 +81,6 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject { ...@@ -95,7 +81,6 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
void solveLocalProblem( void solveLocalProblem(
LocalVectorType& ui, int m, LocalVectorType& ui, int m,
const typename Dune::BitSetVector<block_size>::const_reference ignore) { const typename Dune::BitSetVector<block_size>::const_reference ignore) {
// Note: problem.Am and problem.a will be ignored
// Note: ignore is currently ignored (what's it used for anyway?) // Note: ignore is currently ignored (what's it used for anyway?)
{ {
LocalMatrixType const* localA = NULL; LocalMatrixType const* localA = NULL;
...@@ -132,10 +117,6 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject { ...@@ -132,10 +117,6 @@ class MyBlockProblem<MyConvexProblemTypeTEMPLATE>::IterateObject {
// state data for smoothing procedure used by: // state data for smoothing procedure used by:
// setIterate, updateIterate, solveLocalProblem // setIterate, updateIterate, solveLocalProblem
VectorType u; VectorType u;
/** \brief Keeps track of the total number of bisection steps that were
* performed */
int bisectionsteps;
}; };
#endif #endif
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