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
e3e74253
Commit
e3e74253
authored
20 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
improved gridcheck to check the new entitypointer class
[[Imported from SVN: r1797]]
parent
ee910f28
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/test/Makefile.am
+4
-1
4 additions, 1 deletion
grid/test/Makefile.am
grid/test/gridcheck.cc
+62
-1
62 additions, 1 deletion
grid/test/gridcheck.cc
with
66 additions
and
2 deletions
grid/test/Makefile.am
+
4
−
1
View file @
e3e74253
...
...
@@ -47,8 +47,11 @@ check_PROGRAMS = $(NORMALTESTS) $(YPROG)
# library-parts explicitly
LDFLAGS
=
$(
top_builddir
)
/common/libcommon.la
# paranoia
DUNE_EXTRA_CHECKS
=
-DDUNE__ISTL_WITH_CHECKING
-DDUNE_DEVEL_MODE
# output coverage
AM_CXXFLAGS
=
-fprofile-arcs
-ftest-coverage
COVERAGE
=
-fprofile-arcs
-ftest-coverage
AM_CXXFLAGS
=
$(
COVERAGE
)
$(
DUNE_EXTRA_CHECKS
)
#
## define the programs
...
...
This diff is collapsed.
Click to expand it.
grid/test/gridcheck.cc
+
62
−
1
View file @
e3e74253
...
...
@@ -499,7 +499,8 @@ void assertNeighbor (Grid &g)
assert
(
it
->
index
()
>=
0
);
LevelIterator
n
=
g
.
template
lbegin
<
0
>(
it
->
level
());
LevelIterator
nend
=
g
.
template
lend
<
0
>(
it
->
level
());
while
(
n
->
index
()
!=
it
->
index
()
&&
n
!=
nend
)
++
n
;
// while (n->index() != it->index()&& n != nend) ++n;
while
(
n
!=
it
&&
n
!=
nend
)
++
n
;
}
}
}
...
...
@@ -508,11 +509,26 @@ void assertNeighbor (Grid &g)
/*
* Iterate over the grid und do some runtime checks
*/
template
<
class
Grid
,
class
It
>
struct
_callMark
{
static
void
mark
(
Grid
&
g
,
It
it
)
{
g
.
mark
(
1
,
it
);
};
};
template
<
class
Grid
,
class
It
>
struct
_callMark
<
const
Grid
,
It
>
{
static
void
mark
(
const
Grid
&
g
,
It
it
)
{
};
};
template
<
class
Grid
,
class
It
>
void
callMark
(
Grid
&
g
,
It
it
)
{
_callMark
<
Grid
,
It
>::
mark
(
g
,
it
);
}
template
<
class
Grid
>
void
iterate
(
Grid
&
g
)
{
typedef
typename
Grid
::
template
codim
<
0
>
::
LevelIterator
LevelIterator
;
typedef
typename
Grid
::
template
codim
<
0
>
::
EntityPointer
EntityPointer
;
typedef
typename
Grid
::
template
codim
<
0
>
::
HierarchicIterator
HierarchicIterator
;
typedef
typename
Grid
::
template
codim
<
0
>
::
Geometry
Geometry
;
LevelIterator
it
=
g
.
template
lbegin
<
0
>(
0
);
const
LevelIterator
endit
=
g
.
template
lend
<
0
>(
0
);
...
...
@@ -536,7 +552,17 @@ void iterate(Grid &g)
it
->
geometry
().
type
();
it
->
geometry
().
corners
();
it
->
geometry
()[
0
];
#warning refelem is deprecated
#if 0
it->geometry().refelem();
#endif
callMark
(
g
,
it
);
EntityPointer
ept
=
it
;
callMark
(
g
,
ept
);
HierarchicIterator
hit
=
ept
->
hbegin
(
99
);
HierarchicIterator
hend
=
ept
->
hend
(
99
);
if
(
hit
!=
hend
)
callMark
(
g
,
hit
);
}
typedef
typename
Grid
::
template
codim
<
0
>
::
LeafIterator
LeafIterator
;
...
...
@@ -563,6 +589,39 @@ void iterate(Grid &g)
};
template
<
class
Grid
>
void
iteratorEquals
(
Grid
&
g
)
{
typedef
typename
Grid
::
template
codim
<
0
>
::
LevelIterator
LevelIterator
;
typedef
typename
Grid
::
template
codim
<
0
>
::
LeafIterator
LeafIterator
;
typedef
typename
Grid
::
template
codim
<
0
>
::
HierarchicIterator
HierarchicIterator
;
typedef
typename
Grid
::
template
codim
<
0
>
::
IntersectionIterator
IntersectionIterator
;
typedef
typename
Grid
::
template
codim
<
0
>
::
EntityPointer
EntityPointer
;
LevelIterator
l1
=
g
.
template
lbegin
<
0
>(
0
);
LevelIterator
l2
=
g
.
template
lbegin
<
0
>(
0
);
LeafIterator
L1
=
g
.
leafbegin
(
99
);
LeafIterator
L2
=
g
.
leafbegin
(
99
);
HierarchicIterator
h1
=
l1
->
hbegin
(
99
);
HierarchicIterator
h2
=
l2
->
hbegin
(
99
);
IntersectionIterator
i1
=
l1
->
ibegin
();
IntersectionIterator
i2
=
l2
->
ibegin
();
EntityPointer
e1
=
l1
;
EntityPointer
e2
=
h2
;
l1
==
l2
;
i1
==
i2
;
L1
==
L2
;
h1
==
h2
;
e1
==
e2
;
e1
==
l2
;
e2
==
h2
;
e1
==
L1
;
l2
==
e1
;
l2
==
L2
;
i1
==
h2
;
}
template
<
class
Grid
>
void
gridcheck
(
Grid
&
g
)
{
...
...
@@ -576,6 +635,8 @@ void gridcheck (Grid &g)
* now the runtime-tests
*/
const
Grid
&
cg
=
g
;
iteratorEquals
(
g
);
iteratorEquals
(
cg
);
iterate
(
g
);
iterate
(
cg
);
zeroEntityConsistency
(
g
);
...
...
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