ESPResSo 3.2.0-167-g2c9ead1-git
Extensible Simulation Package for Soft Matter Research
Functions | Variables
fft.c File Reference

Routines, row decomposition, data structures and communication for the 3D-FFT. More...

#include "fft.h"
#include <fftw3.h>
#include <mpi.h>
#include "communication.h"
#include "grid.h"
#include "fft-common.h"
Include dependency graph for fft.c:

Go to the source code of this file.

Functions

void * fftw_malloc (size_t n)
static void fft_forw_grid_comm (fft_forw_plan plan, double *in, double *out)
 communicate the grid data according to the given fft_forw_plan.
static void fft_back_grid_comm (fft_forw_plan plan_f, fft_back_plan plan_b, double *in, double *out)
 communicate the grid data according to the given fft_forw_plan/fft_bakc_plan.
void fft_pre_init ()
 Initialize fft data structure.
int fft_init (double **data, int *ca_mesh_dim, int *ca_mesh_margin, int *global_mesh_dim, double *global_mesh_off, int *ks_pnum)
 Initialize everything connected to the 3D-FFT.
void fft_perform_forw (double *data)
 perform the forward 3D FFT.
void fft_perform_back (double *data)
 perform the backward 3D FFT.

Variables

fft_data_struct fft

Detailed Description

Routines, row decomposition, data structures and communication for the 3D-FFT.

Definition in file fft.c.


Function Documentation

void fft_back_grid_comm ( fft_forw_plan  plan_f,
fft_back_plan  plan_b,
double *  in,
double *  out 
) [static]

communicate the grid data according to the given fft_forw_plan/fft_bakc_plan.

Parameters:
plan_fcommunication plan (see fft_forw_plan).
plan_badditional back plan (see fft_back_plan).
ininput mesh.
outoutput mesh.

Definition at line 436 of file fft.c.

References comm_cart, fft_forw_plan::element, fft_unpack_block(), fft_forw_plan::g_size, fft_forw_plan::group, i, MPI_DOUBLE, MPI_Recv(), MPI_Send(), fft_forw_plan::new_mesh, fft_forw_plan::old_mesh, fft_back_plan::pack_function, fft_forw_plan::recv_block, fft_data_struct::recv_buf, fft_forw_plan::recv_size, REQ_FFT_BACK, fft_forw_plan::send_block, fft_data_struct::send_buf, fft_forw_plan::send_size, and this_node.

Referenced by fft_perform_back().

void fft_forw_grid_comm ( fft_forw_plan  plan,
double *  in,
double *  out 
) [static]
int fft_init ( double **  data,
int *  ca_mesh_dim,
int *  ca_mesh_margin,
int *  global_mesh_dim,
double *  global_mesh_off,
int *  ks_pnum 
)

Initialize everything connected to the 3D-FFT.

Returns:
Maximal size of local fft mesh (needed for allocation of ca_mesh).
Parameters:
dataPointer Pounter to data array.
ca_mesh_dimPointer to local CA mesh dimensions.
ca_mesh_marginPointer to local CA mesh margins.
global_mesh_dimPointer to global CA mesh dimensions.
global_mesh_offPointer to global CA mesh offset.
ks_pnumPointer to number of permutations in k-space.

Definition at line 66 of file fft.c.

References fft_data_struct::back, calc_2d_grid(), fft_data_struct::data_buf, fft_forw_plan::dir, fft_back_plan::dir, fft_forw_plan::element, errexit(), fft_calc_local_mesh(), fft_calc_send_block(), fft_find_comm_groups(), fft_forw_plan::fft_function, fft_back_plan::fft_function, fft_pack_block(), fft_pack_block_permute1(), fft_pack_block_permute2(), fft_print_fft_plan(), FFT_TRACE, FFTW_FAILURE, fftw_malloc(), fft_forw_plan::fftw_plan, fft_back_plan::fftw_plan, free, fft_forw_plan::g_size, get_linear_index(), fft_forw_plan::group, i, fft_data_struct::init_tag, malloc, map_3don2d_grid(), map_node_array(), fft_data_struct::max_comm_size, fft_data_struct::max_mesh_size, fft_forw_plan::n_ffts, n_nodes, fft_forw_plan::n_permute, fft_forw_plan::new_mesh, fft_forw_plan::new_size, node_grid, node_pos, fft_forw_plan::old_mesh, fft_forw_plan::pack_function, fft_back_plan::pack_function, permute_ifield(), fft_data_struct::plan, realloc, fft_forw_plan::recv_block, fft_data_struct::recv_buf, fft_forw_plan::recv_size, fft_forw_plan::row_dir, fft_forw_plan::send_block, fft_data_struct::send_buf, fft_forw_plan::send_size, fft_forw_plan::start, and this_node.

Referenced by p3m_init().

void fft_perform_back ( double *  data)

perform the backward 3D FFT.

Warning:
The content of data is overwritten.
Parameters:
dataMesh.

Definition at line 361 of file fft.c.

References fft_data_struct::back, fft_data_struct::data_buf, fft_back_grid_comm(), FFT_TRACE, fft_back_plan::fftw_plan, i, fft_forw_plan::new_size, fft_data_struct::plan, and this_node.

Referenced by p3m_calc_kspace_forces().

void fft_perform_forw ( double *  data)

perform the forward 3D FFT.

The assigned charges are in data. The result is also stored in data.

Warning:
The content of data is overwritten.
Parameters:
dataMesh.

Definition at line 308 of file fft.c.

References fft_data_struct::data_buf, fft_forw_grid_comm(), FFT_TRACE, fft_forw_plan::fftw_plan, i, fft_forw_plan::new_size, fft_data_struct::plan, and this_node.

Referenced by p3m_calc_kspace_forces(), and p3m_calc_kspace_stress().

void fft_pre_init ( )

Initialize fft data structure.

Definition at line 62 of file fft.c.

References fft_common_pre_init().

Referenced by p3m_pre_init().

void* fftw_malloc ( size_t  n)

Variable Documentation