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
b0ad2aaf
Commit
b0ad2aaf
authored
13 years ago
by
Elias Pipping
Committed by
Elias Pipping
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Preliminary local problem solver (BROKEN!)
parent
ef5ef72a
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
+45
-0
45 additions, 0 deletions
src/myblockproblem.hh
with
45 additions
and
0 deletions
src/myblockproblem.hh
+
45
−
0
View file @
b0ad2aaf
...
...
@@ -8,6 +8,10 @@
#include
<dune/tnnmg/problem-classes/nonlinearity.hh>
#include
<dune/tnnmg/problem-classes/onedconvexfunction.hh>
#include
"mynonlinearity.hh"
#include
"nicefunction.hh"
#include
"samplefunctional.hh"
/** \brief Base class for problems where each block can be solved with a scalar
* Gauss-Seidel method */
template
<
class
ConvexProblemTypeTEMPLATE
>
class
MyBlockProblem
{
...
...
@@ -90,6 +94,47 @@ class MyBlockProblem<ConvexProblemTypeTEMPLATE>::IterateObject {
void
solveLocalProblem
(
LocalVectorType
&
ui
,
int
i
,
const
typename
Dune
::
BitSetVector
<
block_size
>::
const_reference
ignore
)
{
// Note: problem.Am and problem.a will be ignored
{
int
const
m
=
i
;
LocalMatrixType
const
*
localA
=
NULL
;
LocalVectorType
localb
(
0
);
typename
MatrixType
::
row_type
::
ConstIterator
it
;
typename
MatrixType
::
row_type
::
ConstIterator
end
=
problem
.
A
[
i
].
end
();
for
(
it
=
problem
.
A
[
m
].
begin
();
it
!=
end
;
++
it
)
{
int
j
=
it
.
index
();
if
(
j
==
m
)
localA
=
&
(
*
it
);
// localA = &A[m][m]
(
*
it
).
umv
(
u
[
j
],
localb
);
// localb += A[m][j] * u[j]
LocalMatrixType
foo
=
problem
.
A
[
j
][
m
];
foo
-=
problem
.
A
[
m
][
j
];
// if (foo.infinity_norm() != 0)
// std::cout << "Indices: " << col << ", " << m << std::endl;
}
localb
-=
problem
.
f
[
m
];
assert
(
localA
!=
NULL
);
// FIXME: Hardcoding a fixed function here for now
Dune
::
TrivialFunction
func
;
Dune
::
MyNonlinearity
<
block_size
>
phi
(
func
);
Dune
::
SampleFunctional
<
block_size
>
localJ
(
*
localA
,
localb
,
phi
);
LocalVectorType
ui_copy
=
ui
;
// std::cout << "Norm before: " << ui.two_norm() << std::endl;
LocalVectorType
correction
;
for
(
size_t
i
=
1
;
i
<=
5
;
++
i
)
{
Dune
::
minimise
(
localJ
,
ui_copy
,
correction
);
ui_copy
+=
correction
;
// This should be correct
}
ui
=
ui_copy
;
return
;
}
const
LocalMatrixType
*
Aii
;
LocalVectorType
b
(
0.0
);
...
...
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