Line data Source code
1 1 : // Distributed under the MIT License. 2 : // See LICENSE.txt for details. 3 : 4 : /// \file 5 : /// Defines enum class amr::Flag. 6 : 7 : #pragma once 8 : 9 : #include <iosfwd> 10 : 11 : /// \cond 12 : namespace Options { 13 : class Option; 14 : template <typename T> 15 : struct create_from_yaml; 16 : } // namespace Options 17 : /// \endcond 18 : 19 : namespace amr { 20 : 21 : /// \ingroup AmrGroup 22 : /// \brief Flags that represent decisions about mesh refinement 23 : /// 24 : /// In order to support anisotropic mesh refinement, a flag is specified for 25 : /// each dimension. 26 1 : enum class Flag { 27 : Undefined, /**< used to initialize flags before a decision is made */ 28 : Join, /**< join the sibling of an Element */ 29 : DecreaseResolution, /**< decrease number of points in an Element */ 30 : DoNothing, /**< stay the same */ 31 : IncreaseResolution, /**< increase number of points in an Element */ 32 : Split /**< split the Element into two smaller elements */ 33 : }; 34 : 35 : /// Output operator for a Flag. 36 1 : std::ostream& operator<<(std::ostream& os, const Flag& flag); 37 : } // namespace amr 38 : 39 : template <> 40 0 : struct Options::create_from_yaml<amr::Flag> { 41 : template <typename Metavariables> 42 0 : static amr::Flag create(const Options::Option& options) { 43 : return create<void>(options); 44 : } 45 : }; 46 : 47 : template <> 48 0 : amr::Flag Options::create_from_yaml<amr::Flag>::create<void>( 49 : const Options::Option& options);