pyrokinetics.gk_code.neo.GKInputNEO#
- class pyrokinetics.gk_code.neo.GKInputNEO(filename=None)[source]#
Bases:
GKInput,FileReaderClass that can read NEO input files, and produce Numerics, LocalSpecies, and LocalGeometry objects
Methods
__init__([filename])add_flags(flags)Add extra flags to NEO input file
from_file(path[, file_type])Read a file from disk, returning an instance of this class.
from_str(input_string)Returns local geometry.
Load Fourier object from NEO file
Load Miller object from NEO file
Load MXH object from NEO file
Load LocalSpecies object from NEO file
Gather numerical info (grid spacing, time steps, etc)
get_pyro_neo_species([iSp])get_reference_values(local_norm)Reads in reference values from input file
is_linear()Return true if the GKCode is nonlinear, otherwise return False
parse_neo(lines)Given lines of a neo file or a string split by '/n', return a dict of NEO input data
read_dict(input_dict[, detect_norm])Reads GENE input file given as dict Uses default read_dict, which assumes input is a dict
read_from_file(filename[, detect_norm])Reads NEO input file into a dictionary
read_str(input_string[, detect_norm])Reads NEO input file given as string
set(local_geometry, local_species, numerics)Set self.data using LocalGeometry, LocalSpecies, and Numerics.
supported_file_types()Returns a list of all registered file types.
verify_expected_keys(filename, keys)Checks that the expected keys are present at the top level of self.data.
verify_file_type(filename)Ensure this file is a valid neo input file, and that it contains sufficient info for Pyrokinetics to work with
write(filename[, float_format, local_norm, ...])Writes self.data to an input file
Attributes
Conventionused for normalising this code's quantities- code_name = 'NEO'#
- default_file_name = 'input.neo'#
- file_type: ClassVar[str] = 'NEO'#
- get_local_geometry()[source]#
Returns local geometry. Delegates to more specific functions
- Return type:
- get_reference_values(local_norm)[source]#
Reads in reference values from input file
- Return type:
- Parameters:
local_norm (SimulationNormalisation)
- neo_eq_types = {1: 'SAlpha', 2: 'MXH', 3: 'Fourier'}#
- norm_convention: str = 'neo'#
Conventionused for normalising this code’s quantities
- static parse_neo(lines)[source]#
Given lines of a neo file or a string split by ‘/n’, return a dict of NEO input data
- pyro_neo_fourier = {'Rmaj': 'RMAJ_OVER_A', 'Z0': 'ZMAG_OVER_A', 'beta_prime': 'BETA_STAR', 'bt_ccw': 'BTCCW', 'dZ0dr': 'S_ZMAG', 'delta': 'DELTA', 'ip_ccw': 'IPCCW', 'kappa': 'KAPPA', 'q': 'Q', 'rho': 'RMIN_OVER_A', 's_delta': 'S_DELTA', 's_kappa': 'S_KAPPA', 'shat': 'SHEAR', 'shift': 'SHIFT'}#
- pyro_neo_fourier_defaults = {'Rmaj': 3.0, 'Z0': 0.0, 'bt_ccw': -1.0, 'dZ0dr': 0.0, 'delta': 0.0, 'ip_ccw': -1.0, 'kappa': 1.0, 'q': 2.0, 'rho': 0.5, 's_delta': 0.0, 's_kappa': 0.0, 'shat': 1.0, 'shift': 0.0}#
- pyro_neo_miller = {'Rmaj': 'RMAJ_OVER_A', 'Z0': 'ZMAG_OVER_A', 'beta_prime': 'BETA_STAR', 'bt_ccw': 'BTCCW', 'dZ0dr': 'S_ZMAG', 'delta': 'DELTA', 'ip_ccw': 'IPCCW', 'kappa': 'KAPPA', 'q': 'Q', 'rho': 'RMIN_OVER_A', 's_delta': 'S_DELTA', 's_kappa': 'S_KAPPA', 'shat': 'SHEAR', 'shift': 'SHIFT'}#
- pyro_neo_miller_defaults = {'Rmaj': 3.0, 'Z0': 0.0, 'bt_ccw': -1.0, 'dZ0dr': 0.0, 'delta': 0.0, 'ip_ccw': -1.0, 'kappa': 1.0, 'q': 2.0, 'rho': 0.5, 's_delta': 0.0, 's_kappa': 0.0, 'shat': 1.0, 'shift': 0.0}#
- pyro_neo_mxh = {'Rmaj': 'RMAJ_OVER_A', 'Z0': 'ZMAG_OVER_A', 'beta_prime': 'BETA_STAR', 'bt_ccw': 'BTCCW', 'cn0': 'SHAPE_COS0', 'cn1': 'SHAPE_COS1', 'cn2': 'SHAPE_COS2', 'cn3': 'SHAPE_COS3', 'cn4': 'SHAPE_COS4', 'cn5': 'SHAPE_COS5', 'cn6': 'SHAPE_COS6', 'dZ0dr': 'S_ZMAG', 'dcndr0': 'SHAPE_S_COS0', 'dcndr1': 'SHAPE_S_COS1', 'dcndr2': 'SHAPE_S_COS2', 'dcndr3': 'SHAPE_S_COS3', 'dcndr4': 'SHAPE_S_COS4', 'dcndr5': 'SHAPE_S_COS5', 'dcndr6': 'SHAPE_S_COS6', 'delta': 'DELTA', 'dsndr3': 'SHAPE_S_SIN3', 'dsndr4': 'SHAPE_S_SIN4', 'dsndr5': 'SHAPE_S_SIN5', 'dsndr6': 'SHAPE_S_SIN6', 'ip_ccw': 'IPCCW', 'kappa': 'KAPPA', 'q': 'Q', 'rho': 'RMIN_OVER_A', 's_delta': 'S_DELTA', 's_kappa': 'S_KAPPA', 's_zeta': 'S_ZETA', 'shat': 'SHEAR', 'shift': 'SHIFT', 'sn3': 'SHAPE_SIN3', 'sn4': 'SHAPE_SIN4', 'sn5': 'SHAPE_SIN5', 'sn6': 'SHAPE_SIN6', 'zeta': 'ZETA'}#
- pyro_neo_mxh_defaults = {'Rmaj': 3.0, 'Z0': 0.0, 'bt_ccw': -1.0, 'cn0': 0.0, 'cn1': 0.0, 'cn2': 0.0, 'cn3': 0.0, 'cn4': 0.0, 'cn5': 0.0, 'cn6': 0.0, 'dZ0dr': 0.0, 'dcndr0': 0.0, 'dcndr1': 0.0, 'dcndr2': 0.0, 'dcndr3': 0.0, 'dcndr4': 0.0, 'dcndr5': 0.0, 'dcndr6': 0.0, 'delta': 0.0, 'dsndr3': 0.0, 'dsndr4': 0.0, 'dsndr5': 0.0, 'dsndr6': 0.0, 'ip_ccw': -1.0, 'kappa': 1.0, 'q': 2.0, 'rho': 0.5, 's_delta': 0.0, 's_kappa': 0.0, 's_zeta': 0.0, 'shat': 1.0, 'shift': 0.0, 'sn3': 0.0, 'sn4': 0.0, 'sn5': 0.0, 'sn6': 0.0, 'zeta': 0.0}#
- read_dict(input_dict, detect_norm=True)[source]#
Reads GENE input file given as dict Uses default read_dict, which assumes input is a dict
- set(local_geometry, local_species, numerics, local_norm=None, template_file=None, code_normalisation=None, **kwargs)[source]#
Set self.data using LocalGeometry, LocalSpecies, and Numerics. These may be obtained via another GKInput file, or from Equilibrium/Kinetics objects.
- Parameters:
local_geometry (LocalGeometry)
local_species (LocalSpecies)
numerics (Numerics)
local_norm (SimulationNormalisation | None)
code_normalisation (str | None)