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
abaef92c
Commit
abaef92c
authored
19 years ago
by
Robert Klöfkorn
Browse files
Options
Downloads
Patches
Plain Diff
some asserts and minor face lifts.
[[Imported from SVN: r3162]]
parent
bd484126
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
grid/albertagrid/agrid.hh
+6
-17
6 additions, 17 deletions
grid/albertagrid/agrid.hh
grid/albertagrid/albertagrid.cc
+36
-7
36 additions, 7 deletions
grid/albertagrid/albertagrid.cc
with
42 additions
and
24 deletions
grid/albertagrid/agrid.hh
+
6
−
17
View file @
abaef92c
...
...
@@ -1550,27 +1550,16 @@ namespace Dune
const
HierarchicIndexSet
&
hierarchicIndexSet
()
const
{
return
hIndexSet_
;
}
//! return level index set for given level
const
typename
Traits
::
LevelIndexSet
&
levelIndexSet
(
int
level
=
0
)
const
{
if
(
!
levelIndexVec_
[
level
])
levelIndexVec_
[
level
]
=
new
LevelIndexSetImp
(
*
this
,
level
);
return
*
(
levelIndexVec_
[
level
]);
}
const
typename
Traits
::
LevelIndexSet
&
levelIndexSet
(
int
level
)
const
;
//! return leaf index set
const
typename
Traits
::
LeafIndexSet
&
leafIndexSet
()
const
{
if
(
!
leafIndexSet_
)
leafIndexSet_
=
new
LeafIndexSet
(
*
this
);
return
*
leafIndexSet_
;
}
const
typename
Traits
::
LeafIndexSet
&
leafIndexSet
()
const
;
//! return global IdSet
const
GlobalIdSet
&
globalIdSet
()
const
{
return
globalIdSet_
;
}
const
GlobalIdSet
&
globalIdSet
()
const
{
return
globalIdSet_
;
}
//! return local IdSet
const
LocalIdSet
&
localIdSet
()
const
{
return
globalIdSet_
;
}
const
LocalIdSet
&
localIdSet
()
const
{
return
globalIdSet_
;
}
//! access to mesh pointer, needed by some methods
ALBERTA
MESH
*
getMesh
()
const
{
return
mesh_
;
};
...
...
@@ -1781,10 +1770,10 @@ namespace Dune
//********************************************************************
// set owner of element, for partioning
bool
setOwner
(
ALBERTA
EL
*
el
,
int
proc
);
bool
setOwner
(
const
ALBERTA
EL
*
el
,
int
proc
);
// return the processor number of element
int
getOwner
(
ALBERTA
EL
*
el
)
const
;
int
getOwner
(
const
ALBERTA
EL
*
el
)
const
;
// PartitionType (InteriorEntity , BorderEntity, GhostEntity )
PartitionType
partitionType
(
ALBERTA
EL_INFO
*
elinfo
)
const
;
...
...
This diff is collapsed.
Click to expand it.
grid/albertagrid/albertagrid.cc
+
36
−
7
View file @
abaef92c
...
...
@@ -1678,7 +1678,8 @@ namespace Dune
template
<
class
GridImp
>
inline
bool
AlbertaGridIntersectionIterator
<
GridImp
>::
neighbor
()
const
{
return
(
elInfo_
->
neigh
[
neighborCount_
]
!=
0
);
// use ALBERTA macro to get neighbour
return
(
NEIGH
(
elInfo_
->
el
,
elInfo_
)[
neighborCount_
]
!=
0
);
}
template
<
class
GridImp
>
...
...
@@ -1837,7 +1838,8 @@ namespace Dune
assert
(
neighborCount_
<
dim
+
1
);
// set the neighbor element as element
neighElInfo_
->
el
=
elInfo_
->
neigh
[
neighborCount_
];
// use ALBERTA macro to get neighbour
neighElInfo_
->
el
=
NEIGH
(
elInfo_
->
el
,
elInfo_
)[
neighborCount_
];
#if DIM==3
neighElInfo_
->
orientation
=
elInfo_
->
orientation
;
#endif
...
...
@@ -2107,7 +2109,8 @@ namespace Dune
// check elInfo pointer before we start anything
assert
(
elInfo
);
const
ALBERTA
EL
*
neighbour
=
(
elInfo
->
neigh
[
face_
]);
// get neighbour of this element
const
ALBERTA
EL
*
neighbour
=
NEIGH
(
elInfo
->
el
,
elInfo
)[
face_
];
if
(
neighbour
)
{
// get element
...
...
@@ -2325,7 +2328,7 @@ namespace Dune
// here we have the interior element, now check the neighbours
for
(
int
i
=
0
;
i
<
dim
+
1
;
i
++
)
{
ALBERTA
EL
*
neigh
=
NEIGH
(
elinfo
->
el
,
elinfo
)[
i
];
const
ALBERTA
EL
*
neigh
=
NEIGH
(
elinfo
->
el
,
elinfo
)[
i
];
if
(
neigh
)
{
if
(
this
->
grid_
.
getOwner
(
neigh
)
==
this
->
grid_
.
myRank
())
...
...
@@ -3249,6 +3252,9 @@ namespace Dune
inline
bool
AlbertaGrid
<
dim
,
dimworld
>::
globalRefine
(
int
refCount
)
{
// only MAXL level allowed
assert
(
(
refCount
+
maxlevel_
)
<
MAXL
);
typedef
LeafIterator
LeafIt
;
LeafIt
endit
=
this
->
leafend
(
this
->
maxLevel
());
...
...
@@ -3298,7 +3304,7 @@ namespace Dune
}
template
<
int
dim
,
int
dimworld
>
inline
int
AlbertaGrid
<
dim
,
dimworld
>::
getOwner
(
ALBERTA
EL
*
el
)
const
inline
int
AlbertaGrid
<
dim
,
dimworld
>::
getOwner
(
const
ALBERTA
EL
*
el
)
const
{
// if element is new then entry in dofVec is 1
return
ownerVec_
[
el
->
dof
[
dof_
][
nv_
]];
...
...
@@ -3706,7 +3712,7 @@ namespace Dune
}
template
<
int
dim
,
int
dimworld
>
inline
bool
AlbertaGrid
<
dim
,
dimworld
>::
setOwner
(
ALBERTA
EL
*
el
,
int
proc
)
inline
bool
AlbertaGrid
<
dim
,
dimworld
>::
setOwner
(
const
ALBERTA
EL
*
el
,
int
proc
)
{
// if element is new then entry in dofVec is 1
int
dof
=
el
->
dof
[
dof_
][
nv_
];
...
...
@@ -3729,7 +3735,7 @@ namespace Dune
{
for
(
int
i
=
0
;
i
<
dim
+
1
;
i
++
)
{
ALBERTA
EL
*
neigh
=
NEIGH
(
elinfo
->
el
,
elinfo
)[
i
];
const
ALBERTA
EL
*
neigh
=
NEIGH
(
elinfo
->
el
,
elinfo
)[
i
];
if
(
neigh
)
{
if
(
getOwner
(
neigh
)
!=
myRank
())
...
...
@@ -3792,6 +3798,27 @@ namespace Dune
return
this
->
leafIndexSet
().
size
(
codim
,
simplex
);
}
template
<
int
dim
,
int
dimworld
>
inline
const
typename
AlbertaGrid
<
dim
,
dimworld
>
::
Traits
::
LevelIndexSet
&
AlbertaGrid
<
dim
,
dimworld
>
::
levelIndexSet
(
int
level
)
const
{
// assert that given level is in range
assert
(
level
>=
0
);
assert
(
level
<
(
int
)
levelIndexVec_
.
size
()
);
if
(
!
levelIndexVec_
[
level
])
levelIndexVec_
[
level
]
=
new
LevelIndexSetImp
(
*
this
,
level
);
return
*
(
levelIndexVec_
[
level
]);
}
template
<
int
dim
,
int
dimworld
>
inline
const
typename
AlbertaGrid
<
dim
,
dimworld
>
::
Traits
::
LeafIndexSet
&
AlbertaGrid
<
dim
,
dimworld
>
::
leafIndexSet
()
const
{
if
(
!
leafIndexSet_
)
leafIndexSet_
=
new
LeafIndexSet
(
*
this
);
return
*
leafIndexSet_
;
}
template
<
int
dim
,
int
dimworld
>
inline
void
AlbertaGrid
<
dim
,
dimworld
>::
arrangeDofVec
()
{
...
...
@@ -3852,6 +3879,8 @@ namespace Dune
// determine new maxlevel
maxlevel_
=
ALBERTA
AlbertHelp
::
calcMaxAbsoluteValueOfVector
(
dofvecs_
.
elNewCheck
);
assert
(
maxlevel_
>=
0
);
assert
(
maxlevel_
<
MAXL
);
#ifndef NDEBUG
int
mlvl
=
ALBERTA
AlbertHelp
::
calcMaxLevel
(
mesh_
);
assert
(
mlvl
==
maxlevel_
);
...
...
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