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

pm_periodic.c File Reference

routines for periodic PM-force computation More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <float.h>
#include <mpi.h>
#include <srfftw_mpi.h>
#include "allvars.h"
#include "proto.h"

Go to the source code of this file.

Defines

#define PMGRID2   (2*(PMGRID/2 + 1))

Functions

void pm_init_periodic (void)
void pm_init_periodic_allocate (int dimprod)
void pm_init_periodic_free (void)
void pmforce_periodic (void)
void pmpotential_periodic (void)


Detailed Description

routines for periodic PM-force computation

Definition in file pm_periodic.c.


Define Documentation

#define PMGRID2   (2*(PMGRID/2 + 1))
 

Definition at line 29 of file pm_periodic.c.

Referenced by pmforce_periodic(), and pmpotential_periodic().


Function Documentation

void pm_init_periodic void   ) 
 

This routines generates the FFTW-plans to carry out the parallel FFTs later on. Some auxiliary variables are also initialized.

< @-ASMTH gives the scale of the short-range/long-range force split in units of FFT-mesh cells

< @-RCUT gives the maximum distance (in units of the scale used for the force split) out to which short-range forces are evaluated in the short-range tree walk.

Definition at line 55 of file pm_periodic.c.

References All, global_data_all_processes::Asmth, ASMTH, global_data_all_processes::BoxSize, NTask, global_data_all_processes::Rcut, RCUT, and ThisTask.

Referenced by long_range_init().

void pm_init_periodic_allocate int  dimprod  ) 
 

This function allocates the memory neeed to compute the long-range PM force. Three fields are used, one to hold the density (and its FFT, and then the real-space potential), one to hold the force field obtained by finite differencing, and finally a workspace field, which is used both as workspace for the parallel FFT, and as buffer for the communication algorithm used in the force computation.

Definition at line 114 of file pm_periodic.c.

References endrun(), imax(), and ThisTask.

Referenced by pmforce_periodic(), and pmpotential_periodic().

void pm_init_periodic_free void   ) 
 

This routine frees the space allocated for the parallel FFT algorithm.

Definition at line 161 of file pm_periodic.c.

Referenced by pmforce_periodic(), and pmpotential_periodic().

void pmforce_periodic void   ) 
 

Calculates the long-range periodic force given the particle positions using the PM method. The force is Gaussian filtered with Asmth, given in mesh-cell units. We carry out a CIC charge assignment, and compute the potenial by Fourier transform methods. The potential is finite differenced using a 4-point finite differencing formula, and the forces are interpolated tri-linearly to the particle positions. The CIC kernel is deconvolved. Note that the particle distribution is not in the slab decomposition that is used for the FFT. Instead, overlapping patches between local domains and FFT slabs are communicated as needed.

Definition at line 181 of file pm_periodic.c.

References All, global_data_all_processes::Asmth, global_data_all_processes::BoxSize, force_treeallocate(), force_treefree(), global_data_all_processes::G, particle_data::GravPM, particle_data::Mass, global_data_all_processes::MaxPart, global_data_all_processes::NumForcesSinceLastDomainDecomp, P, pm_init_periodic_allocate(), pm_init_periodic_free(), PMGRID2, particle_data::Pos, TAG_PERIODIC_A, TAG_PERIODIC_B, ThisTask, global_data_all_processes::TotNumPart, global_data_all_processes::TreeAllocFactor, and global_data_all_processes::TreeDomainUpdateFrequency.

Referenced by long_range_force().

void pmpotential_periodic void   ) 
 

Calculates the long-range potential using the PM method. The potential is Gaussian filtered with Asmth, given in mesh-cell units. We carry out a CIC charge assignment, and compute the potenial by Fourier transform methods. The CIC kernel is deconvolved.

Definition at line 694 of file pm_periodic.c.

References All, global_data_all_processes::Asmth, global_data_all_processes::BoxSize, force_treeallocate(), force_treefree(), global_data_all_processes::G, particle_data::Mass, global_data_all_processes::MaxPart, global_data_all_processes::NumForcesSinceLastDomainDecomp, P, pm_init_periodic_allocate(), pm_init_periodic_free(), PMGRID2, particle_data::Pos, particle_data::Potential, TAG_PERIODIC_C, TAG_PERIODIC_D, ThisTask, global_data_all_processes::TotNumPart, global_data_all_processes::TreeAllocFactor, and global_data_all_processes::TreeDomainUpdateFrequency.

Referenced by compute_potential().


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