21 #ifndef STL_UNORDERED_MAP 24 #include <unordered_map> 34 #include "NamespaceHeader.H" 53 MayDay::Abort(
"IVCompareSWO: cannot compare IntVects along a direction that doesn't exist");
64 else if (SpaceDim>1 && \
65 a[ m_dir %SpaceDim] == b[ m_dir %SpaceDim] && \
66 a[(m_dir+1)%SpaceDim] < b[(m_dir+1)%SpaceDim])
68 else if (SpaceDim>2 && \
69 a[ m_dir %SpaceDim] == b[ m_dir %SpaceDim] && \
70 a[(m_dir+1)%SpaceDim] == b[(m_dir+1)%SpaceDim] && \
71 a[(m_dir+2)%SpaceDim] < b[(m_dir+2)%SpaceDim])
98 inline bool operator()(
const pair<Real,int>& a,
const pair<Real,int>& b)
100 return a.first<b.first;
104 #ifdef STL_UNORDERED_MAP 107 inline void hash_combine(std::size_t& seed,
const T& v)
110 seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2);
115 : std::unary_function<IntVect, std::size_t>
117 inline std::size_t operator()(
const IntVect& a)
const 119 std::size_t seed = 0;
121 hash_combine(seed,a[i]);
129 : std::unary_function<CellEdge, std::size_t>
131 inline std::size_t operator()(
const CellEdge& a)
const 134 std::size_t seed = node0hasher(a.
m_node0);
135 hash_combine(seed,a.
m_dir);
148 #ifndef STL_UNORDERED_MAP 149 typedef map<IntVect, TriInCell, IVCompareSWO>
CellMap;
150 typedef map<IntVect, bool, IVCompareSWO>
NodeMap;
151 typedef map<CellEdge, RealVect, EdgeCompareSWO>
EdgeMap;
153 typedef unordered_map<IntVect, TriInCell, IVHash>
CellMap;
154 typedef unordered_map<IntVect, bool, IVHash>
NodeMap;
155 typedef unordered_map<CellEdge, RealVect, CellEdgeHash>
EdgeMap;
159 void PMap(
const CellMap& m);
160 void PMap(
const NodeMap& m);
161 void PMap(
const pair<IntVect, TriInCell>& p);
184 #include "NamespaceFooter.H"
void PMap(const pair< IntVect, TriInCell > &p)
Vector< int > triangles
Definition: STLUtil.H:144
bool operator()(const IntVect &a, const IntVect &b) const
Definition: STLUtil.H:60
IVCompareSWO()
Definition: STLUtil.H:56
Definition: IntVect.H:719
Vector< int > vertices
Definition: STLUtil.H:143
RealVect IVToRV(const IntVect &iv, const RealVect &a_origin, const RealVect &a_dx)
void PVec(const Vector< Vector< int > > &v)
const int SpaceDim
Definition: SPACE.H:38
bool operator()(const pair< Real, int > &a, const pair< Real, int > &b)
Definition: STLUtil.H:98
int m_dir
Definition: STLUtil.H:78
Definition: STLUtil.H:141
void PRV(const RealVect &iv)
Definition: CellEdge.H:21
NodeMap::iterator NodeMapIt
Definition: STLUtil.H:179
map< IntVect, TriInCell, IVCompareSWO > CellMap
Definition: STLUtil.H:149
IVCompareSWO(int a_dir)
Definition: STLUtil.H:50
EdgeMap::iterator EdgeMapIt
Definition: STLUtil.H:180
CellMap::iterator CellMapIt
Definition: STLUtil.H:178
A Real vector in SpaceDim-dimensional space.
Definition: RealVect.H:41
map< IntVect, bool, IVCompareSWO > NodeMap
Definition: STLUtil.H:150
map< CellEdge, RealVect, EdgeCompareSWO > EdgeMap
Definition: STLUtil.H:151
An integer Vector in SpaceDim-dimensional space.
Definition: CHArray.H:42
IntVect RVSign(const RealVect &rv)
void PIV(const IntVect &iv)
bool operator()(const CellEdge &a, const CellEdge &b) const
Definition: STLUtil.H:85
IntVect m_node0
Definition: CellEdge.H:51
int m_dir
Definition: CellEdge.H:49
static void Abort(const char *const a_msg=m_nullString)
Print out message to cerr and exit via abort() (if serial) or MPI_Abort() (if parallel).