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
Pipeline #6223 canceled with stages
in 0 seconds
......@@ -21,22 +21,49 @@
* \ingroup Discretization
* \brief The available discretization methods in Dumux
*/
#ifndef DUMUX_DISCRETIZARION_METHOD_HH
#define DUMUX_DISCRETIZARION_METHOD_HH
#ifndef DUMUX_DISCRETIZATION_METHOD_HH
#define DUMUX_DISCRETIZATION_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
{
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)
{
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