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 "Tags.hpp"
20 : : #include "Inciter/Options/Physics.hpp"
21 : : #include "Inciter/Options/Problem.hpp"
22 : :
23 : : namespace inciter {
24 : : namespace ctr {
25 : :
26 : : //! Differential equation types
27 : : enum class PDEType : uint8_t { TRANSPORT,
28 : : COMPFLOW,
29 : : MULTIMAT,
30 : : MULTISPECIES };
31 : :
32 : : //! Pack/Unpack: forward overload to generic enum class packer
33 : 1790 : inline void operator|( PUP::er& p, PDEType& e ) { PUP::pup( p, e ); }
34 : :
35 : : //! Differential equation key used to access a diff eq in a factory
36 : : using PDEKey =
37 : : tk::TaggedTuple< brigand::list<
38 : : tag::pde, PDEType
39 : : , tag::physics, ctr::PhysicsType
40 : : , tag::problem, ctr::ProblemType
41 : : > >;
42 : :
43 : : //! Class with base templated on the above enum class with associations
44 : : class PDE : public tk::Toggle< PDEType > {
45 : :
46 : : public:
47 : : //! Constructor: pass associations references to base, which will handle
48 : : //! class-user interactions
49 : 192 : explicit PDE() :
50 : : tk::Toggle< PDEType >( "Partial differential equation",
51 : : //! Enums -> names
52 : 0 : { { PDEType::TRANSPORT, "transport" },
53 : 0 : { PDEType::COMPFLOW, "compflow" },
54 : 0 : { PDEType::MULTIMAT, "multimat" },
55 : 0 : { PDEType::MULTISPECIES, "multispecies" }
56 : : },
57 : : //! keywords -> Enums
58 : 384 : { { "transport", PDEType::TRANSPORT },
59 : 0 : { "compflow", PDEType::COMPFLOW },
60 : 0 : { "multimat", PDEType::MULTIMAT },
61 : 0 : { "multispecies", PDEType::MULTISPECIES }
62 [ + - ][ + - ]: 1728 : } ) {}
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + - ][ + - ]
[ + + ][ + + ]
[ - - ][ - - ]
63 : : };
64 : :
65 : : } // ctr::
66 : : } // inciter::
67 : :
68 : : #endif // InciterPDEOptions_h
|