implementations.problem_classes.generic_MPIFFT_Laplacian module¶
- class IMEX_Laplacian_MPIFFT(nvars=None, spectral=False, L=6.283185307179586, alpha=1.0, comm=mpi4py.MPI.COMM_WORLD, dtype='d', useGPU=False, x0=0.0)[source]¶
Bases:
Problem
Generic base class for IMEX problems using a spectral method to solve the Laplacian implicitly and a possible rest explicitly. The FFTs are done with``mpi4py-fft`` [1].
- Parameters:
nvars (tuple, optional) – Spatial resolution
spectral (bool, optional) – If True, the solution is computed in spectral space.
L (float, optional) – Denotes the period of the function to be approximated for the Fourier transform.
alpha (float, optional) – Multiplicative factor before the Laplacian
comm (MPI.COMM_World) – Communicator for parallelisation.
- fft¶
Object for parallel FFT transforms.
- Type:
PFFT
- X¶
Grid coordinates in real space.
- Type:
mesh-grid
- K2¶
Laplace operator in spectral space.
- Type:
matrix
References
- dtype_f¶
alias of
imex_mesh
- dtype_u¶
alias of
mesh
- eval_f(u, t)[source]¶
Routine to evaluate the right-hand side of the problem.
- Parameters:
u (dtype_u) – Current values of the numerical solution.
t (float) – Current time at which the numerical solution is computed.
- Returns:
f – The right-hand side of the problem.
- Return type:
dtype_f
- fft_backend = 'fftw'¶
- fft_comm_backend = 'MPI'¶
- solve_system(rhs, factor, u0, t)[source]¶
Simple FFT solver for the diffusion part.
- Parameters:
rhs (dtype_f) – Right-hand side for the linear system.
factor (float) – Abbrev. for the node-to-node stepsize (or any other factor required).
u0 (dtype_u) – Initial guess for the iterative solver (not used here so far).
t (float) – Current time (e.g. for time-dependent BCs).
- Returns:
me – The solution as mesh.
- Return type:
dtype_u
- xp = <module 'numpy' from '/home/runner/micromamba/envs/pySDC/lib/python3.12/site-packages/numpy/__init__.py'>¶