Clipper
Public Member Functions | Protected Attributes | List of all members
clipper::FFTmap Class Reference

FFTmap: P1 map with symmetry used for calculating FFTs. More...

#include <fftmap.h>

Inheritance diagram for clipper::FFTmap:
clipper::FFTmap_p1

Public Member Functions

 FFTmap ()
 Null constructor. More...
 
 FFTmap (const Spacegroup &spacegroup, const Cell &cell, const Grid_sampling grid_sam, const FFTtype type=Default)
 Constructor: takes spacegroup, cell, grid. More...
 
void init (const Spacegroup &spacegroup, const Cell &cell, const Grid_sampling grid_sam, const FFTtype type=Default)
 initialiser More...
 
void reset ()
 Reset. More...
 
const Cellcell () const
 get the cell
 
const Spacegroupspacegroup () const
 get the spacegroup
 
const Grid_samplinggrid_sampling () const
 get the cell grid
 
void fft_h_to_x ()
 Transform to real space. More...
 
void fft_x_to_h ()
 Transform to reciprocal space. More...
 
template<class T >
void get_recip_data (const HKL &rfl, datatypes::F_phi< T > &fphi) const
 get reciprocal space data More...
 
template<class T >
void set_recip_data (const HKL &rfl, const datatypes::F_phi< T > &fphi)
 set reciprocal space data More...
 
template<class T >
void get_real_data (const Coord_grid &c, T &datum) const
 get real space data More...
 
template<class T >
void set_real_data (const Coord_grid &c, const T &datum)
 set real space data More...
 
datatypes::F_phi< ffttype > get_recip_data (const HKL &rfl) const
 get reciprocal space data (No error checking) More...
 
const ffttype & get_real_data (const Coord_grid &c) const
 get real space data (No error checking) More...
 
template<class H , class X >
void fft_rfl_to_map (const H &h, X &x)
 calculate map-like object from reflection-like object More...
 
template<class H , class X >
void fft_map_to_rfl (const X &x, H &h)
 calculate reflection-like object from map-like object More...
 
void debug () const
 

Protected Attributes

Cell cell_
 unit cell
 
Spacegroup spacegroup_
 spacegroup
 
std::vector< Isymopisymop
 Integerised symops.
 

Detailed Description

FFTmap: P1 map with symmetry used for calculating FFTs.

The FFTmap is represented in P1 in memory. However, it also has a spacegroup, and the contained data remains consistent with this spacegroup at all times. It has three states - unassigned, real-space, and reciprocal space. In real space it contains real map data. In reciprocal space it holds a hemisphere of complex structure factors, with the Friedels duplicated on the zero section.

The user should be able to ignore all the issues of spacegroup symmetry, Friedel opposites, and storage order.

Constructor & Destructor Documentation

clipper::FFTmap::FFTmap ( )

Null constructor.

For later initialisation: see init()

clipper::FFTmap::FFTmap ( const Spacegroup spacegroup,
const Cell cell,
const Grid_sampling  grid_sam,
const FFTtype  type = Default 
)

Constructor: takes spacegroup, cell, grid.

Construct an FFTmap for a given spacegroup, cell, and grid. The map values are initialised to zero.

The FFTmap is initially in neither real nor reciprocal spce, however as soon as one of the 'set' methods is called, it will be defined as in either real or reciprocal space until the next fft.

Parameters
spacegroupThe spacegroup.
cellThe cell, used for scaling.
grid_samThe grid sampling of the unit cell.
precalcPerform slow precalculation to get faster FFT. (default: no)

Member Function Documentation

void clipper::FFTmap::init ( const Spacegroup spacegroup,
const Cell cell,
const Grid_sampling  grid_sam,
const FFTtype  type = Default 
)

initialiser

Initialise an FFTmap for a given spacegroup, cell, and grid. The map values are initialised to zero.

The FFTmap is initially in neither real nor reciprocal spce, however as soon as one of the 'set' methods is called, it will be defined as in either real or reciprocal space until the next fft.

