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
2b3dddce
Commit
2b3dddce
authored
20 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Debugged version of the indices coarsener. Tests now work!
[[Imported from SVN: r207]]
parent
3b1f8881
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
istl/paamg/indicescoarsener.hh
+46
-26
46 additions, 26 deletions
istl/paamg/indicescoarsener.hh
with
46 additions
and
26 deletions
istl/paamg/indicescoarsener.hh
+
46
−
26
View file @
2b3dddce
...
...
@@ -63,17 +63,6 @@ namespace Dune
RemoteIndices
&
coarseRemote
);
private:
template
<
typename
Graph
>
static
void
buildCoarseIndexSet
(
const
IndexSet
&
fineIndices
,
Graph
&
fineGraph
,
AggregatesMap
<
typename
Graph
::
VertexDescriptor
>&
aggregates
,
IndexSet
&
coarseIndices
);
template
<
typename
V
>
static
void
buildCoarseRemoteIndices
(
const
RemoteIndices
&
fineRemote
,
const
AggregatesMap
<
V
>&
aggregates
,
IndexSet
&
coarseIndices
,
RemoteIndices
&
coarseRemote
);
template
<
typename
G
>
class
AggregateRenumberer
{
...
...
@@ -89,12 +78,19 @@ namespace Dune
aggregates_
[
edge
.
target
()]
=
number_
;
}
size_t
operator
()(
const
TG
&
global
)
{
size_t
current
=
number_
;
++
number_
;
return
current
;
}
void
operator
++
()
{
++
number_
;
}
operator
in
t
()
operator
size_
t
()
{
return
number_
;
}
...
...
@@ -125,7 +121,7 @@ namespace Dune
}
private
:
in
t
number_
;
size_
t
number_
;
bool
isPublic_
;
TA
attribute_
;
AggregatesMap
<
Vertex
>&
aggregates_
;
...
...
@@ -133,6 +129,19 @@ namespace Dune
};
template
<
typename
Graph
>
static
void
buildCoarseIndexSet
(
const
IndexSet
&
fineIndices
,
Graph
&
fineGraph
,
AggregatesMap
<
typename
Graph
::
VertexDescriptor
>&
aggregates
,
IndexSet
&
coarseIndices
,
AggregateRenumberer
<
Graph
>&
renumberer
);
template
<
typename
Graph
>
static
void
buildCoarseRemoteIndices
(
const
RemoteIndices
&
fineRemote
,
const
AggregatesMap
<
typename
Graph
::
VertexDescriptor
>&
aggregates
,
IndexSet
&
coarseIndices
,
RemoteIndices
&
coarseRemote
,
AggregateRenumberer
<
Graph
>&
renumberer
);
};
template
<
typename
E
,
typename
TG
,
typename
TA
,
int
N
>
...
...
@@ -144,8 +153,9 @@ namespace Dune
IndexSet
&
coarseIndices
,
RemoteIndices
&
coarseRemote
)
{
buildCoarseIndexSet
(
fineIndices
,
fineGraph
,
aggregates
,
coarseIndices
);
buildCoarseRemoteIndices
(
fineRemote
,
aggregates
,
coarseIndices
,
coarseRemote
);
AggregateRenumberer
<
Graph
>
renumberer
(
aggregates
);
buildCoarseIndexSet
(
fineIndices
,
fineGraph
,
aggregates
,
coarseIndices
,
renumberer
);
buildCoarseRemoteIndices
(
fineRemote
,
aggregates
,
coarseIndices
,
coarseRemote
,
renumberer
);
}
template
<
typename
E
,
typename
TG
,
typename
TA
,
int
N
>
...
...
@@ -153,13 +163,12 @@ namespace Dune
void
IndicesCoarsener
<
E
,
TG
,
TA
,
N
>::
buildCoarseIndexSet
(
const
IndexSet
&
fineIndices
,
Graph
&
fineGraph
,
AggregatesMap
<
typename
Graph
::
VertexDescriptor
>&
aggregates
,
IndexSet
&
coarseIndices
)
IndexSet
&
coarseIndices
,
AggregateRenumberer
<
Graph
>&
renumberer
)
{
typedef
typename
IndexSet
::
const_iterator
Iterator
;
typedef
typename
Graph
::
VertexDescriptor
Vertex
;
AggregateRenumberer
<
Graph
>
renumberer
(
aggregates
);
Iterator
end
=
fineIndices
.
end
();
coarseIndices
.
beginResize
();
...
...
@@ -196,6 +205,9 @@ namespace Dune
coarseIndices
.
endResize
();
assert
(
coarseIndices
.
size
()
==
renumberer
);
assert
((
coarseIndices
.
begin
()
+
(
coarseIndices
.
size
()
-
1
))
->
local
()
==
renumberer
-
1
);
// Reset the visited flags
typedef
typename
Graph
::
ConstVertexIterator
VertexIterator
;
VertexIterator
vend
=
fineGraph
.
end
();
...
...
@@ -205,11 +217,12 @@ namespace Dune
}
template
<
typename
E
,
typename
TG
,
typename
TA
,
int
N
>
template
<
typename
V
>
template
<
typename
Graph
>
void
IndicesCoarsener
<
E
,
TG
,
TA
,
N
>::
buildCoarseRemoteIndices
(
const
RemoteIndices
&
fineRemote
,
const
AggregatesMap
<
V
>&
aggregates
,
const
AggregatesMap
<
typename
Graph
::
VertexDescriptor
>&
aggregates
,
IndexSet
&
coarseIndices
,
RemoteIndices
&
coarseRemote
)
RemoteIndices
&
coarseRemote
,
AggregateRenumberer
<
Graph
>&
renumberer
)
{
std
::
vector
<
char
>
attributes
(
coarseIndices
.
size
());
...
...
@@ -223,7 +236,7 @@ namespace Dune
assert
(
neighbour
->
second
.
first
==
neighbour
->
second
.
second
);
// Mark all as not known
for
(
in
t
i
=
0
;
i
<
coarseIndices
.
size
();
i
++
)
for
(
size_
t
i
=
0
;
i
<
coarseIndices
.
size
();
i
++
)
attributes
[
i
]
=
std
::
numeric_limits
<
char
>::
max
();
typedef
typename
RemoteIndices
::
RemoteIndexList
::
const_iterator
...
...
@@ -231,9 +244,13 @@ namespace Dune
Iterator
riEnd
=
neighbour
->
second
.
second
->
end
();
for
(
Iterator
index
=
neighbour
->
second
.
second
->
begin
();
index
!=
riEnd
;
++
index
)
{
assert
(
attributes
[
aggregates
[
index
->
localIndexPair
().
local
()]]
==
std
::
numeric_limits
<
char
>::
max
()
||
attributes
[
aggregates
[
index
->
localIndexPair
().
local
()]]
==
index
->
attribute
());
attributes
[
aggregates
[
index
->
localIndexPair
().
local
()]]
=
index
->
attribute
();
if
(
!
E
::
contains
(
index
->
localIndexPair
().
local
().
attribute
()))
{
assert
(
aggregates
[
index
->
localIndexPair
().
local
()]
<
attributes
.
size
());
assert
(
attributes
[
aggregates
[
index
->
localIndexPair
().
local
()]]
==
std
::
numeric_limits
<
char
>::
max
()
||
attributes
[
aggregates
[
index
->
localIndexPair
().
local
()]]
==
index
->
attribute
());
attributes
[
aggregates
[
index
->
localIndexPair
().
local
()]]
=
index
->
attribute
();
}
}
// Build remote index list
...
...
@@ -252,10 +269,13 @@ namespace Dune
}
}
// The number of neighbours should not change!
assert
(
coarseRemote
.
neighbours
()
==
fineRemote
.
neighbours
());
// snyc the index set and the remote indices to recompute missing
// indices
IndicesSyncer
<
TG
,
TA
,
N
>
syncer
(
coarseIndices
,
coarseRemote
);
syncer
.
sync
();
syncer
.
sync
(
renumberer
);
}
...
...
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