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
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
Timo Koch
dune-common
Commits
4a94ac1a
Commit
4a94ac1a
authored
19 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
bugfix for the levelIndexSet
[[Imported from SVN: r2453]]
parent
bfad9e46
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
grid/uggrid/uggrid.cc
+3
-1
3 additions, 1 deletion
grid/uggrid/uggrid.cc
grid/uggrid/uggridindexsets.hh
+20
-14
20 additions, 14 deletions
grid/uggrid/uggridindexsets.hh
with
23 additions
and
15 deletions
grid/uggrid/uggrid.cc
+
3
−
1
View file @
4a94ac1a
...
...
@@ -947,8 +947,10 @@ void Dune::UGGrid < dim, dimworld >::createend()
template
<
int
dim
,
int
dimworld
>
void
Dune
::
UGGrid
<
dim
,
dimworld
>::
setIndices
()
{
levelIndexSets_
.
resize
(
maxlevel
()
+
1
);
for
(
int
i
=
0
;
i
<=
maxlevel
();
i
++
)
levelIndexSets_
[
i
].
update
();
levelIndexSets_
[
i
].
update
(
*
this
,
i
);
leafIndexSet_
.
update
();
...
...
This diff is collapsed.
Click to expand it.
grid/uggrid/uggridindexsets.hh
+
20
−
14
View file @
4a94ac1a
...
...
@@ -15,28 +15,31 @@ namespace Dune {
class
UGGridLevelIndexSet
{
public:
//! constructor stores reference to a grid and level
UGGridLevelIndexSet
(
const
GridImp
&
g
,
int
l
)
:
grid_
(
g
),
level_
(
l
)
{}
/** \brief Default constructor
Unfortunately we can't force the user to init grid_ and level_, because
UGGridLevelIndexSets are meant to be stored in an array.
*/
UGGridLevelIndexSet
()
{}
//! get index of an entity
template
<
int
cd
>
int
index
(
const
typename
GridImp
::
Traits
::
template
Codim
<
cd
>
::
Entity
&
e
)
const
{
return
grid_
.
template
getRealEntity
<
cd
>(
e
).
levelIndex
();
return
grid_
->
template
getRealEntity
<
cd
>(
e
).
levelIndex
();
}
//! get index of subentity of a codim 0 entity
template
<
int
cc
>
int
subindex
(
const
typename
GridImp
::
Traits
::
template
Codim
<
0
>
::
Entity
&
e
,
int
i
)
const
{
return
grid_
.
template
getRealEntity
<
0
>(
e
).
template
subIndex
<
cc
>(
i
);
return
grid_
->
template
getRealEntity
<
0
>(
e
).
template
subIndex
<
cc
>(
i
);
}
//! get number of entities of given codim, type and on this level
int
size
(
int
codim
,
GeometryType
type
)
const
{
return
grid_
.
size
(
level_
,
codim
,
type
);
return
grid_
->
size
(
level_
,
codim
,
type
);
}
/** \brief Deliver all geometry types used in this grid */
...
...
@@ -46,27 +49,30 @@ namespace Dune {
}
/** \todo Should be private */
void
update
()
{
void
update
(
const
GridImp
&
grid
,
int
level
)
{
grid_
=
&
grid
;
level_
=
level
;
const
int
dim
=
GridImp
::
dimension
;
typename
GridImp
::
Traits
::
template
Codim
<
0
>
::
LevelIterator
eIt
=
grid_
.
template
lbegin
<
0
>(
level_
);
typename
GridImp
::
Traits
::
template
Codim
<
0
>
::
LevelIterator
eEndIt
=
grid_
.
template
lend
<
0
>(
level_
);
typename
GridImp
::
Traits
::
template
Codim
<
0
>
::
LevelIterator
eIt
=
grid_
->
template
lbegin
<
0
>(
level_
);
typename
GridImp
::
Traits
::
template
Codim
<
0
>
::
LevelIterator
eEndIt
=
grid_
->
template
lend
<
0
>(
level_
);
int
id
=
0
;
for
(;
eIt
!=
eEndIt
;
++
eIt
)
UG_NS
<
dim
>::
levelIndex
(
grid_
.
template
getRealEntity
<
0
>(
*
eIt
).
target_
)
=
id
++
;
UG_NS
<
dim
>::
levelIndex
(
grid_
->
template
getRealEntity
<
0
>(
*
eIt
).
target_
)
=
id
++
;
typename
GridImp
::
Traits
::
template
Codim
<
dim
>
::
LevelIterator
vIt
=
grid_
.
template
lbegin
<
dim
>(
level_
);
typename
GridImp
::
Traits
::
template
Codim
<
dim
>
::
LevelIterator
vEndIt
=
grid_
.
template
lend
<
dim
>(
level_
);
typename
GridImp
::
Traits
::
template
Codim
<
dim
>
::
LevelIterator
vIt
=
grid_
->
template
lbegin
<
dim
>(
level_
);
typename
GridImp
::
Traits
::
template
Codim
<
dim
>
::
LevelIterator
vEndIt
=
grid_
->
template
lend
<
dim
>(
level_
);
id
=
0
;
for
(;
vIt
!=
vEndIt
;
++
vIt
)
UG_NS
<
dim
>::
levelIndex
(
grid_
.
template
getRealEntity
<
dim
>(
*
vIt
).
target_
)
=
id
++
;
UG_NS
<
dim
>::
levelIndex
(
grid_
->
template
getRealEntity
<
dim
>(
*
vIt
).
target_
)
=
id
++
;
}
private
:
const
GridImp
&
grid_
;
const
GridImp
*
grid_
;
int
level_
;
std
::
vector
<
GeometryType
>
myTypes_
;
};
...
...
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