Add a unknown value to the facedir enum
This is will be used by code in opm-models and opm-simulators to identify a face direction that is not known or not important.
This commit is contained in:
@@ -28,12 +28,13 @@ namespace Opm {
|
||||
namespace FaceDir {
|
||||
|
||||
enum DirEnum {
|
||||
XPlus = 1,
|
||||
XMinus = 2,
|
||||
YPlus = 4,
|
||||
YMinus = 8,
|
||||
ZPlus = 16,
|
||||
ZMinus = 32
|
||||
Unknown = 0,
|
||||
XPlus = 1,
|
||||
XMinus = 2,
|
||||
YPlus = 4,
|
||||
YMinus = 8,
|
||||
ZPlus = 16,
|
||||
ZMinus = 32
|
||||
};
|
||||
/**
|
||||
The MULTREGTScanner will use these values as bitmaps;
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
*/
|
||||
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
#include <opm/input/eclipse/EclipseState/Grid/FaceDir.hpp>
|
||||
#include <fmt/format.h>
|
||||
|
||||
|
||||
namespace Opm {
|
||||
|
||||
namespace FaceDir {
|
||||
@@ -75,18 +75,23 @@ namespace Opm {
|
||||
const std::string toString(DirEnum dir)
|
||||
{
|
||||
std::vector<std::string> ret;
|
||||
if (dir & DirEnum::XPlus)
|
||||
ret.push_back("X+");
|
||||
if (dir & DirEnum::XMinus)
|
||||
ret.push_back("X-");
|
||||
if (dir & DirEnum::YPlus)
|
||||
ret.push_back("Y+");
|
||||
if (dir & DirEnum::YMinus)
|
||||
ret.push_back("Y-");
|
||||
if (dir & DirEnum::ZPlus)
|
||||
ret.push_back("Z+");
|
||||
if (dir & DirEnum::ZMinus)
|
||||
ret.push_back("Z-");
|
||||
if (dir == DirEnum::Unknown) {
|
||||
ret.push_back("Unknown");
|
||||
}
|
||||
else {
|
||||
if (dir & DirEnum::XPlus)
|
||||
ret.push_back("X+");
|
||||
if (dir & DirEnum::XMinus)
|
||||
ret.push_back("X-");
|
||||
if (dir & DirEnum::YPlus)
|
||||
ret.push_back("Y+");
|
||||
if (dir & DirEnum::YMinus)
|
||||
ret.push_back("Y-");
|
||||
if (dir & DirEnum::ZPlus)
|
||||
ret.push_back("Z+");
|
||||
if (dir & DirEnum::ZMinus)
|
||||
ret.push_back("Z-");
|
||||
}
|
||||
if (ret.size() == 0)
|
||||
throw std::runtime_error("This should not happen");
|
||||
return fmt::format("{}",fmt::join(ret, "|"));
|
||||
|
||||
Reference in New Issue
Block a user