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
8fc31db5
Commit
8fc31db5
authored
6 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
Implement VariableBlockVector<double>
parent
2b63e74e
No related branches found
No related tags found
1 merge request
!240
Allow number types as entries of matrix and vector types
Pipeline
#14850
passed
6 years ago
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dune/istl/bvector.hh
+2
-2
2 additions, 2 deletions
dune/istl/bvector.hh
dune/istl/test/vbvectortest.cc
+9
-0
9 additions, 0 deletions
dune/istl/test/vbvectortest.cc
dune/istl/vbvector.hh
+2
-5
2 additions, 5 deletions
dune/istl/vbvector.hh
with
13 additions
and
7 deletions
dune/istl/bvector.hh
+
2
−
2
View file @
8fc31db5
...
...
@@ -224,7 +224,7 @@ namespace Imp {
[
&
](
auto
id
)
{
using
namespace
std
;
for
(
size_type
i
=
0
;
i
<
this
->
n
;
++
i
)
sum
+=
Dune
::
dot
((
*
this
)[
i
],
y
[
i
]);
sum
+=
Dune
::
dot
(
id
(
(
*
this
)[
i
]
)
,
y
[
i
]);
},
[
&
](
auto
id
)
{
for
(
size_type
i
=
0
;
i
<
this
->
n
;
++
i
)
...
...
@@ -283,7 +283,7 @@ namespace Imp {
Hybrid
::
ifElse
(
IsNumber
<
B
>
(),
[
&
](
auto
id
)
{
for
(
size_type
i
=
0
;
i
<
this
->
n
;
++
i
)
sum
+=
fvmeta
::
abs2
((
*
this
)[
i
]);
sum
+=
fvmeta
::
abs2
(
id
(
(
*
this
)[
i
])
)
;
},
[
&
](
auto
id
)
{
for
(
size_type
i
=
0
;
i
<
this
->
n
;
++
i
)
...
...
This diff is collapsed.
Click to expand it.
dune/istl/test/vbvectortest.cc
+
9
−
0
View file @
8fc31db5
...
...
@@ -72,5 +72,14 @@ int main()
testVectorSpaceOperations
(
v3
);
testScalarProduct
(
v3
);
// Perform tests with a scalar vector entry
VariableBlockVector
<
double
>
v5
(
10
);
testHomogeneousRandomAccessContainer
(
v5
);
Dune
::
testConstructibility
<
VariableBlockVector
<
double
>
>
();
testNorms
(
v5
);
testVectorSpaceOperations
(
v5
);
testScalarProduct
(
v5
);
return
suite
.
exit
();
}
This diff is collapsed.
Click to expand it.
dune/istl/vbvector.hh
+
2
−
5
View file @
8fc31db5
...
...
@@ -48,7 +48,7 @@ namespace Dune {
//===== type definitions and constants
//! export the type representing the field
type
def
typename
B
::
field_type
field_type
;
using
field_
type
=
typename
Imp
::
BlockTraits
<
B
>::
field_type
;
//! export the allocator type
typedef
A
allocator_type
;
...
...
@@ -82,10 +82,7 @@ namespace Dune {
/** increment block level counter, yes, it is two levels because
VariableBlockVector is a container of containers
*/
enum
{
//! The number of blocklevels this vector contains.
blocklevel
=
B
::
blocklevel
+
2
};
static
constexpr
unsigned
int
blocklevel
=
Imp
::
BlockTraits
<
B
>::
blockLevel
()
+
2
;
//===== constructors and such
...
...
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