Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-solvers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
agnumpde
dune-solvers
Commits
04cab723
There was a problem fetching the pipeline summary.
Commit
04cab723
authored
8 years ago
by
Elias Pipping
Browse files
Options
Downloads
Patches
Plain Diff
Tests: Cover the case of partial Dirichlet BC
parent
abeee1ee
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dune/solvers/test/common.hh
+13
-5
13 additions, 5 deletions
dune/solvers/test/common.hh
dune/solvers/test/multigridtest.cc
+4
-2
4 additions, 2 deletions
dune/solvers/test/multigridtest.cc
with
17 additions
and
7 deletions
dune/solvers/test/common.hh
+
13
−
5
View file @
04cab723
...
...
@@ -357,7 +357,7 @@ void markBoundaryDOFs(const GridView& gridView, BitVector& isBoundary)
}
}
template
<
size_t
blocksize
,
class
GridView
>
template
<
size_t
blocksize
,
class
GridView
,
bool
trivialDirichletOnly
=
true
>
class
SymmetricSampleProblem
{
public:
typedef
typename
Dune
::
FieldMatrix
<
double
,
blocksize
,
blocksize
>
MatrixBlock
;
...
...
@@ -376,7 +376,15 @@ public:
ignore
.
resize
(
A
.
N
());
ignore
.
unsetAll
();
markBoundaryDOFs
(
gridView
,
ignore
);
if
(
trivialDirichletOnly
)
markBoundaryDOFs
(
gridView
,
ignore
);
else
{
// Mark the first component only
Dune
::
BitSetVector
<
blocksize
>
boundaryNodes
(
A
.
N
(),
false
);
markBoundaryDOFs
(
gridView
,
boundaryNodes
);
for
(
size_t
i
=
0
;
i
<
boundaryNodes
.
size
();
++
i
)
ignore
[
i
][
0
]
=
boundaryNodes
[
i
][
0
];
}
u
.
resize
(
A
.
N
());
u_ex
.
resize
(
A
.
N
());
...
...
@@ -389,9 +397,9 @@ public:
u
=
0
;
for
(
size_t
i
=
0
;
i
<
u
.
size
();
++
i
)
for
(
size_t
j
=
0
;
j
<
blocksize
;
++
j
)
{
//
in case of no dirichlet values you can make th
e
// matrix pd hereby
//
A[i][i][j][j] += 0.5*std::abs(A[0][0][0][0]);
//
Make the matrix positive-definitiv
e
if
(
not
trivialDirichletOnly
)
A
[
i
][
i
][
j
][
j
]
+=
0.5
*
std
::
abs
(
A
[
0
][
0
][
0
][
0
]);
u_ex
[
i
][
j
]
=
(
1.0
*
rand
())
/
RAND_MAX
;
}
...
...
This diff is collapsed.
Click to expand it.
dune/solvers/test/multigridtest.cc
+
4
−
2
View file @
04cab723
...
...
@@ -32,7 +32,7 @@
* It furthermore tests the functionality to solve correctly for a different rhs with otherwise unaltered data without calling preprocess().
* Setting and using different smoothers in different levels is NOT a tested feature.
*/
template
<
size_t
blocksize
>
template
<
size_t
blocksize
,
bool
trivialDirichletOnly
=
true
>
struct
MultigridTestSuite
{
template
<
class
GridType
>
...
...
@@ -44,7 +44,7 @@ struct MultigridTestSuite
bool
passed
=
true
;
using
Problem
=
SymmetricSampleProblem
<
blocksize
,
typename
GridType
::
LevelGridView
>
;
SymmetricSampleProblem
<
blocksize
,
typename
GridType
::
LevelGridView
,
trivialDirichletOnly
>
;
Problem
p
(
grid
.
levelGridView
(
grid
.
maxLevel
()));
typedef
typename
Problem
::
Vector
Vector
;
...
...
@@ -127,9 +127,11 @@ int main(int argc, char** argv)
MultigridTestSuite
<
1
>
testsuite1
;
MultigridTestSuite
<
2
>
testsuite2
;
MultigridTestSuite
<
3
,
false
>
testsuite3f
;
MultigridTestSuite
<
8
>
testsuite8
;
passed
=
checkWithStandardGrids
(
testsuite1
);
passed
=
checkWithStandardGrids
(
testsuite2
);
passed
=
checkWithStandardGrids
(
testsuite3f
);
passed
=
checkWithStandardGrids
(
testsuite8
);
return
passed
?
0
:
1
;
...
...
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