IPPL (Independent Parallel Particle Layer)
IPPL
Loading...
Searching...
No Matches
FieldLayout.cpp
Go to the documentation of this file.
2
3namespace 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
Definition Archive.h:20
unsigned int getFaceDim(unsigned int face)
bool isUpper(unsigned int face)