GADGET-4
peano.cc File Reference

routines for computing Peano-Hilbert keys and for bringing particles into this order More...

#include "gadgetconfig.h"
#include <math.h>
#include <mpi.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <algorithm>
#include "../data/allvars.h"
#include "../data/dtypes.h"
#include "../data/mymalloc.h"
#include "../logs/timer.h"
#include "../main/simulation.h"
#include "../sort/cxxsort.h"
#include "../sort/peano.h"
#include "../system/system.h"

Go to the source code of this file.

Functions

peanokey peano_hilbert_key (MyIntPosType x, MyIntPosType y, MyIntPosType z, int bits)
 
unsigned char peano_incremental_key (unsigned char pix, unsigned char *rotation)
 
void peano_hilbert_key_inverse (peanokey key, int bits, MyIntPosType *x, MyIntPosType *y, MyIntPosType *z)
 

Variables

const unsigned char irottable3 [48][8]
 
const unsigned char ipixtable3 [48][8]
 

Detailed Description

routines for computing Peano-Hilbert keys and for bringing particles into this order

Definition in file peano.cc.

Function Documentation

◆ peano_hilbert_key()

peanokey peano_hilbert_key ( MyIntPosType  x,
MyIntPosType  y,
MyIntPosType  z,
int  bits 
)

This function computes a Peano-Hilbert key for an integer triplet (x,y,z), with x,y,z in the range between 0 and 2^bits-1.

Definition at line 83 of file peano.cc.

◆ peano_hilbert_key_inverse()

void peano_hilbert_key_inverse ( peanokey  key,
int  bits,
MyIntPosType x,
MyIntPosType y,
MyIntPosType z 
)

Definition at line 146 of file peano.cc.

◆ peano_incremental_key()

unsigned char peano_incremental_key ( unsigned char  pix,
unsigned char *  rotation 
)

Definition at line 107 of file peano.cc.

Variable Documentation

◆ ipixtable3

const unsigned char ipixtable3[48][8]
Initial value:
= {
{1, 3, 7, 5, 4, 6, 2, 0}, {0, 2, 3, 1, 5, 7, 6, 4}, {4, 6, 2, 0, 1, 3, 7, 5}, {5, 7, 6, 4, 0, 2, 3, 1}, {3, 2, 6, 7, 5, 4, 0, 1},
{2, 6, 7, 3, 1, 5, 4, 0}, {6, 7, 3, 2, 0, 1, 5, 4}, {7, 3, 2, 6, 4, 0, 1, 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 irottable3

const unsigned char irottable3[48][8]
Initial value:
= {
{28, 27, 27, 10, 10, 25, 25, 36}, {29, 24, 24, 11, 11, 26, 26, 37}, {30, 25, 25, 8, 8, 27, 27, 38},
{31, 26, 26, 9, 9, 24, 24, 39}, {32, 44, 44, 6, 6, 40, 40, 24}, {33, 45, 45, 7, 7, 41, 41, 25},
{34, 46, 46, 4, 4, 42, 42, 26}, {35, 47, 47, 5, 5, 43, 43, 27}, {36, 33, 33, 2, 2, 35, 35, 28},
{37, 34, 34, 3, 3, 32, 32, 29}, {38, 35, 35, 0, 0, 33, 33, 30}, {39, 32, 32, 1, 1, 34, 34, 31},
{24, 42, 42, 14, 14, 46, 46, 32}, {25, 43, 43, 15, 15, 47, 47, 33}, {26, 40, 40, 12, 12, 44, 44, 34},
{27, 41, 41, 13, 13, 45, 45, 35}, {41, 28, 28, 22, 22, 38, 38, 43}, {42, 29, 29, 23, 23, 39, 39, 40},
{43, 30, 30, 20, 20, 36, 36, 41}, {40, 31, 31, 21, 21, 37, 37, 42}, {47, 38, 38, 18, 18, 28, 28, 45},
{44, 39, 39, 19, 19, 29, 29, 46}, {45, 36, 36, 16, 16, 30, 30, 47}, {46, 37, 37, 17, 17, 31, 31, 44},
{12, 1, 1, 34, 34, 3, 3, 4}, {13, 2, 2, 35, 35, 0, 0, 5}, {14, 3, 3, 32, 32, 1, 1, 6},
{15, 0, 0, 33, 33, 2, 2, 7}, {0, 16, 16, 30, 30, 20, 20, 8}, {1, 17, 17, 31, 31, 21, 21, 9},
{2, 18, 18, 28, 28, 22, 22, 10}, {3, 19, 19, 29, 29, 23, 23, 11}, {4, 11, 11, 26, 26, 9, 9, 12},
{5, 8, 8, 27, 27, 10, 10, 13}, {6, 9, 9, 24, 24, 11, 11, 14}, {7, 10, 10, 25, 25, 8, 8, 15},
{8, 22, 22, 38, 38, 18, 18, 0}, {9, 23, 23, 39, 39, 19, 19, 1}, {10, 20, 20, 36, 36, 16, 16, 2},
{11, 21, 21, 37, 37, 17, 17, 3}, {19, 14, 14, 46, 46, 4, 4, 17}, {16, 15, 15, 47, 47, 5, 5, 18},
{17, 12, 12, 44, 44, 6, 6, 19}, {18, 13, 13, 45, 45, 7, 7, 16}, {21, 4, 4, 42, 42, 14, 14, 23},
{22, 5, 5, 43, 43, 15, 15, 20}, {23, 6, 6, 40, 40, 12, 12, 21}, {20, 7, 7, 41, 41, 13, 13, 22}}

Definition at line 115 of file peano.cc.