Commit 1561b365 authored by Timo Koch's avatar Timo Koch Committed by Dennis Gläser
Browse files

[disc] Add toString function for discretization method

parent 7d845bf0
......@@ -24,19 +24,46 @@
#ifndef DUMUX_DISCRETIZARION_METHOD_HH
#define DUMUX_DISCRETIZARION_METHOD_HH
#include <ostream>
#include <string>
namespace Dumux {
/*!
* \brief The available discretization methods in Dumux
* \ingroup Discretization
* \note Use none if specifying a discretization method is required but
* the class in question is not specific to a a discretization method
* or the classification is non-applicable
*/
enum class DiscretizationMethod
/*!
* \brief The available discretization methods in Dumux
* \ingroup Discretization
* \note Use none if specifying a discretization method is required but
* the class in question is not specific to a a discretization method
* or the classification is non-applicable
*/
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment