simsopt.util package
Submodules
simsopt.util.constants module
simsopt.util.fourier_interpolation module
This module contains a subroutine for spectrally accurate interpolation of data that is known on a uniform grid in a periodic domain.
- simsopt.util.fourier_interpolation.fourier_interpolation(fk, x)
Interpolate data that is known on a uniform grid in [0, 2pi).
This routine is based on the matlab routine fourint.m in the DMSuite package by S.C. Reddy and J.A.C. Weideman, available at http://www.mathworks.com/matlabcentral/fileexchange/29 or here: http://dip.sun.ac.za/~weideman/research/differ.html
- Parameters:
fk – Vector of y-coordinates of data, at equidistant points x(k) = (k-1)*2*pi/N, k = 1…N
x – Vector of x-values where interpolant is to be evaluated.
- Returns:
Array of length
len(x)
with the interpolated values.
simsopt.util.logger module
- simsopt.util.logger.initialize_logging(filename: str | None = None, level: str | None = None, mpi: bool = False) None
Initializes logging in a simple way for both serial and MPI jobs. The MPI logging uses MPILogger package.
- Parameters:
filename – Name of file to store the logging info
level – Logging level. Could be ‘INFO’, ‘DEBUG’, ‘WARNING’, etc.
mpi – If True MPI logging is used provided mpi4py is installed.
simsopt.util.mpi module
This module contains the MpiPartition
class.
This module should be completely self-contained, depending only on mpi4py and numpy, not on any other simsopt components.
- simsopt.util.mpi.log(level: int = 20)
Turn on logging. If MPI is available, the processor number will be added to all logging entries.
- Parameters:
level – Typically
logging.INFO
for regular output, orlogging.DEBUG
for more extensive output.