Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
podlesny
dune-tectonic
Commits
f76c54f5
Commit
f76c54f5
authored
13 years ago
by
Elias Pipping
Committed by
Elias Pipping
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Cleanup / comments
parent
b2a3ba9e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/myblockproblem.hh
+4
-23
4 additions, 23 deletions
src/myblockproblem.hh
with
4 additions
and
23 deletions
src/myblockproblem.hh
+
4
−
23
View file @
f76c54f5
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment