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
b443f0cb
Commit
b443f0cb
authored
13 years ago
by
Uli Sack
Committed by
usack
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
deleted loads of white space
[[Imported from SVN: r5401]]
parent
337b5002
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
dune/solvers/transferoperators/truncatedcompressedmgtransfer.cc
+16
-34
16 additions, 34 deletions
...olvers/transferoperators/truncatedcompressedmgtransfer.cc
with
16 additions
and
34 deletions
dune/solvers/transferoperators/truncatedcompressedmgtransfer.cc
+
16
−
34
View file @
b443f0cb
template
<
class
DiscFuncType
,
class
BitVectorType
,
class
OperatorType
>
void
TruncatedCompressedMGTransfer
<
DiscFuncType
,
BitVectorType
,
OperatorType
>::
prolong
(
const
DiscFuncType
&
f
,
DiscFuncType
&
t
,
const
BitVectorType
&
critical
)
const
...
...
@@ -19,7 +17,7 @@ void TruncatedCompressedMGTransfer<DiscFuncType, BitVectorType, OperatorType>::p
typedef
typename
TransferOperatorType
::
row_type
RowType
;
typedef
typename
RowType
::
ConstIterator
ColumnIterator
;
Iterator
tIt
=
t
.
begin
();
ConstIterator
fIt
=
f
.
begin
();
...
...
@@ -39,14 +37,10 @@ void TruncatedCompressedMGTransfer<DiscFuncType, BitVectorType, OperatorType>::p
if
(
!
critical
[
rowIdx
][
i
])
(
*
tIt
)[
i
]
+=
(
*
cIt
)[
0
][
0
]
*
f
[
cIt
.
index
()][
i
];
}
}
++
tIt
;
}
}
template
<
class
DiscFuncType
,
class
BitVectorType
,
class
OperatorType
>
...
...
@@ -72,28 +66,24 @@ void TruncatedCompressedMGTransfer<DiscFuncType, BitVectorType, OperatorType>::r
typedef
typename
RowType
::
ConstIterator
ColumnIterator
;
for
(
int
rowIdx
=
0
;
rowIdx
<
this
->
matrix_
->
N
();
rowIdx
++
)
{
const
RowType
&
row
=
(
*
this
->
matrix_
)[
rowIdx
];
ColumnIterator
cIt
=
row
.
begin
();
ColumnIterator
cEndIt
=
row
.
end
();
for
(;
cIt
!=
cEndIt
;
++
cIt
)
{
// The following lines are a matrix-vector loop, but rows belonging
// to critical dofs are left out
typename
DiscFuncType
::
block_type
&
tEntry
=
t
[
cIt
.
index
()];
for
(
int
i
=
0
;
i
<
blocksize
;
i
++
)
{
if
(
!
critical
[
rowIdx
][
i
])
tEntry
[
i
]
+=
(
*
cIt
)[
0
][
0
]
*
f
[
rowIdx
][
i
];
}
}
}
}
...
...
@@ -102,7 +92,6 @@ void TruncatedCompressedMGTransfer<DiscFuncType, BitVectorType, OperatorType>::
galerkinRestrict
(
const
OperatorType
&
fineMat
,
OperatorType
&
coarseMat
,
const
BitVectorType
&
critical
)
const
{
if
(
this
->
recompute_
!=
NULL
&&
this
->
recompute_
->
size
()
!=
(
unsigned
int
)
this
->
matrix_
->
M
())
DUNE_THROW
(
Dune
::
Exception
,
"The size of the recompute_-bitfield doesn't match the "
<<
"size of the coarse grid space!"
);
...
...
@@ -123,31 +112,28 @@ galerkinRestrict(const OperatorType& fineMat, OperatorType& coarseMat,
for
(
int
i
=
0
;
i
<
coarseMat
.
N
();
i
++
)
{
RowType
&
row
=
coarseMat
[
i
];
// Loop over all columns of the stiffness matrix
ColumnIterator
m
=
row
.
begin
();
ColumnIterator
mEnd
=
row
.
end
();
for
(;
m
!=
mEnd
;
++
m
)
{
if
((
*
this
->
recompute_
)[
i
][
0
]
||
(
*
this
->
recompute_
)[
m
.
index
()][
0
])
*
m
=
0
;
}
}
}
// Loop over all rows of the stiffness matrix
for
(
int
v
=
0
;
v
<
fineMat
.
N
();
v
++
)
{
const
RowType
&
row
=
fineMat
[
v
];
// Loop over all columns of the stiffness matrix
ConstColumnIterator
m
=
row
.
begin
();
ConstColumnIterator
mEnd
=
row
.
end
();
for
(;
m
!=
mEnd
;
++
m
)
{
int
w
=
m
.
index
();
...
...
@@ -162,33 +148,29 @@ galerkinRestrict(const OperatorType& fineMat, OperatorType& coarseMat,
// Loop over all coarse grid vectors jv that have w in their support
TransferConstColumnIterator
jm
=
(
*
this
->
matrix_
)[
w
].
begin
();
TransferConstColumnIterator
jmEnd
=
(
*
this
->
matrix_
)[
w
].
end
();
for
(;
jm
!=
jmEnd
;
++
jm
)
{
int
jv
=
jm
.
index
();
if
(
this
->
recompute_
&&
!
((
*
this
->
recompute_
)[
iv
][
0
])
&&
!
((
*
this
->
recompute_
)[
jv
][
0
]))
continue
;
typename
OperatorType
::
block_type
&
cm
=
coarseMat
[
iv
][
jv
];
// Compute im * m * jm, but omitting the critical entries
for
(
int
i
=
0
;
i
<
blocksize
;
i
++
)
{
for
(
int
j
=
0
;
j
<
blocksize
;
j
++
)
{
// Truncated Multigrid: Omit coupling if at least
// one of the two vectors is critical
if
(
!
critical
[
v
][
i
]
&&
!
critical
[
w
][
j
])
cm
[
i
][
j
]
+=
(
*
im
)[
0
][
0
]
*
(
*
m
)[
i
][
j
]
*
(
*
jm
)[
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