Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-fufem
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
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Ansgar Burchardt
dune-fufem
Commits
a2c9e8d6
Commit
a2c9e8d6
authored
Mar 9, 2015
by
Jonathan Youett
Browse files
Options
Downloads
Patches
Plain Diff
Add a method that combines a vector of matrices to one big blockmatrix
parent
d2d7c814
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/fufem/blockmatrixview.hh
+43
-1
43 additions, 1 deletion
dune/fufem/blockmatrixview.hh
with
43 additions
and
1 deletion
dune/fufem/blockmatrixview.hh
+
43
−
1
View file @
a2c9e8d6
...
@@ -43,6 +43,7 @@ public:
...
@@ -43,6 +43,7 @@ public:
return
nCols_
;
return
nCols_
;
}
}
static
void
setupBlockMatrix
(
const
std
::
vector
<
const
MatrixType
*>&
submat
,
MatrixType
&
mat
);
protected
:
protected
:
std
::
vector
<
Dune
::
array
<
int
,
2
>
>
offsets_
;
std
::
vector
<
Dune
::
array
<
int
,
2
>
>
offsets_
;
...
@@ -50,4 +51,45 @@ protected:
...
@@ -50,4 +51,45 @@ protected:
};
};
template
<
class
MatrixType
>
void
BlockMatrixView
<
MatrixType
>::
setupBlockMatrix
(
const
std
::
vector
<
const
MatrixType
*>&
submat
,
MatrixType
&
mat
)
{
BlockMatrixView
<
MatrixType
>
blockView
(
submat
);
Dune
::
MatrixIndexSet
indexSet
(
blockView
.
nRows
(),
blockView
.
nCols
());
for
(
size_t
i
=
0
;
i
<
submat
.
size
();
i
++
)
{
const
auto
row
=
submat
[
i
]
->
begin
();
const
auto
rowEnd
=
submat
[
i
]
->
end
();
for
(;
row
!=
rowEnd
;
row
++
)
{
const
auto
col
=
row
.
begin
();
const
auto
colEnd
=
row
.
end
();
for
(;
col
!=
colEnd
;
col
++
)
indexSet
.
add
(
blockView
.
row
(
i
,
row
.
index
()),
blockView
.
col
(
i
,
col
.
index
()));
}
}
indexSet
.
exportIdx
(
mat
);
mat
=
0
;
for
(
size_t
i
=
0
;
i
<
submat
.
size
();
i
++
)
{
const
auto
row
=
submat
[
i
]
->
begin
();
const
auto
rowEnd
=
submat
[
i
]
->
end
();
for
(;
row
!=
rowEnd
;
row
++
)
{
const
auto
col
=
row
.
begin
();
const
auto
colEnd
=
row
.
end
();
for
(;
col
!=
colEnd
;
col
++
)
mat
[
blockView
.
row
(
i
,
row
.
index
())][
blockView
.
col
(
i
,
col
.
index
())]
=
*
col
;
}
}
}
#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