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-course
Commits
a0de95a0
Commit
a0de95a0
authored
Dec 21, 2018
by
Timo Koch
Browse files
[mainfile] Free spatial params from typetag
parent
946a5fea
Changes
4
Hide whitespace changes
Inline
Side-by-side
exercises/exercise-mainfile/1pproblem.hh
View file @
a0de95a0
...
...
@@ -70,7 +70,9 @@ struct Problem<TypeTag, TTag::OnePBase> { using type = OnePTestProblem<TypeTag>;
// set the spatial params
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
OnePBase
>
{
using
type
=
OnePTestSpatialParams
<
TypeTag
>
;
};
struct
SpatialParams
<
TypeTag
,
TTag
::
OnePBase
>
{
using
type
=
OnePTestSpatialParams
<
GetPropType
<
TypeTag
,
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Scalar
>>
;
};
// the fluid system for incompressible tests
template
<
class
TypeTag
>
...
...
exercises/exercise-mainfile/1pspatialparams.hh
View file @
a0de95a0
...
...
@@ -24,7 +24,6 @@
#ifndef DUMUX_EX_MAINFILE_ONEP_TEST_SPATIAL_PARAMS_HH
#define DUMUX_EX_MAINFILE_ONEP_TEST_SPATIAL_PARAMS_HH
#include <dumux/porousmediumflow/properties.hh>
#include <dumux/material/spatialparams/fv1p.hh>
namespace
Dumux
{
...
...
@@ -34,19 +33,15 @@ namespace Dumux {
* \brief The spatial parameters class for the test problem using the
* compressible 1p model
*/
template
<
class
TypeTag
>
template
<
class
FVGridGeometry
,
class
Scalar
>
class
OnePTestSpatialParams
:
public
FVSpatialParamsOneP
<
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
),
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
),
OnePTestSpatialParams
<
TypeTag
>>
:
public
FVSpatialParamsOneP
<
FVGridGeometry
,
Scalar
,
OnePTestSpatialParams
<
FVGridGeometry
,
Scalar
>>
{
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
GridView
=
typename
FVGridGeometry
::
GridView
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
ParentType
=
FVSpatialParamsOneP
<
FVGridGeometry
,
Scalar
,
OnePTestSpatialParams
<
TypeTag
>>
;
using
ParentType
=
FVSpatialParamsOneP
<
FVGridGeometry
,
Scalar
,
OnePTestSpatialParams
<
FVGridGeometry
,
Scalar
>>
;
static
constexpr
int
dimWorld
=
GridView
::
dimensionworld
;
using
GlobalPosition
=
typename
Element
::
Geometry
::
GlobalCoordinate
;
...
...
exercises/solution/exercise-mainfile/1pproblem.hh
View file @
a0de95a0
...
...
@@ -70,7 +70,9 @@ struct Problem<TypeTag, TTag::OnePBase> { using type = OnePTestProblem<TypeTag>;
// set the spatial params
template
<
class
TypeTag
>
struct
SpatialParams
<
TypeTag
,
TTag
::
OnePBase
>
{
using
type
=
OnePTestSpatialParams
<
TypeTag
>
;
};
struct
SpatialParams
<
TypeTag
,
TTag
::
OnePBase
>
{
using
type
=
OnePTestSpatialParams
<
GetPropType
<
TypeTag
,
FVGridGeometry
>
,
GetPropType
<
TypeTag
,
Scalar
>>
;
};
// the fluid system for incompressible tests
template
<
class
TypeTag
>
...
...
exercises/solution/exercise-mainfile/1pspatialparams.hh
View file @
a0de95a0
...
...
@@ -24,7 +24,6 @@
#ifndef DUMUX_EX_MAINFILE_ONEP_TEST_SPATIAL_PARAMS_HH
#define DUMUX_EX_MAINFILE_ONEP_TEST_SPATIAL_PARAMS_HH
#include <dumux/porousmediumflow/properties.hh>
#include <dumux/material/spatialparams/fv1p.hh>
namespace
Dumux
{
...
...
@@ -34,19 +33,15 @@ namespace Dumux {
* \brief The spatial parameters class for the test problem using the
* compressible 1p model
*/
template
<
class
TypeTag
>
template
<
class
FVGridGeometry
,
class
Scalar
>
class
OnePTestSpatialParams
:
public
FVSpatialParamsOneP
<
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
),
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
),
OnePTestSpatialParams
<
TypeTag
>>
:
public
FVSpatialParamsOneP
<
FVGridGeometry
,
Scalar
,
OnePTestSpatialParams
<
FVGridGeometry
,
Scalar
>>
{
using
Scalar
=
typename
GET_PROP_TYPE
(
TypeTag
,
Scalar
);
using
FVGridGeometry
=
typename
GET_PROP_TYPE
(
TypeTag
,
FVGridGeometry
);
using
GridView
=
typename
FVGridGeometry
::
GridView
;
using
Element
=
typename
GridView
::
template
Codim
<
0
>
::
Entity
;
using
FVElementGeometry
=
typename
FVGridGeometry
::
LocalView
;
using
SubControlVolume
=
typename
FVElementGeometry
::
SubControlVolume
;
using
ParentType
=
FVSpatialParamsOneP
<
FVGridGeometry
,
Scalar
,
OnePTestSpatialParams
<
TypeTag
>>
;
using
ParentType
=
FVSpatialParamsOneP
<
FVGridGeometry
,
Scalar
,
OnePTestSpatialParams
<
FVGridGeometry
,
Scalar
>>
;
static
constexpr
int
dimWorld
=
GridView
::
dimensionworld
;
using
GlobalPosition
=
typename
Element
::
Geometry
::
GlobalCoordinate
;
...
...
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