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
a76a33fa
Commit
a76a33fa
authored
18 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Fully support ILU0 and ILUn as smoothers for AMG
[[Imported from SVN: r715]]
parent
6d0e6941
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
istl/paamg/smoother.hh
+94
-11
94 additions, 11 deletions
istl/paamg/smoother.hh
with
94 additions
and
11 deletions
istl/paamg/smoother.hh
+
94
−
11
View file @
a76a33fa
...
...
@@ -67,13 +67,14 @@ namespace Dune
typedef
DefaultSmootherArgs
<
typename
T
::
matrix_type
::
field_type
>
Arguments
;
};
template
<
class
T
>
class
ConstructionTraits
;
/**
* @brief Construction Arguments for the default smoothers
*/
template
<
class
T
,
class
C
=
SequentialInformation
>
template
<
class
T
>
class
DefaultConstructionArgs
{
typedef
T
Matrix
;
...
...
@@ -96,11 +97,30 @@ namespace Dune
args_
=&
args
;
}
template
<
class
T1
>
void
setComm
(
T1
&
comm
)
{}
const
SmootherArgs
getArgs
()
const
{
return
*
args_
;
}
private
:
const
Matrix
*
matrix_
;
const
SmootherArgs
*
args_
;
};
template
<
class
T
>
struct
ConstructionArgs
:
public
DefaultConstructionArgs
<
typename
T
::
matrix_type
>
{};
template
<
class
T
,
class
C
=
SequentialInformation
>
class
DefaultParallelConstructionArgs
:
public
ConstructionArgs
<
T
>
{
public:
void
setComm
(
const
C
&
comm
)
{
comm_
=
&
comm
;
...
...
@@ -110,14 +130,11 @@ namespace Dune
{
return
*
comm_
;
}
private
:
const
Matrix
*
matrix_
;
const
SmootherArgs
*
args_
;
const
C
*
comm_
;
};
/**
* @brief Policy for the construction of the SeqSSOR smoother
*/
...
...
@@ -181,13 +198,80 @@ namespace Dune
};
/**
* @brief Policy for the construction of the SeqILUn smoother
*/
template
<
class
M
,
class
X
,
class
Y
>
struct
ConstructionTraits
<
SeqILU0
<
M
,
X
,
Y
>
>
{
typedef
DefaultConstructionArgs
<
M
>
Arguments
;
static
inline
SeqILU0
<
M
,
X
,
Y
>*
construct
(
Arguments
&
args
)
{
return
new
SeqILU0
<
M
,
X
,
Y
>
(
args
.
getMatrix
(),
args
.
getArgs
().
relaxationFactor
);
}
static
void
deconstruct
(
SeqILU0
<
M
,
X
,
Y
>*
ilu
)
{
delete
ilu
;
}
};
template
<
class
M
,
class
X
,
class
Y
>
class
ConstructionArgs
<
SeqILUn
<
M
,
X
,
Y
>
>
:
public
DefaultConstructionArgs
<
M
>
{
public:
ConstructionArgs
(
int
n
=
1
)
:
n_
(
n
)
{}
void
setN
(
int
n
)
{
n_
=
n
;
}
int
getN
()
{
return
n_
;
}
private
:
int
n_
;
};
/**
* @brief Policy for the construction of the SeqJac smoother
*/
template
<
class
M
,
class
X
,
class
Y
>
struct
ConstructionTraits
<
SeqILUn
<
M
,
X
,
Y
>
>
{
typedef
ConstructionArgs
<
SeqILUn
<
M
,
X
,
Y
>
>
Arguments
;
static
inline
SeqILUn
<
M
,
X
,
Y
>*
construct
(
Arguments
&
args
)
{
return
new
SeqILUn
<
M
,
X
,
Y
>
(
args
.
getMatrix
(),
args
.
getN
(),
args
.
getArgs
().
relaxationFactor
);
}
static
void
deconstruct
(
SeqILUn
<
M
,
X
,
Y
>*
ilu
)
{
delete
ilu
;
}
};
/**
* @brief Policy for the construction of the ParSSOR smoother
*/
template
<
class
M
,
class
X
,
class
Y
,
class
C
>
struct
ConstructionTraits
<
ParSSOR
<
M
,
X
,
Y
,
C
>
>
{
typedef
DefaultConstructionArgs
<
M
,
C
>
Arguments
;
typedef
Default
Parallel
ConstructionArgs
<
M
,
C
>
Arguments
;
static
inline
ParSSOR
<
M
,
X
,
Y
,
C
>*
construct
(
Arguments
&
args
)
{
...
...
@@ -204,18 +288,17 @@ namespace Dune
template
<
class
X
,
class
Y
,
class
C
,
class
T
>
struct
ConstructionTraits
<
BlockPreconditioner
<
X
,
Y
,
C
,
T
>
>
{
typedef
DefaultConstructionArgs
<
typename
T
::
matrix_type
,
C
>
Arguments
;
typedef
Default
Parallel
ConstructionArgs
<
T
,
C
>
Arguments
;
typedef
ConstructionTraits
<
T
>
SeqConstructionTraits
;
static
inline
BlockPreconditioner
<
X
,
Y
,
C
,
T
>*
construct
(
Arguments
&
args
)
{
return
new
BlockPreconditioner
<
X
,
Y
,
C
,
T
>
(
*
(
new
T
(
args
.
getMatrix
(),
args
.
getArgs
().
iterations
,
args
.
getArgs
().
relaxationFactor
)),
return
new
BlockPreconditioner
<
X
,
Y
,
C
,
T
>
(
*
SeqConstructionTraits
::
construct
(
args
),
args
.
getComm
());
}
static
inline
void
deconstruct
(
BlockPreconditioner
<
X
,
Y
,
C
,
T
>*
bp
)
{
delete
&
bp
->
preconditioner
;
SeqConstructionTraits
::
deconstruct
(
static_cast
<
T
*>
(
&
bp
->
preconditioner
))
;
delete
bp
;
}
...
...
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