Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
614da570
Commit
614da570
authored
Apr 07, 2021
by
Timo Koch
Committed by
Dennis Gläser
Apr 07, 2021
Browse files
[test] Add test with nonoverlapping grid manager that cannot communicate
parent
82abd943
Changes
3
Hide whitespace changes
Inline
Side-by-side
test/porousmediumflow/1p/incompressible/CMakeLists.txt
View file @
614da570
...
...
@@ -145,3 +145,11 @@ dumux_add_test(NAME test_1p_incompressible_mpfa_extrude_distorted
-Problem.CheckIsConstantVelocity true
-Problem.EnableGravity false
-Grid.File ./grids/randomlydistorted.dgf
)
# check grids without communicate method (using box and numeric differentiation)
dumux_add_test
(
NAME test_1p_incompressible_box_numdiff_no_communicate
LABELS porousmediumflow 1p
SOURCES main.cc
COMPILE_DEFINITIONS TYPETAG=OnePIncompressibleBox NUMDIFFMETHOD=DiffMethod::numeric GRIDTYPE=Dumux::NoCommunicateGrid<2>
COMMAND ./test_1p_incompressible_box_numdiff_no_communicate
CMD_ARGS -Grid.Overlap 0
)
test/porousmediumflow/1p/incompressible/main.cc
View file @
614da570
...
...
@@ -149,6 +149,9 @@ int main(int argc, char** argv)
// output result to vtk
vtkWriter
.
write
(
1.0
);
// output residual norm (test assembler interface)
std
::
cout
<<
"Residual norm: "
<<
assembler
->
residualNorm
(
x
)
<<
std
::
endl
;
timer
.
stop
();
const
bool
checkIsConstantVelocity
=
getParam
<
bool
>
(
"Problem.CheckIsConstantVelocity"
,
false
);
...
...
test/porousmediumflow/1p/incompressible/properties.hh
View file @
614da570
...
...
@@ -50,6 +50,67 @@
#define GRIDTYPE Dune::YaspGrid<2>
#endif
////////////////////////////////////////////////////
// A fake grid that cannot communicate. //
// Can be used to make sure that compilation and //
// sequential execution also work for such grids. //
////////////////////////////////////////////////////
namespace
Dumux
{
template
<
int
dim
>
class
NoCommunicateGrid
;
template
<
int
dim
>
class
NoCommunicateGridLeafGridView
:
public
Dune
::
YaspGrid
<
dim
>::
LeafGridView
{
using
ParentType
=
typename
Dune
::
YaspGrid
<
dim
>::
LeafGridView
;
public:
using
ParentType
::
ParentType
;
struct
Traits
:
public
ParentType
::
Traits
{
using
Grid
=
NoCommunicateGrid
<
dim
>
;
};
};
template
<
int
dim
>
class
NoCommunicateGrid
:
public
Dune
::
YaspGrid
<
dim
>
{
using
ParentType
=
Dune
::
YaspGrid
<
dim
>
;
public:
using
ParentType
::
ParentType
;
struct
Traits
:
public
ParentType
::
Traits
{
using
LeafGridView
=
NoCommunicateGridLeafGridView
<
dim
>
;
};
using
LeafGridView
=
NoCommunicateGridLeafGridView
<
dim
>
;
typename
Traits
::
LeafGridView
leafGridView
()
const
{
return
NoCommunicateGridLeafGridView
<
dim
>
(
*
this
);
}
private:
using
ParentType
::
communicate
;
using
ParentType
::
communicateCodim
;
};
template
<
int
dim
>
class
GridManager
<
NoCommunicateGrid
<
dim
>>
:
public
GridManager
<
Dune
::
YaspGrid
<
dim
>>
{
using
ParentType
=
GridManager
<
Dune
::
YaspGrid
<
dim
>>
;
public:
using
ParentType
::
ParentType
;
using
Grid
=
NoCommunicateGrid
<
dim
>
;
Grid
&
grid
()
{
return
static_cast
<
NoCommunicateGrid
<
dim
>&>
(
ParentType
::
grid
());
}
};
}
// end namespace Dumux
namespace
Dune
::
Capabilities
{
template
<
int
dim
,
int
codim
>
struct
canCommunicate
<
Dumux
::
NoCommunicateGrid
<
dim
>
,
codim
>
{
static
constexpr
bool
v
=
false
;
};
}
// end namespace Dune::Capabilities
/////////////////////////////////////////
namespace
Dumux
::
Properties
{
// Create new type tags
namespace
TTag
{
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment