Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
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
Package registry
Model registry
Operate
Environments
Terraform modules
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-common
Commits
d113416e
Commit
d113416e
authored
20 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
adapted to new function spaces
[[Imported from SVN: r1213]]
parent
0386a9b3
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fem/transfer/mgtransfer.cc
+16
-15
16 additions, 15 deletions
fem/transfer/mgtransfer.cc
fem/transfer/mgtransfer.hh
+5
-6
5 additions, 6 deletions
fem/transfer/mgtransfer.hh
with
21 additions
and
21 deletions
fem/transfer/mgtransfer.cc
+
16
−
15
View file @
d113416e
...
...
@@ -5,18 +5,19 @@
#include
<dune/common/functionspace.hh>
template
<
class
DiscFuncType
>
void
Dune
::
MGTransfer
<
DiscFuncType
>::
setup
(
const
FunctionSpaceType
&
fS
,
int
cL
,
int
fL
)
template
<
class
FunctionSpaceType
>
void
Dune
::
MGTransfer
<
DiscFuncType
>::
setup
(
const
FunctionSpaceType
&
cS
,
const
FunctionSpaceType
&
fS
)
{
coarseLevel
=
c
L
;
fineLevel
=
f
L
;
coarseLevel
=
c
S
.
level
()
;
fineLevel
=
f
S
.
level
()
;
assert
(
fL
==
cL
+
1
);
//
assert(fL == cL+1);
//assert(level<grid_->maxlevel());
typedef
typename
FunctionSpaceType
::
GridType
GridType
;
int
rows
=
fS
.
size
(
fineLevel
);
int
cols
=
f
S
.
size
(
coarseLevel
);
int
rows
=
fS
.
size
();
int
cols
=
c
S
.
size
();
GridType
&
grid
=
fS
.
getGrid
();
...
...
@@ -94,14 +95,14 @@ void Dune::MGTransfer<DiscFuncType>::setup(const FunctionSpaceType& fS, int cL,
template
<
class
DiscFuncType
>
void
Dune
::
MGTransfer
<
DiscFuncType
>::
prolong
(
const
DiscFuncType
&
f
,
DiscFuncType
&
t
)
const
{
assert
(
t
.
getFunctionSpace
().
size
(
fineLevel
)
==
matrix_
.
rows
());
assert
(
f
.
getFunctionSpace
().
size
(
coarseLevel
)
==
matrix_
.
cols
());
assert
(
t
.
getFunctionSpace
().
size
()
==
matrix_
.
rows
());
assert
(
f
.
getFunctionSpace
().
size
()
==
matrix_
.
cols
());
typedef
typename
DiscFuncType
::
DofIteratorType
DofIteratorType
;
typedef
typename
SparseRowMatrix
<
double
>::
ColumnIterator
ColumnIterator
;
DofIteratorType
tIt
=
t
.
dbegin
(
fineLevel
);
DofIteratorType
fIt
=
f
.
dbegin
(
coarseLevel
);
DofIteratorType
tIt
=
t
.
dbegin
();
DofIteratorType
fIt
=
f
.
dbegin
();
for
(
int
row
=
0
;
row
<
matrix_
.
rows
();
row
++
)
{
...
...
@@ -121,16 +122,16 @@ void Dune::MGTransfer<DiscFuncType>::prolong(const DiscFuncType& f, DiscFuncType
template
<
class
DiscFuncType
>
void
Dune
::
MGTransfer
<
DiscFuncType
>::
restrict
(
const
DiscFuncType
&
f
,
DiscFuncType
&
t
)
const
{
assert
(
f
.
getFunctionSpace
().
size
(
fineLevel
)
==
matrix_
.
rows
());
assert
(
t
.
getFunctionSpace
().
size
(
coarseLevel
)
==
matrix_
.
cols
());
assert
(
f
.
getFunctionSpace
().
size
()
==
matrix_
.
rows
());
assert
(
t
.
getFunctionSpace
().
size
()
==
matrix_
.
cols
());
typedef
typename
DiscFuncType
::
DofIteratorType
DofIteratorType
;
typedef
typename
SparseRowMatrix
<
double
>::
ColumnIterator
ColumnIterator
;
t
.
clear
Level
(
coarseLevel
);
t
.
clear
(
);
DofIteratorType
tIt
=
t
.
dbegin
(
coarseLevel
);
DofIteratorType
fIt
=
f
.
dbegin
(
fineLevel
);
DofIteratorType
tIt
=
t
.
dbegin
();
DofIteratorType
fIt
=
f
.
dbegin
();
for
(
int
row
=
0
;
row
<
matrix_
.
rows
();
row
++
)
{
...
...
This diff is collapsed.
Click to expand it.
fem/transfer/mgtransfer.hh
+
5
−
6
View file @
d113416e
// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
// vi: set et ts=4 sw=2 sts=2:
#ifndef
__
DUNE_MG_TRANSFER_HH
__
#define
__
DUNE_MG_TRANSFER_HH_
_
#ifndef DUNE_MG_TRANSFER_HH
#define DUNE_MG_TRANSFER_HH_
#include
<dune/fem/feop/spmatrix.hh>
...
...
@@ -14,17 +14,16 @@ namespace Dune {
template
<
class
DiscFuncType
>
class
MGTransfer
{
typedef
typename
DiscFuncType
::
FunctionSpaceType
FunctionSpaceType
;
//
typedef typename DiscFuncType::FunctionSpaceType FunctionSpaceType;
public:
/** \brief Sets up the operator between levels cL and fL
*
* \param fS The function space hierarchy between levels of which we're mapping
* \param cL The coarse level
* \param fL The fine level
*/
void
setup
(
const
FunctionSpaceType
&
fS
,
int
cL
,
int
fL
);
template
<
class
FunctionSpaceType
>
void
setup
(
const
FunctionSpaceType
&
cS
,
const
FunctionSpaceType
&
fS
);
/** \brief Restrict level fL of f and store the result in level cL of t
*/
...
...
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