IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
FieldLayout.cpp
Go to the documentation of this file.
1
#include "
Utility/IpplException.h
"
2
3
namespace
ippl
{
4
namespace
detail
{
5
bool
isUpper
(
unsigned
int
face) {
6
for
(; face > 0; face /= 3) {
7
if
(face % 3 == 1) {
8
return
true
;
9
}
10
}
11
return
false
;
12
}
13
14
unsigned
int
getFaceDim
(
unsigned
int
face) {
15
int
dim = -1;
16
unsigned
int
d = 0;
17
for
(; face > 0; face /= 3, d++) {
18
if
(face % 3 != 2) {
19
if
(dim == -1) {
20
dim = d;
21
}
else
{
22
throw
IpplException
(
23
"ippl::detail::getFaceDim"
,
24
"Argument corresponds to lower dimension hypercube than a facet"
);
25
}
26
}
27
}
28
if
(dim < 0) {
29
return
d;
30
}
31
return
dim;
32
}
33
}
// namespace detail
34
}
// namespace ippl
IpplException.h
ippl
Definition
Archive.h:20
ippl::detail
Definition
Archive.h:21
ippl::detail::getFaceDim
unsigned int getFaceDim(unsigned int face)
Definition
FieldLayout.cpp:14
ippl::detail::isUpper
bool isUpper(unsigned int face)
Definition
FieldLayout.cpp:5
IpplException
Definition
IpplException.h:6