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
7550844d
Commit
7550844d
authored
7 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[test][box] Fix fvgeometry test
parent
61807f1d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!617
[WIP] Next
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/discretization/box/CMakeLists.txt
+6
-2
6 additions, 2 deletions
test/discretization/box/CMakeLists.txt
test/discretization/box/test_boxfvgeometry.cc
+7
-37
7 additions, 37 deletions
test/discretization/box/test_boxfvgeometry.cc
with
13 additions
and
39 deletions
test/discretization/box/CMakeLists.txt
+
6
−
2
View file @
7550844d
add_dumux_test
(
test_boxfvgeometry test_boxfvgeometry test_boxfvgeometry.cc
${
CMAKE_CURRENT_BINARY_DIR
}
/test_boxfvgeometry
)
dune_add_test
(
SOURCES test_boxfvgeometry.cc
)
#install sources
install
(
FILES
test_boxfvgeometry.cc
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/dumux/test/discretization/box
)
This diff is collapsed.
Click to expand it.
test/discretization/box/test_boxfvgeometry.cc
+
7
−
37
View file @
7550844d
...
...
@@ -31,44 +31,17 @@
#include
<dune/grid/yaspgrid.hh>
#include
<dune/grid/common/mcmgmapper.hh>
#include
<dumux/implicit/box/properties.hh>
#include
<dumux/common/basicproperties.hh>
#include
<dumux/discretization/box/properties.hh>
namespace
Dumux
{
template
<
class
TypeTag
>
class
MockProblem
{
using
ElementMapper
=
typename
GET_PROP_TYPE
(
TypeTag
,
ElementMapper
);
using
VertexMapper
=
typename
GET_PROP_TYPE
(
TypeTag
,
VertexMapper
);
using
GridView
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridView
);
public:
MockProblem
(
const
GridView
&
gridView
)
:
elementMapper_
(
gridView
),
vertexMapper_
(
gridView
)
{}
const
ElementMapper
&
elementMapper
()
const
{
return
elementMapper_
;
}
const
VertexMapper
&
vertexMapper
()
const
{
return
vertexMapper_
;
}
template
<
class
Element
,
class
Intersection
>
bool
isInteriorBoundary
(
const
Element
&
e
,
const
Intersection
&
i
)
const
{
return
false
;
}
std
::
vector
<
unsigned
int
>
getAdditionalDofDependencies
(
unsigned
int
index
)
const
{
return
std
::
vector
<
unsigned
int
>
();
}
private
:
ElementMapper
elementMapper_
;
VertexMapper
vertexMapper_
;
};
namespace
Properties
{
NEW_TYPE_TAG
(
TestFVGeometry
,
INHERITS_FROM
(
BoxModel
));
NEW_TYPE_TAG
(
TestFVGeometry
,
INHERITS_FROM
(
BoxModel
,
NumericModel
));
SET_TYPE_PROP
(
TestFVGeometry
,
Grid
,
Dune
::
YaspGrid
<
3
>
);
SET_TYPE_PROP
(
TestFVGeometry
,
Problem
,
Dumux
::
MockProblem
<
TypeTag
>
);
}
}
...
...
@@ -100,7 +73,6 @@ int main (int argc, char *argv[]) try
using
SubControlVolume
=
typename
GET_PROP_TYPE
(
TypeTag
,
SubControlVolume
);
using
SubControlVolumeFace
=
typename
GET_PROP_TYPE
(
TypeTag
,
SubControlVolumeFace
);
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
);
// make a grid
GlobalPosition
lower
(
0.0
);
...
...
@@ -109,17 +81,15 @@ int main (int argc, char *argv[]) try
std
::
shared_ptr
<
Grid
>
grid
=
Dune
::
StructuredGridFactory
<
Grid
>::
createCubeGrid
(
lower
,
upper
,
els
);
auto
leafGridView
=
grid
->
leafGridView
();
Problem
problem
(
leafGridView
);
FVGridGeometry
global
(
leafGridView
);
global
.
update
(
problem
);
FVGridGeometry
fvGridGeometry
(
leafGridView
);
fvGridGeometry
.
update
();
// iterate over elements. For every element get fv geometry and loop over scvs and scvfaces
for
(
const
auto
&
element
:
elements
(
leafGridView
))
{
auto
eIdx
=
problem
.
elementMapper
().
index
(
element
);
auto
eIdx
=
fvGridGeometry
.
elementMapper
().
index
(
element
);
std
::
cout
<<
std
::
endl
<<
"Checking fvGeometry of element "
<<
eIdx
<<
std
::
endl
;
auto
fvGeometry
=
localView
(
global
);
auto
fvGeometry
=
localView
(
fvGridGeometry
);
fvGeometry
.
bind
(
element
);
auto
range
=
scvs
(
fvGeometry
);
...
...
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