#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <mpi.h>
#include "allvars.h"
#include "proto.h"
Go to the source code of this file.
Data Structures  
struct  peano_hilbert_data 
Functions  
void  peano_hilbert_order (void) 
int  compare_key (const void *a, const void *b) 
void  reorder_gas (void) 
void  reorder_particles (void) 
peanokey  peano_hilbert_key (int x, int y, int z, int bits) 
void  peano_hilbert_key_inverse (peanokey key, int bits, int *x, int *y, int *z) 
This file contains routines to compute PeanoHilbert keys, and to put the particle data into the order of these keys, i.e. into the order of a spacefilling fractal curve.
Definition in file peano.c.

This function is a comparison kernel for sorting the PeanoHilbert keys. Definition at line 98 of file peano.c. Referenced by peano_hilbert_order(). 

This function computes a PeanoHilbert key for an integer triplet (x,y,z), with x,y,z in the range between 0 and 2^bits1. Definition at line 263 of file peano.c. References peanokey. Referenced by domain_determineTopTree(), force_create_empty_nodes(), and force_treebuild_single(). 

This function computes for a given PeanoHilbert key, the inverse, i.e. the integer triplet (x,y,z) with a PeanoHilbert key equal to the input key. (This functionality is actually not needed in the present code.) 

This function puts the particles into PeanoHilbert order by sorting them according to their keys. The latter half already been computed in the domain decomposition. Since gas particles need to stay at the beginning of the particle list, they are sorted as a separate block. Definition at line 34 of file peano.c. References compare_key(), Key, N_gas, NumPart, reorder_gas(), reorder_particles(), and ThisTask. Referenced by domain_Decomposition(). 

This function brings the gas particles into the same order as the sorted keys. (The sort is first done only on the keys themselves and done directly on the gas particles in order to reduce the amount of data that needs to be moved in memory. Only once the order is established, the gas particles are rearranged, such that each particle has to be moved at most once.) Definition at line 117 of file peano.c. Referenced by peano_hilbert_order(). 

This function brings the collisionless particles into the same order as the sorted keys. (The sort is first done only on the keys themselves and done directly on the particles in order to reduce the amount of data that needs to be moved in memory. Only once the order is established, the particles are rearranged, such that each particle has to be moved at most once.) Definition at line 166 of file peano.c. References P. Referenced by peano_hilbert_order(). 