Skip to content
GitLab
Menu
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
5a326c86
Commit
5a326c86
authored
Jun 28, 2018
by
Kilian Weishaupt
Committed by
Timo Koch
Jun 28, 2018
Browse files
[test] Use new grid managers
parent
82be40dc
Changes
151
Hide whitespace changes
Inline
Side-by-side
dumux/common/start.hh
View file @
5a326c86
...
...
@@ -21,8 +21,8 @@
* \ingroup Common
* \brief Provides a few default main functions for convenience.
*/
#ifndef DUMUX_START_HH
#define DUMUX_START_HH
#ifndef DUMUX_
COMMON_
START_HH
#define DUMUX_
COMMON_
START_HH
#include
<ctime>
#include
<iostream>
...
...
@@ -34,6 +34,7 @@
#include
<dumux/common/parameters.hh>
#include
<dumux/common/dumuxmessage.hh>
#include
<dumux/common/defaultusagemessage.hh>
#include
<dumux/io/grid/gridmanager.hh>
#warning "start.hh is deprecated. Use new style main files see e.g. /test/porousmediumflow/1p."
...
...
@@ -64,7 +65,6 @@ int start_(int argc,
{
// some aliases for better readability
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
GridCreator
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridCreator
);
using
Problem
=
typename
GET_PROP_TYPE
(
TypeTag
,
Problem
);
using
TimeManager
=
typename
GET_PROP_TYPE
(
TypeTag
,
TimeManager
);
...
...
@@ -86,8 +86,8 @@ int start_(int argc,
// try to create a grid (from the given grid file or the input file)
/////////////////////////////////////////////////////////////////////
Grid
Creator
::
makeGrid
()
;
G
rid
Creator
::
loadBalance
();
Grid
Manager
<
typename
GET_PROP_TYPE
(
TypeTag
,
Grid
)
>
gridManager
;
g
rid
Manager
.
init
();
//////////////////////////////////////////////////////////////////////
// run the simulation
...
...
@@ -108,7 +108,7 @@ int start_(int argc,
// instantiate and run the problem
TimeManager
timeManager
;
Problem
problem
(
timeManager
,
G
rid
Creator
::
grid
());
Problem
problem
(
timeManager
,
g
rid
Manager
.
grid
());
timeManager
.
init
(
problem
,
restartTime
,
dt
,
tEnd
,
restart
);
timeManager
.
run
();
...
...
dumux/freeflow/compositional/CMakeLists.txt
View file @
5a326c86
...
...
@@ -3,6 +3,8 @@ add_subdirectory(staggered)
install
(
FILES
fluxvariables.hh
indices.hh
kepsilonncmodel.hh
komegancmodel.hh
localresidual.hh
lowrekepsilonncmodel.hh
navierstokesncmodel.hh
...
...
dumux/freeflow/rans/twoeq/komega/CMakeLists.txt
View file @
5a326c86
...
...
@@ -5,7 +5,6 @@ fluxvariables.hh
indices.hh
localresidual.hh
model.hh
models.hh
problem.hh
volumevariables.hh
vtkoutputfields.hh
...
...
dumux/io/CMakeLists.txt
View file @
5a326c86
add_subdirectory
(
grid
)
install
(
FILES
adaptivegridrestart.hh
cakegridcreator.hh
container.hh
cpgridcreator.hh
defaultvtkoutputfields.hh
gnuplotinterface.hh
gridcreator.hh
...
...
@@ -13,7 +13,6 @@ plotthermalconductivitymodel.hh
pointcloudvtkwriter.hh
restart.hh
staggeredvtkoutputmodule.hh
subgridgridcreator.hh
vtkfunction.hh
vtkmultiwriter.hh
vtknestedfunction.hh
...
...
dumux/io/grid/CMakeLists.txt
0 → 100644
View file @
5a326c86
install
(
FILES
cakegridcreator.hh
cpgridcreator.hh
gmshgriddatahandle.hh
griddata.hh
gridmanager.hh
subgridgridcreator.hh
DESTINATION
${
CMAKE_INSTALL_INCLUDEDIR
}
/dumux/io/grid
)
dumux/io/cakegridcreator.hh
→
dumux/io/
grid/
cakegridcreator.hh
View file @
5a326c86
...
...
@@ -58,7 +58,7 @@ public:
/*!
* \brief Make the grid.
*/
static
void
makeGrid
(
const
std
::
string
&
modelParamGroup
=
""
)
void
init
(
const
std
::
string
&
modelParamGroup
=
""
)
{
static_assert
(
dim
==
2
||
dim
==
3
,
"The CakeGridCreator is only implemented for 2D and 3D."
);
...
...
@@ -70,6 +70,7 @@ public:
createVectors
(
polarCoordinates
,
indices
,
modelParamGroup
,
verbose
);
gridPtr
()
=
createCakeGrid
(
polarCoordinates
,
indices
,
modelParamGroup
,
verbose
);
loadBalance
();
}
/*!
...
...
@@ -264,10 +265,10 @@ public:
* \param polarCoordinates Vector containing radial, angular and axial coordinates (in this order)
* \param indices Indices specifing the radial, angular and axial direction (in this order)
*/
st
atic
std
::
shared
_ptr
<
Grid
>
createCakeGrid
(
std
::
array
<
std
::
vector
<
Scalar
>
,
dim
>
&
polarCoordinates
,
Dune
::
FieldVector
<
int
,
dim
>
&
indices
,
const
std
::
string
&
modelParamGroup
,
bool
verbose
=
false
)
st
d
::
unique
_ptr
<
Grid
>
createCakeGrid
(
std
::
array
<
std
::
vector
<
Scalar
>
,
dim
>
&
polarCoordinates
,
Dune
::
FieldVector
<
int
,
dim
>
&
indices
,
const
std
::
string
&
modelParamGroup
,
bool
verbose
=
false
)
{
std
::
vector
<
Scalar
>
dR
=
polarCoordinates
[
0
];
std
::
vector
<
Scalar
>
dA
=
polarCoordinates
[
1
];
...
...
@@ -446,14 +447,13 @@ public:
}
}
// return the grid pointer
return
std
::
shared_ptr
<
Grid
>
(
gridFactory
.
createGrid
());
return
std
::
unique_ptr
<
Grid
>
(
gridFactory
.
createGrid
());
}
/*!
* \brief Returns a reference to the grid.
*/
static
Grid
&
grid
()
Grid
&
grid
()
{
return
*
gridPtr
();
}
...
...
@@ -462,19 +462,23 @@ public:
* \brief Distributes the grid on all processes of a parallel
* computation.
*/
static
void
loadBalance
()
void
loadBalance
()
{
gridPtr
()
->
loadBalance
();
}
protected:
/*!
* \brief Returns a reference to the shared pointer to the grid.
*/
static
GridPointer
&
gridPtr
()
GridPointer
&
gridPtr
()
{
static
GridPointer
cakeGrid
;
return
cakeGrid
;
return
cakeGrid_
;
}
private:
GridPointer
cakeGrid_
;
};
}
// end namespace Dumux
...
...
dumux/io/cpgridcreator.hh
→
dumux/io/
grid/
cpgridcreator.hh
View file @
5a326c86
File moved
dumux/io/subgridgridcreator.hh
→
dumux/io/
grid/
subgridgridcreator.hh
View file @
5a326c86
File moved
test/freeflow/navierstokes/angelitestproblem.hh
View file @
5a326c86
...
...
@@ -24,6 +24,8 @@
#ifndef DUMUX_ANGELI_TEST_PROBLEM_HH
#define DUMUX_ANGELI_TEST_PROBLEM_HH
#include
<dune/grid/yaspgrid.hh>
#include
<dumux/material/fluidsystems/1pliquid.hh>
#include
<dumux/material/components/constant.hh>
...
...
test/freeflow/navierstokes/channeltestproblem.hh
View file @
5a326c86
...
...
@@ -24,6 +24,8 @@
#ifndef DUMUX_CHANNEL_TEST_PROBLEM_HH
#define DUMUX_CHANNEL_TEST_PROBLEM_HH
#include
<dune/grid/yaspgrid.hh>
#include
<dumux/material/fluidsystems/1pliquid.hh>
#include
<dumux/material/components/simpleh2o.hh>
#include
<dumux/material/components/constant.hh>
...
...
test/freeflow/navierstokes/closedsystemtestproblem.hh
View file @
5a326c86
...
...
@@ -24,6 +24,8 @@
#ifndef DUMUX_CLOSEDSYSTEM_TEST_PROBLEM_HH
#define DUMUX_CLOSEDSYSTEM_TEST_PROBLEM_HH
#include
<dune/grid/yaspgrid.hh>
#include
<dumux/material/fluidsystems/1pliquid.hh>
#include
<dumux/material/components/constant.hh>
...
...
test/freeflow/navierstokes/doneatestproblem.hh
View file @
5a326c86
...
...
@@ -24,6 +24,8 @@
#ifndef DUMUX_DONEA_TEST_PROBLEM_HH
#define DUMUX_DONEA_TEST_PROBLEM_HH
#include
<dune/grid/yaspgrid.hh>
#include
<dumux/material/fluidsystems/1pliquid.hh>
#include
<dumux/material/components/constant.hh>
...
...
test/freeflow/navierstokes/kovasznaytestproblem.hh
View file @
5a326c86
...
...
@@ -24,6 +24,8 @@
#ifndef DUMUX_KOVASZNAY_TEST_PROBLEM_HH
#define DUMUX_KOVASZNAY_TEST_PROBLEM_HH
#include
<dune/grid/yaspgrid.hh>
#include
<dumux/material/fluidsystems/1pliquid.hh>
#include
<dumux/material/components/constant.hh>
...
...
test/freeflow/navierstokes/navierstokesanalyticproblem.hh
View file @
5a326c86
...
...
@@ -26,6 +26,8 @@
#ifndef DUMUX_DONEA_TEST_PROBLEM_HH
#define DUMUX_DONEA_TEST_PROBLEM_HH
#include
<dune/grid/yaspgrid.hh>
#include
<dumux/material/components/constant.hh>
#include
<dumux/material/fluidsystems/1pliquid.hh>
...
...
test/freeflow/navierstokes/stokeschannel3dproblem.hh
View file @
5a326c86
...
...
@@ -28,6 +28,8 @@
#ifndef DUMUX_3D_CHANNEL_PROBLEM_HH
#define DUMUX_3D_CHANNEL_PROBLEM_HH
#include
<dune/grid/yaspgrid.hh>
#include
<dumux/material/fluidsystems/1pliquid.hh>
#include
<dumux/material/components/constant.hh>
...
...
test/freeflow/navierstokes/test_angeli.cc
View file @
5a326c86
...
...
@@ -50,6 +50,7 @@
#include
<dumux/discretization/methods.hh>
#include
<dumux/io/staggeredvtkoutputmodule.hh>
#include
<dumux/io/grid/gridmanager.hh>
/*!
* \brief Provides an interface for customizing error messages associated with
...
...
@@ -101,16 +102,15 @@ int main(int argc, char** argv) try
Parameters
::
init
(
argc
,
argv
,
usage
);
// try to create a grid (from the given grid file or the input file)
using
GridCreator
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridCreator
);
GridCreator
::
makeGrid
();
GridCreator
::
loadBalance
();
GridManager
<
typename
GET_PROP_TYPE
(
TypeTag
,
Grid
)
>
gridManager
;
gridManager
.
init
();
////////////////////////////////////////////////////////////
// run instationary non-linear problem on this grid
////////////////////////////////////////////////////////////
// we compute on the leaf grid view
const
auto
&
leafGridView
=
G
rid
Creator
::
grid
().
leafGridView
();
const
auto
&
leafGridView
=
g
rid
Manager
.
grid
().
leafGridView
();
// create the finite volume grid geometry
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
...
...
test/freeflow/navierstokes/test_channel.cc
View file @
5a326c86
...
...
@@ -49,6 +49,7 @@
#include
<dumux/discretization/methods.hh>
#include
<dumux/io/staggeredvtkoutputmodule.hh>
#include
<dumux/io/grid/gridmanager.hh>
#include
<dumux/freeflow/navierstokes/staggered/fluxoversurface.hh>
...
...
@@ -102,16 +103,15 @@ int main(int argc, char** argv) try
Parameters
::
init
(
argc
,
argv
,
usage
);
// try to create a grid (from the given grid file or the input file)
using
GridCreator
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridCreator
);
GridCreator
::
makeGrid
();
GridCreator
::
loadBalance
();
GridManager
<
typename
GET_PROP_TYPE
(
TypeTag
,
Grid
)
>
gridManager
;
gridManager
.
init
();
////////////////////////////////////////////////////////////
// run instationary non-linear problem on this grid
////////////////////////////////////////////////////////////
// we compute on the leaf grid view
const
auto
&
leafGridView
=
G
rid
Creator
::
grid
().
leafGridView
();
const
auto
&
leafGridView
=
g
rid
Manager
.
grid
().
leafGridView
();
// create the finite volume grid geometry
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
...
...
test/freeflow/navierstokes/test_closedsystem.cc
View file @
5a326c86
...
...
@@ -49,6 +49,7 @@
#include
<dumux/discretization/methods.hh>
#include
<dumux/io/staggeredvtkoutputmodule.hh>
#include
<dumux/io/grid/gridmanager.hh>
/*!
* \brief Provides an interface for customizing error messages associated with
...
...
@@ -100,16 +101,15 @@ int main(int argc, char** argv) try
Parameters
::
init
(
argc
,
argv
,
usage
);
// try to create a grid (from the given grid file or the input file)
using
GridCreator
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridCreator
);
GridCreator
::
makeGrid
();
GridCreator
::
loadBalance
();
GridManager
<
typename
GET_PROP_TYPE
(
TypeTag
,
Grid
)
>
gridManager
;
gridManager
.
init
();
////////////////////////////////////////////////////////////
// run instationary non-linear problem on this grid
////////////////////////////////////////////////////////////
// we compute on the leaf grid view
const
auto
&
leafGridView
=
G
rid
Creator
::
grid
().
leafGridView
();
const
auto
&
leafGridView
=
g
rid
Manager
.
grid
().
leafGridView
();
// create the finite volume grid geometry
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
...
...
test/freeflow/navierstokes/test_donea.cc
View file @
5a326c86
...
...
@@ -51,6 +51,7 @@
#include
<dumux/discretization/methods.hh>
#include
<dumux/io/staggeredvtkoutputmodule.hh>
#include
<dumux/io/grid/gridmanager.hh>
#include
<dumux/io/grid/gridmanager.hh>
...
...
@@ -104,18 +105,16 @@ int main(int argc, char** argv) try
Parameters
::
init
(
argc
,
argv
,
usage
);
// try to create a grid (from the given grid file or the input file)
using
GridManager
=
Dumux
::
GridManager
<
typename
GET_PROP_TYPE
(
TypeTag
,
Grid
),
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
)
::
discMethod
>
;
GridManager
gridMgr
;
gridMgr
.
makeGrid
();
const
auto
&
grid
=
gridMgr
.
grid
();
gridMgr
.
loadBalance
();
using
GridManager
=
Dumux
::
GridManager
<
typename
GET_PROP_TYPE
(
TypeTag
,
Grid
)
>
;
GridManager
gridManager
;
gridManager
.
init
();
////////////////////////////////////////////////////////////
// run instationary non-linear problem on this grid
////////////////////////////////////////////////////////////
// we compute on the leaf grid view
const
auto
&
leafGridView
=
grid
.
leafGridView
();
const
auto
&
leafGridView
=
grid
Manager
.
grid
()
.
leafGridView
();
// create the finite volume grid geometry
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
...
...
test/freeflow/navierstokes/test_kovasznay.cc
View file @
5a326c86
...
...
@@ -50,6 +50,7 @@
#include
<dumux/discretization/methods.hh>
#include
<dumux/io/staggeredvtkoutputmodule.hh>
#include
<dumux/io/grid/gridmanager.hh>
/*!
* \brief Provides an interface for customizing error messages associated with
...
...
@@ -101,16 +102,15 @@ int main(int argc, char** argv) try
Parameters
::
init
(
argc
,
argv
,
usage
);
// try to create a grid (from the given grid file or the input file)
using
GridCreator
=
typename
GET_PROP_TYPE
(
TypeTag
,
GridCreator
);
GridCreator
::
makeGrid
();
GridCreator
::
loadBalance
();
GridManager
<
typename
GET_PROP_TYPE
(
TypeTag
,
Grid
)
>
gridManager
;
gridManager
.
init
();
////////////////////////////////////////////////////////////
// run instationary non-linear problem on this grid
////////////////////////////////////////////////////////////
// we compute on the leaf grid view
const
auto
&
leafGridView
=
G
rid
Creator
::
grid
().
leafGridView
();
const
auto
&
leafGridView
=
g
rid
Manager
.
grid
().
leafGridView
();
// create the finite volume grid geometry
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
...
...
Prev
1
2
3
4
5
…
8
Next
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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