Main Page | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

peano.c File Reference

Routines to compute a Peano-Hilbert order. More...

#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)


Detailed Description

Routines to compute a Peano-Hilbert order.

This file contains routines to compute Peano-Hilbert keys, and to put the particle data into the order of these keys, i.e. into the order of a space-filling fractal curve.

Definition in file peano.c.


Function Documentation

int compare_key const void *  a,
const void *  b
 

This function is a comparison kernel for sorting the Peano-Hilbert keys.

Definition at line 98 of file peano.c.

Referenced by peano_hilbert_order().

peanokey peano_hilbert_key int  x,
int  y,
int  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 263 of file peano.c.

References peanokey.

Referenced by domain_determineTopTree(), force_create_empty_nodes(), and force_treebuild_single().

void peano_hilbert_key_inverse peanokey  key,
int  bits,
int *  x,
int *  y,
int *  z
 

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

Definition at line 313 of file peano.c.

void peano_hilbert_order void   ) 
 

This function puts the particles into Peano-Hilbert 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().

void reorder_gas void   ) 
 

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.

References P, and SphP.

Referenced by peano_hilbert_order().

void reorder_particles void   ) 
 

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().


Generated on Sun May 22 17:33:30 2005 for GADGET-2 by  doxygen 1.3.9.1