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
3a29b9fc
Commit
3a29b9fc
authored
19 years ago
by
Markus Blatt
Browse files
Options
Downloads
Patches
Plain Diff
Changes needed to use BlockPreconditioner.
[[Imported from SVN: r516]]
parent
cbdcf6ff
No related branches found
Branches containing commit
No related tags found
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
+53
-20
53 additions, 20 deletions
istl/paamg/smoother.hh
with
53 additions
and
20 deletions
istl/paamg/smoother.hh
+
53
−
20
View file @
3a29b9fc
...
...
@@ -30,19 +30,18 @@ namespace Dune
struct
DefaultSmootherArgs
{
/**
* @brief The type of
matrix the smoother is f
or.
* @brief The type of
the relaxation fact
or.
*/
typedef
typename
T
::
matrix_type
Matrix
;
typedef
T
RelaxationFactor
;
/**
* @brief The numbe of iterations to perform.
*/
int
iterations
;
/**
* @brief The relaxation factor to use.
*/
typename
Matrix
::
field_type
relaxationFactor
;
RelaxationFactor
relaxationFactor
;
/**
* @brief Default constructor.
...
...
@@ -58,10 +57,16 @@ namespace Dune
template
<
class
T
>
struct
SmootherTraits
{
typedef
DefaultSmootherArgs
<
T
>
Arguments
;
typedef
DefaultSmootherArgs
<
typename
T
::
matrix_type
::
field_type
>
Arguments
;
};
template
<
class
X
,
class
Y
,
class
C
,
class
T
>
struct
SmootherTraits
<
BlockPreconditioner
<
X
,
Y
,
C
,
T
>
>
{
typedef
DefaultSmootherArgs
<
typename
T
::
matrix_type
::
field_type
>
Arguments
;
};
template
<
class
T
>
class
ConstructionTraits
;
...
...
@@ -71,9 +76,9 @@ namespace Dune
template
<
class
T
,
class
C
=
SequentialInformation
>
class
DefaultConstructionArgs
{
friend
class
ConstructionTraits
<
T
>
;
typedef
T
Matrix
;
typedef
typename
T
::
m
atrix
_type
Matrix
;
typedef
DefaultSmootherArgs
<
typename
M
atrix
::
field_type
>
SmootherArgs
;
public:
void
setMatrix
(
const
Matrix
&
matrix
)
...
...
@@ -81,34 +86,50 @@ namespace Dune
matrix_
=&
matrix
;
}
void
setArgs
(
const
DefaultSmootherArgs
<
T
>&
args
)
const
Matrix
&
getMatrix
()
const
{
return
*
matrix_
;
}
void
setArgs
(
const
SmootherArgs
&
args
)
{
args_
=&
args
;
}
const
SmootherArgs
getArgs
()
const
{
return
*
args_
;
}
void
setComm
(
const
C
&
comm
)
{
comm_
=
&
comm
;
}
const
C
&
getComm
()
const
{
return
*
comm_
;
}
private
:
const
Matrix
*
matrix_
;
const
Default
SmootherArgs
<
T
>
*
args_
;
const
SmootherArgs
*
args_
;
const
C
*
comm_
;
};
/**
* @brief Policy for the construction of the SeqSSOR smoother
*/
template
<
class
M
,
class
X
,
class
Y
>
struct
ConstructionTraits
<
SeqSSOR
<
M
,
X
,
Y
>
>
{
typedef
DefaultConstructionArgs
<
SeqSSOR
<
M
,
X
,
Y
>
>
Arguments
;
typedef
DefaultConstructionArgs
<
M
>
Arguments
;
static
inline
SeqSSOR
<
M
,
X
,
Y
>*
construct
(
Arguments
&
args
)
{
return
new
SeqSSOR
<
M
,
X
,
Y
>
(
*
(
args
.
m
atrix
_
),
args
.
args_
->
iterations
,
args
.
args_
->
relaxationFactor
);
return
new
SeqSSOR
<
M
,
X
,
Y
>
(
args
.
getM
atrix
(
),
args
.
getArgs
().
iterations
,
args
.
getArgs
().
relaxationFactor
);
}
};
...
...
@@ -119,12 +140,12 @@ namespace Dune
template
<
class
M
,
class
X
,
class
Y
>
struct
ConstructionTraits
<
SeqJac
<
M
,
X
,
Y
>
>
{
typedef
DefaultConstructionArgs
<
SeqJac
<
M
,
X
,
Y
>
>
Arguments
;
typedef
DefaultConstructionArgs
<
M
>
Arguments
;
static
inline
SeqJac
<
M
,
X
,
Y
>*
construct
(
Arguments
&
args
)
{
return
new
SeqJac
<
M
,
X
,
Y
>
(
*
(
args
.
m
atrix
_
),
args
.
args_
->
iterations
,
args
.
args_
->
relaxationFactor
);
return
new
SeqJac
<
M
,
X
,
Y
>
(
args
.
getM
atrix
(
),
args
.
getArgs
().
iterations
,
args
.
getArgs
().
relaxationFactor
);
}
};
...
...
@@ -135,15 +156,27 @@ namespace Dune
template
<
class
M
,
class
X
,
class
Y
,
class
C
>
struct
ConstructionTraits
<
ParSSOR
<
M
,
X
,
Y
,
C
>
>
{
typedef
DefaultConstructionArgs
<
ParSSOR
<
M
,
X
,
Y
,
C
>
,
C
>
Arguments
;
typedef
DefaultConstructionArgs
<
M
,
C
>
Arguments
;
static
inline
ParSSOR
<
M
,
X
,
Y
,
C
>*
construct
(
Arguments
&
args
)
{
return
new
ParSSOR
<
M
,
X
,
Y
,
C
>
(
*
(
args
.
m
atrix
_
),
args
.
args_
->
iterations
,
args
.
args_
->
relaxationFactor
,
*
args
.
c
omm
_
);
return
new
ParSSOR
<
M
,
X
,
Y
,
C
>
(
args
.
getM
atrix
(
),
args
.
getArgs
().
iterations
,
args
.
getArgs
().
relaxationFactor
,
args
.
getC
omm
()
);
}
};
template
<
class
X
,
class
Y
,
class
C
,
class
T
>
struct
ConstructionTraits
<
BlockPreconditioner
<
X
,
Y
,
C
,
T
>
>
{
typedef
DefaultConstructionArgs
<
typename
T
::
matrix_type
,
C
>
Arguments
;
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
)),
args
.
getComm
());
}
};
}
// namespace Amg
}
// namespace Dune
...
...
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