Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-istl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Core Modules
dune-istl
Commits
11448dd3
Commit
11448dd3
authored
7 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
[bugfix] laplacian.hh test case didn't handle allocators properly
parent
86a3fa86
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!87
[multirhstest] Check with AlignedNumber.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/istl/test/laplacian.hh
+11
-11
11 additions, 11 deletions
dune/istl/test/laplacian.hh
with
11 additions
and
11 deletions
dune/istl/test/laplacian.hh
+
11
−
11
View file @
11448dd3
...
...
@@ -5,14 +5,14 @@
#include
<dune/istl/bcrsmatrix.hh>
#include
<dune/common/fvector.hh>
template
<
class
B
>
void
setupSparsityPattern
(
Dune
::
BCRSMatrix
<
B
>&
A
,
int
N
)
template
<
class
B
,
class
Alloc
>
void
setupSparsityPattern
(
Dune
::
BCRSMatrix
<
B
,
Alloc
>&
A
,
int
N
)
{
typedef
typename
Dune
::
BCRSMatrix
<
B
>
Matrix
;
typedef
typename
Dune
::
BCRSMatrix
<
B
,
Alloc
>
Matrix
;
A
.
setSize
(
N
*
N
,
N
*
N
,
N
*
N
*
5
);
A
.
setBuildMode
(
Matrix
::
row_wise
);
for
(
typename
Dune
::
BCRSMatrix
<
B
>::
CreateIterator
i
=
A
.
createbegin
();
i
!=
A
.
createend
();
++
i
)
{
for
(
typename
Dune
::
BCRSMatrix
<
B
,
Alloc
>::
CreateIterator
i
=
A
.
createbegin
();
i
!=
A
.
createend
();
++
i
)
{
int
x
=
i
.
index
()
%
N
;
// x coordinate in the 2d field
int
y
=
i
.
index
()
/
N
;
// y coordinate in the 2d field
...
...
@@ -36,10 +36,10 @@ void setupSparsityPattern(Dune::BCRSMatrix<B>& A, int N)
}
template
<
class
B
>
void
setupLaplacian
(
Dune
::
BCRSMatrix
<
B
>&
A
,
int
N
)
template
<
class
B
,
class
Alloc
>
void
setupLaplacian
(
Dune
::
BCRSMatrix
<
B
,
Alloc
>&
A
,
int
N
)
{
typedef
typename
Dune
::
BCRSMatrix
<
B
>::
field_type
FieldType
;
typedef
typename
Dune
::
BCRSMatrix
<
B
,
Alloc
>::
field_type
FieldType
;
setupSparsityPattern
(
A
,
N
);
...
...
@@ -53,7 +53,7 @@ void setupLaplacian(Dune::BCRSMatrix<B>& A, int N)
b
->
operator
[](
b
.
index
())
=-
1.0
;
for
(
typename
Dune
::
BCRSMatrix
<
B
>::
RowIterator
i
=
A
.
begin
();
i
!=
A
.
end
();
++
i
)
{
for
(
typename
Dune
::
BCRSMatrix
<
B
,
Alloc
>::
RowIterator
i
=
A
.
begin
();
i
!=
A
.
end
();
++
i
)
{
int
x
=
i
.
index
()
%
N
;
// x coordinate in the 2d field
int
y
=
i
.
index
()
/
N
;
// y coordinate in the 2d field
...
...
@@ -92,9 +92,9 @@ void setupLaplacian(Dune::BCRSMatrix<B>& A, int N)
}
}
}
template
<
int
BS
>
void
setBoundary
(
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
BS
>
>&
lhs
,
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
BS
>
>&
rhs
,
template
<
int
BS
,
class
Alloc
>
void
setBoundary
(
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
BS
>
,
Alloc
>&
lhs
,
Dune
::
BlockVector
<
Dune
::
FieldVector
<
double
,
BS
>
,
Alloc
>&
rhs
,
int
N
)
{
for
(
int
i
=
0
;
i
<
lhs
.
size
();
++
i
)
{
...
...
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