Branch data Line data Source code
1 : : // *****************************************************************************
2 : : /*!
3 : : \file src/Control/Inciter/Options/PDE.hpp
4 : : \copyright 2012-2015 J. Bakosi,
5 : : 2016-2018 Los Alamos National Security, LLC.,
6 : : 2019-2021 Triad National Security, LLC.
7 : : All rights reserved. See the LICENSE file for details.
8 : : \brief Partial differential equation options and associations for inciter
9 : : \details Partial differential equation options and associations for inciter
10 : : */
11 : : // *****************************************************************************
12 : : #ifndef InciterPDEOptions_h
13 : : #define InciterPDEOptions_h
14 : :
15 : : #include <brigand/sequences/list.hpp>
16 : :
17 : : #include "TaggedTuple.hpp"
18 : : #include "Toggle.hpp"
19 : : #include "Inciter/Options/Physics.hpp"
20 : : #include "Inciter/Options/Problem.hpp"
21 : :
22 : : namespace inciter {
23 : : namespace ctr {
24 : :
25 : : //! Differential equation types
26 : : enum class PDEType : uint8_t { TRANSPORT,
27 : : COMPFLOW,
28 : : MULTIMAT };
29 : :
30 : : //! Pack/Unpack: forward overload to generic enum class packer
31 : : inline void operator|( PUP::er& p, PDEType& e ) { PUP::pup( p, e ); }
32 : :
33 : : //! Differential equation key used to access a diff eq in a factory
34 : : using PDEKey =
35 : : tk::TaggedTuple< brigand::list<
36 : : tag::pde, PDEType
37 : : , tag::physics, ctr::PhysicsType
38 : : , tag::problem, ctr::ProblemType
39 : : > >;
40 : :
41 : : //! Class with base templated on the above enum class with associations
42 : 195 : class PDE : public tk::Toggle< PDEType > {
43 : :
44 : : public:
45 : : //! Constructor: pass associations references to base, which will handle
46 : : //! class-user interactions
47 : 195 : explicit PDE() :
48 : : tk::Toggle< PDEType >( "Partial differential equation",
49 : : //! Enums -> names
50 : : { { PDEType::TRANSPORT, "transport" },
51 : : { PDEType::COMPFLOW, "compflow" },
52 : : { PDEType::MULTIMAT, "multimat" } },
53 : : //! keywords -> Enums
54 : : { { "transport", PDEType::TRANSPORT },
55 : : { "compflow", PDEType::COMPFLOW },
56 [ + - ][ + - ]: 1950 : { "multimat", PDEType::MULTIMAT } } ) {}
[ + - ][ + + ]
[ - + ][ + + ]
[ - + ][ - - ]
[ - - ][ - - ]
[ - - ]
57 : : };
58 : :
59 : : } // ctr::
60 : : } // inciter::
61 : :
62 : : #endif // InciterPDEOptions_h
|