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
defedac5
Commit
defedac5
authored
17 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Each isolated vertex represents an aggregate by itself.
[[Imported from SVN: r821]]
parent
67ecd248
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/smoother.hh
+24
-16
24 additions, 16 deletions
istl/paamg/smoother.hh
with
24 additions
and
16 deletions
istl/paamg/smoother.hh
+
24
−
16
View file @
defedac5
...
...
@@ -437,6 +437,7 @@ namespace Dune
typedef
typename
AggregatesMap
::
AggregateDescriptor
AggregateDescriptor
;
typedef
typename
AggregatesMap
::
VertexDescriptor
VertexDescriptor
;
typedef
typename
SeqOverlappingSchwarz
<
M
,
X
,
TM
,
TA
>::
subdomain_vector
Vector
;
typedef
typename
Vector
::
value_type
Subdomain
;
virtual
void
setMatrix
(
const
M
&
matrix
,
const
AggregatesMap
&
amap
)
{
...
...
@@ -453,7 +454,7 @@ namespace Dune
switch
(
Father
::
getArgs
().
overlap
)
{
case
SmootherArgs
::
vertex
:
{
VertexAdder
visitor
(
subdomains
);
VertexAdder
visitor
(
subdomains
,
amap
);
createSubdomains
(
matrix
,
graph
,
amap
,
visitor
,
visitedMap
);
}
break
;
...
...
@@ -481,25 +482,29 @@ namespace Dune
private
:
struct
VertexAdder
{
VertexAdder
(
Vector
&
subdomains_
)
:
subdomains
(
subdomains_
),
subdomain
(
-
1
)
VertexAdder
(
Vector
&
subdomains_
,
const
AggregatesMap
&
aggregates_
)
:
subdomains
(
subdomains_
),
max
(
-
1
),
subdomain
(
-
1
)
,
aggregates
(
aggregates_
)
{}
template
<
class
T
>
void
operator
()(
const
T
&
edge
)
{
subdomains
[
subdomain
].
insert
(
edge
.
target
());
if
(
aggregates
[
edge
.
target
()]
!=
AggregatesMap
::
ISOLATED
)
subdomains
[
subdomain
].
insert
(
edge
.
target
());
}
int
setAggregate
(
const
AggregateDescriptor
&
aggregate_
)
{
return
++
subdomain
;
subdomain
=
aggregate_
;
max
=
std
::
max
(
subdomain
,
aggregate_
);
}
int
noSubdomains
()
const
{
return
subdomain
+
1
;
return
max
+
1
;
}
private
:
Vector
&
subdomains
;
int
max
;
int
subdomain
;
const
AggregatesMap
&
aggregates
;
};
struct
NoneAdder
{
...
...
@@ -522,7 +527,7 @@ namespace Dune
AggregateAdder
(
Vector
&
subdomains_
,
const
AggregatesMap
&
aggregates_
,
const
MatrixGraph
<
const
M
>&
graph_
,
VM
&
visitedMap_
)
:
subdomains
(
subdomains_
),
subdomain
(
-
1
),
aggregates
(
aggregates_
),
adder
(
subdomains_
),
graph
(
graph_
),
visitedMap
(
visitedMap_
)
adder
(
subdomains_
,
aggregates_
),
graph
(
graph_
),
visitedMap
(
visitedMap_
)
{}
template
<
class
T
>
void
operator
()(
const
T
&
edge
)
...
...
@@ -570,7 +575,7 @@ namespace Dune
// aggregates are numbered consecutively from 0 exept
// for the isolated ones. All isolated vertices form
// one aggregate, here.
bool
isolated
=
false
;
int
isolated
=
false
;
AggregateDescriptor
maxAggregate
=
0
;
for
(
int
i
=
0
;
i
<
amap
.
noVertices
();
++
i
)
...
...
@@ -579,9 +584,6 @@ namespace Dune
else
maxAggregate
=
std
::
max
(
maxAggregate
,
amap
[
i
]);
if
(
isolated
)
maxAggregate
+=
1
;
subdomains
.
resize
(
maxAggregate
+
1
);
// reset the subdomains
...
...
@@ -591,14 +593,20 @@ namespace Dune
// Create the subdomains from the aggregates mapping.
// For each aggregate we mark all entries and the
// neighbouring vertices as belonging to the same subdomain
VertexAdder
aggregateVisitor
(
subdomains
);
VertexAdder
aggregateVisitor
(
subdomains
,
amap
);
for
(
VertexDescriptor
i
=
0
;
i
<
amap
.
noVertices
();
++
i
)
if
(
amap
[
i
]
!=
AggregatesMap
::
ISOLATED
&&
!
get
(
visitedMap
,
i
))
{
AggregateDescriptor
aggregate
=
(
amap
[
i
]
==
AggregatesMap
::
ISOLATED
)
?
maxAggregate
:
amap
[
i
];
if
(
!
get
(
visitedMap
,
i
))
{
AggregateDescriptor
aggregate
=
amap
[
i
];
if
(
amap
[
i
]
==
AggregatesMap
::
ISOLATED
)
{
// isolated vertex gets its own aggregate
subdomains
.
push_back
(
Subdomain
());
aggregate
=
subdomains
.
size
()
-
1
;
}
overlapVisitor
.
setAggregate
(
aggregate
);
int
domain
=
aggregateVisitor
.
setAggregate
(
aggregate
);
subdomains
[
domain
].
insert
(
i
);
aggregateVisitor
.
setAggregate
(
aggregate
);
subdomains
[
aggregate
].
insert
(
i
);
typename
AggregatesMap
::
VertexList
vlist
;
amap
.
template
breadthFirstSearch
<
false
,
false
>(
i
,
aggregate
,
graph
,
vlist
,
aggregateVisitor
,
overlapVisitor
,
visitedMap
);
...
...
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