Skip to content
Snippets Groups Projects
Commit 8bb64a6f authored by Dennis Gläser's avatar Dennis Gläser
Browse files

Merge branch 'feature/disc-string' into 'master'

[disc] Add toString function for discretization method

See merge request !2724
parents 7d845bf0 a216303c
No related branches found
No related tags found
1 merge request!2724[disc] Add toString function for discretization method
Pipeline #6223 canceled
...@@ -21,22 +21,49 @@ ...@@ -21,22 +21,49 @@
* \ingroup Discretization * \ingroup Discretization
* \brief The available discretization methods in Dumux * \brief The available discretization methods in Dumux
*/ */
#ifndef DUMUX_DISCRETIZARION_METHOD_HH #ifndef DUMUX_DISCRETIZATION_METHOD_HH
#define DUMUX_DISCRETIZARION_METHOD_HH #define DUMUX_DISCRETIZATION_METHOD_HH
#include <ostream>
#include <string>
namespace Dumux { namespace Dumux {
/*! /*!
* \brief The available discretization methods in Dumux * \brief The available discretization methods in Dumux
* \ingroup Discretization * \ingroup Discretization
* \note Use none if specifying a discretization method is required but * \note Use none if specifying a discretization method is required but
* the class in question is not specific to a a discretization method * the class in question is not specific to a a discretization method
* or the classification is non-applicable * or the classification is non-applicable
*/ */
enum class DiscretizationMethod enum class DiscretizationMethod
{
none, box, cctpfa, ccmpfa, staggered, fem
};
/*!
* \brief Convert discretization method to string
* \ingroup Discretization
*/
inline std::string toString(DiscretizationMethod m)
{
switch (m)
{ {
none, box, cctpfa, ccmpfa, staggered, fem case DiscretizationMethod::box: return "box";
}; case DiscretizationMethod::cctpfa: return "cctpfa";
case DiscretizationMethod::ccmpfa: return "ccmpfa";
case DiscretizationMethod::staggered: return "staggered";
case DiscretizationMethod::fem: return "fem";
default: return "none";
}
}
/*!
* \brief Write discretization method to stream
* \ingroup Discretization
*/
inline std::ostream& operator<<(std::ostream& stream, DiscretizationMethod m)
{ stream << toString(m); return stream; }
} // end namespace Dumux } // end namespace Dumux
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment