PICurv 0.1.0
A Parallel Particle-In-Cell Solver for Curvilinear LES
 
Loading...
Searching...
No Matches
Namespaces | Functions | Variables
periodic_spectral.py File Reference

Fourier machinery for the uniform periodic axes of PICurv's Cartesian grids. More...

Go to the source code of this file.

Namespaces

namespace  picurv_cli
 
namespace  picurv_cli.periodic_spectral
 

Functions

 picurv_cli.periodic_spectral.drop_imported_package (str package_name)
 Remove a failed/partial import package tree from sys.modules.
 
 picurv_cli.periodic_spectral.prune_incompatible_python_site_paths (paths)
 Remove site-package paths for a different Python major/minor version.
 
 picurv_cli.periodic_spectral.require_numpy ()
 Import NumPy on first use, retrying without other Pythons' site-packages.
 
 picurv_cli.periodic_spectral.validate_spectral_grid (nodes, transform_axes=(0, 1, 2), subject="spectra require")
 Validate the uniform axis-aligned Cartesian grid an FFT on periodic axes requires.
 
 picurv_cli.periodic_spectral.spectral_symbols (cells_kji, lengths_xyz)
 Build continuum and centered-discrete Fourier symbols.
 
 picurv_cli.periodic_spectral._resample_axis (values, storage_axis, target_count, length, shift)
 Move one periodic axis of an array of samples to another uniform resolution.
 
 picurv_cli.periodic_spectral.filter_transfer (continuum_symbols, filter_spec)
 Transfer function of a resampling filter on the target grid's wavenumbers.
 
 picurv_cli.periodic_spectral.fourier_resample (values, target_cells_kji, lengths_xyz, source_first_xyz, target_first_xyz, filter_spec=None)
 Resample a triply periodic vector field onto another uniform grid, optionally filtered.
 

Variables

 picurv_cli.periodic_spectral._SITE_PYTHON_VERSION = re.compile(r"python(?:-)?(\d+)\.(\d+)", re.IGNORECASE)
 
 picurv_cli.periodic_spectral._NUMPY_MODULE = None
 
tuple picurv_cli.periodic_spectral.RESAMPLE_FILTERS = ("none", "sharp", "gaussian", "box")
 

Detailed Description

Fourier machinery for the uniform periodic axes of PICurv's Cartesian grids.

Shared by ic.gen, which synthesizes and resamples initial conditions, and spectra.gen, which measures spectra; both load it from picurv_cli/. Both need the same answer to three questions: which axes may be transformed, what the continuum and PICurv-discrete wavenumbers are, and how a periodic field is moved between resolutions. Arrays are in PICurv storage order, [k, j, i, component]; lengths and wavenumbers are in Cartesian x, y, z order. Every function imports NumPy through require_numpy(), so importing this module never imports NumPy itself; that import, with its retry, is defined here once for the conductor and every generator.

Definition in file periodic_spectral.py.