Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
dumux-repositories
dumux
Commits
2e066879
Commit
2e066879
authored
7 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[test][box] Make FVGridGeometry test independent of TypeTag
parent
a87d46de
No related branches found
No related tags found
1 merge request
!742
Make FVGridGeometry independent of TypeTag
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/discretization/box/CMakeLists.txt
+1
-1
1 addition, 1 deletion
test/discretization/box/CMakeLists.txt
test/discretization/box/test_boxfvgeometry.cc
+18
-28
18 additions, 28 deletions
test/discretization/box/test_boxfvgeometry.cc
with
19 additions
and
29 deletions
test/discretization/box/CMakeLists.txt
+
1
−
1
View file @
2e066879
dune_add_test
(
NAME test_boxfvgeometry
SOURCES test_boxfvgeometry.cc
COMPILE_DEFINITIONS ENABLE_CACHING=false
)
COMPILE_DEFINITIONS ENABLE_CACHING=false
)
dune_add_test
(
NAME test_boxfvgeometry_caching
SOURCES test_boxfvgeometry.cc
...
...
This diff is collapsed.
Click to expand it.
test/discretization/box/test_boxfvgeometry.cc
+
18
−
28
View file @
2e066879
...
...
@@ -27,54 +27,44 @@
#include
<utility>
#include
<dune/common/test/iteratortest.hh>
#include
<dune/common/fvector.hh>
#include
<dune/grid/utility/structuredgridfactory.hh>
#include
<dune/grid/yaspgrid.hh>
#include
<dune/grid/common/mcmgmapper.hh>
#include
<dumux/common/properties.hh>
#include
<dumux/discretization/box/properties.hh>
namespace
Dumux
{
namespace
Properties
{
NEW_TYPE_TAG
(
TestBoxFVGeometry
,
INHERITS_FROM
(
BoxModel
));
SET_TYPE_PROP
(
TestBoxFVGeometry
,
Scalar
,
double
);
SET_TYPE_PROP
(
TestBoxFVGeometry
,
Grid
,
Dune
::
YaspGrid
<
3
>
);
SET_BOOL_PROP
(
TestBoxFVGeometry
,
EnableFVGridGeometryCache
,
ENABLE_CACHING
);
}
}
#include
<dumux/discretization/box/fvgridgeometry.hh>
#ifndef DOXYGEN
namespace
Dumux
{
namespace
Detail
{
template
<
class
T
>
class
NoopFunctor
{
public:
NoopFunctor
()
{}
void
operator
()(
const
T
&
t
){}
};
}
// end namespace Detail
}
// end namespace Dumux
#endif
int
main
(
int
argc
,
char
*
argv
[])
try
{
using
namespace
Dumux
;
// maybe initialize mpi
Dune
::
MPIHelper
::
instance
(
argc
,
argv
);
std
::
cout
<<
"Checking the FVGeometries, SCVs and SCV faces"
<<
std
::
endl
;
// aliases
using
TypeTag
=
TTAG
(
TestBoxFVGeometry
);
using
Grid
=
typename
GET_PROP_TYPE
(
TypeTag
,
Grid
);
using
GridView
=
typename
Grid
::
LeafGridView
;
using
Grid
=
Dune
::
YaspGrid
<
3
>
;
constexpr
int
dim
=
Grid
View
::
dimension
;
constexpr
int
dimworld
=
Grid
View
::
dimensionworld
;
constexpr
int
dim
=
Grid
::
dimension
;
constexpr
int
dimworld
=
Grid
::
dimensionworld
;
using
GlobalPosition
=
Dune
::
FieldVector
<
typename
GridView
::
ctype
,
dimworld
>
;
using
FVElementGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
LocalView
;
using
GlobalPosition
=
Dune
::
FieldVector
<
typename
Grid
::
ctype
,
dimworld
>
;
using
FVGridGeometry
=
BoxFVGridGeometry
<
double
,
typename
Grid
::
LeafGridView
,
ENABLE_CACHING
>
;
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
SubControlVolumeFace
=
typename
FVElementGeometry
::
SubControlVolumeFace
;
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
// make a grid
GlobalPosition
lower
(
0.0
);
...
...
@@ -95,7 +85,7 @@ int main (int argc, char *argv[]) try
fvGeometry
.
bind
(
element
);
auto
range
=
scvs
(
fvGeometry
);
NoopFunctor
<
SubControlVolume
>
op
;
Detail
::
NoopFunctor
<
SubControlVolume
>
op
;
if
(
0
!=
testForwardIterator
(
range
.
begin
(),
range
.
end
(),
op
))
DUNE_THROW
(
Dune
::
Exception
,
"Iterator does not fulfill the forward iterator concept"
);
...
...
@@ -105,7 +95,7 @@ int main (int argc, char *argv[]) try
}
auto
range2
=
scvfs
(
fvGeometry
);
NoopFunctor
<
SubControlVolumeFace
>
op2
;
Detail
::
NoopFunctor
<
SubControlVolumeFace
>
op2
;
if
(
0
!=
testForwardIterator
(
range2
.
begin
(),
range2
.
end
(),
op2
))
DUNE_THROW
(
Dune
::
Exception
,
"Iterator does not fulfill the forward iterator concept"
);
...
...
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