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
72137036
Commit
72137036
authored
Jul 13, 2018
by
Beatrix Becker
Browse files
[exercise-fluidsystem solution] make TypeTags for problems easier
parent
2b87c983
Changes
4
Hide whitespace changes
Inline
Side-by-side
exercises/solution/exercise-fluidsystem/2p2cproblem.hh
View file @
72137036
...
...
@@ -45,8 +45,7 @@ template <class TypeTag> class ExerciseFluidsystemProblemTwoPTwoC;
namespace
Properties
{
// Create a new type tag for the problem
NEW_TYPE_TAG
(
ExerciseFluidsystemTwoPTwoCTypeTag
,
INHERITS_FROM
(
TwoPTwoC
));
NEW_TYPE_TAG
(
ExerciseFluidsystemBoxTwoPTwoCTypeTag
,
INHERITS_FROM
(
BoxModel
,
ExerciseFluidsystemTwoPTwoCTypeTag
));
NEW_TYPE_TAG
(
ExerciseFluidsystemTwoPTwoCTypeTag
,
INHERITS_FROM
(
TwoPTwoC
,
BoxModel
));
// Set the "Problem" property
SET_TYPE_PROP
(
ExerciseFluidsystemTwoPTwoCTypeTag
,
Problem
,
ExerciseFluidsystemProblemTwoPTwoC
<
TypeTag
>
);
...
...
exercises/solution/exercise-fluidsystem/2pproblem.hh
View file @
72137036
...
...
@@ -65,8 +65,7 @@ template <class TypeTag> class ExerciseFluidsystemProblemTwoP;
namespace
Properties
{
// Create a new type tag for the problem
NEW_TYPE_TAG
(
ExerciseFluidsystemTwoPTypeTag
,
INHERITS_FROM
(
TwoP
));
NEW_TYPE_TAG
(
ExerciseFluidsystemBoxTwoPTypeTag
,
INHERITS_FROM
(
BoxModel
,
ExerciseFluidsystemTwoPTypeTag
));
NEW_TYPE_TAG
(
ExerciseFluidsystemTwoPTypeTag
,
INHERITS_FROM
(
TwoP
,
BoxModel
));
// Set the "Problem" property
SET_TYPE_PROP
(
ExerciseFluidsystemTwoPTypeTag
,
Problem
,
ExerciseFluidsystemProblemTwoP
<
TypeTag
>
);
...
...
exercises/solution/exercise-fluidsystem/CMakeLists.txt
View file @
72137036
...
...
@@ -2,13 +2,13 @@
#part a: 2pproblem
dune_add_test
(
NAME exercise-fluidsystem_a_solution
SOURCES exercise-fluidsystem.cc
COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystem
Box
TwoPTypeTag
COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoPTypeTag
CMD_ARGS exercise-fluidsystem_a.input
)
#part b: 2p2cproblem
dune_add_test
(
NAME exercise-fluidsystem_b_solution
SOURCES exercise-fluidsystem.cc
COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystem
Box
TwoPTwoCTypeTag
COMPILE_DEFINITIONS TYPETAG=ExerciseFluidsystemTwoPTwoCTypeTag
CMD_ARGS exercise-fluidsystem_b.input
)
# add exercises to the common target
...
...
exercises/solution/exercise-fluidsystem/exercise-fluidsystem.cc
View file @
72137036
...
...
@@ -61,8 +61,8 @@ int main(int argc, char** argv) try
// define the type tag for this problem
// TYPETAG is set in CMakeLists.txt as compile time definition
// alternatively you could write `using TypeTag = TTAG(ExerciseFluidsystem
Box
TwoPTypeTag);`
// then, for the 2p2c problem you have to change this line to `using TypeTag = TTAG(ExerciseFluidsystem
Box
TwoPTwoCTypeTag);`
// alternatively you could write `using TypeTag = TTAG(ExerciseFluidsystemTwoPTypeTag);`
// then, for the 2p2c problem you have to change this line to `using TypeTag = TTAG(ExerciseFluidsystemTwoPTwoCTypeTag);`
// and recompile the executable
using
TypeTag
=
TTAG
(
TYPETAG
);
...
...
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