Parameters
spacegroupThe spacegroup.
cellThe cell, used for scaling.
grid_samThe grid sampling of the unit cell.
precalcPerform slow precalculation to get faster FFT. This adds a penalty of about 4s on Linux for the first FFT of any grid and direction. Subsequent FFTs will be faster. Set to true for programs which will use many FFTs. default: false.
void clipper::FFTmap::reset ( )

Reset.

Reset the space and zero all the data, if necessary.

void clipper::FFTmap::fft_h_to_x ( )

Transform to real space.

The data is transformed from recirocal to real space. A scale factor of 1/v (where v is the cell volume) is applied. If the FFTmap is already in real space, no action is taken.

void clipper::FFTmap::fft_x_to_h ( )

Transform to reciprocal space.

The data is transformed from real to recirocal space. A scale factor of v/n (where v is the cell volume and n the number of grid points) is applied. If the FFTmap is already in reciproal space, no action is taken.

template<class T >
void clipper::FFTmap::get_recip_data ( const HKL rfl,
datatypes::F_phi< T > &  fphi 
) const

get reciprocal space data

The data value for the given HKL, or the conjugate of its Friedel opposite if required, is returned. The symmetry related copies of the data are ignored.

Parameters
rflThe HKL of the data to be returned.
fphiThe value, as a magnitude and phase of type ffttype
template<class T >
template void clipper::FFTmap::set_recip_data< ftype64 > ( const HKL rfl,
const datatypes::F_phi< T > &  fphi 
)

set reciprocal space data

The data value for the given HKL, or the conjugate of its Friedel opposite if required, is set. All the symmetry related copies of the data, and any Friedel copies in the zero section, are also set.

Parameters
rflThe HKL of the data to be set.
fphiThe value, as a magnitude and phase of type ffttype
template<class T >
void clipper::FFTmap::get_real_data ( const Coord_grid c,
T &  datum 
) const

get real space data

The data value for the given grid coordinate is returned. Symmetry related copies are ignored.

Parameters
cThe coordinate of the data to be returned.
datumThe value of the data.
template<class T >
template void clipper::FFTmap::set_real_data< ftype64 > ( const Coord_grid c,
const T &  datum 
)

set real space data

The data value for the given grid coordinate is set. All the symmetry related copies of the data are also set.

Parameters
cThe coordinate of the data to be set.
datumThe value of the data.
datatypes::F_phi< ffttype > clipper::FFTmap::get_recip_data ( const HKL rfl) const

get reciprocal space data (No error checking)

No error is produced if the space is wrong.

Parameters
rflThe HKL of the data to be returned.
Returns
The value, as magnitude and phase of type ffttype
const ffttype & clipper::FFTmap::get_real_data ( const Coord_grid c) const
inline

get real space data (No error checking)

No error is produced if the space is wrong.

Parameters
cThe grid coordinate of the data to be returned.
Returns
The value, as type ffttype
template<class H , class X >
void clipper::FFTmap::fft_rfl_to_map ( const H &  h,
X &  x 
)

calculate map-like object from reflection-like object

Fill this FFTmap object from a reflection object, transform it, and fill the given map object from the FFTmap. This will work for any reflection data object which implements a HKL_reference_index, and every map data object which implements a Map_reference_index.

For the results to be sensible, the spacegroup, cell and grids should match. (The map will be zeroed if necessary).

Parameters
hThe source reflection data object.
xThe target map object.
template<class H , class X >
void clipper::FFTmap::fft_map_to_rfl ( const X &  x,
H &  h 
)

calculate reflection-like object from map-like object

Fill this FFTmap object from a map object, transform it, and fill the given reflection object from the FFTmap. This will work for any reflection data object which implements a HKL_reference_index, and every map data object which implements a Map_reference_index.

For the results to be sensible, the spacegroup, cell and grids should match. (The map will be zeroed if necessary).

Parameters
xThe source map object.
hThe target reflection data object.

The documentation for this class was generated from the following files: