PlasmaCalcs.hookups.eppic.eppic_input_deck.EppicInputDeck
- class PlasmaCalcs.hookups.eppic.eppic_input_deck.EppicInputDeck(params, distributions, *, filename=None, **kw_super)
Bases:
DictlikeFromKeysAndGetiteminfo from eppic.i file, in a class.Use EppicInputDeck.from_file() to create an instance from a file.units are “raw”. Numerical values equal those from the eppic.i file.- params: dict
- values of params
- distributions: dict or EppicDistList
- dict of {distribution number: EppicDist}, or an already-created EppicDistList.if dict, will be internally stored as EppicDistList.from_dict(distributions), instead.
- filename: None or str
- path to eppic.i file this came from. E.g. ‘path/to/eppic.i’str will be internally stored as os.path.abspath(filename), instead.
Examples:eid = EppicInputDeck.from_file(‘eppic.i’)eid[1] # EppicDist for distribution 1eid[‘nz’] # number of grid points in z directioneid.params # dict of all global paramseid.dists # EppicDistList of all the distributionseid.dists.get(‘e’) # get EppicDist with name ‘e’eid.dists.get(0) # get EppicDist number 0 from this listeid[2][‘m’] # mass parameter for distribution 2eid[0][‘coll_rate’] # collision rate parameter for distribution 0eid.keys() # available keyseid.items() # available (key, value) pairseid[0].keys() # available keys for distribution 0eid.get(‘k’, 7) # eid[‘k’] if it exists, else 7.- __init__(params, distributions, *, filename=None, **kw_super)
Methods
__init__(params, distributions, *[, filename])from_file([filename, dist_names])get(key[, default])get_coord(xstr)get_dspace(xstr)get_nspace(xstr)get_units_manager(*[, u_l, u_t, u_n, ne_si])get_velocity_nspace(xstr, N)items()keys()maindims()values()Attributes
- property Dx
- dx between adjacent output cells [raw units]
- property Dy
- dy between adjacent output cells [raw units]
- property Dz
- dz between adjacent output cells [raw units]
- property Nvx
- list of actual total numbers of grid cells in the vx dimension (ordered by distribution).
- property Nvy
- list of actual total numbers of grid cells in the vy dimension (ordered by distribution).
- property Nvz
- list of actual total numbers of grid cells in the vz dimension (ordered by distribution).
- property Nx
- actual total number of grid cells in the x dimension.
- property Ny
- actual total number of grid cells in the y dimension.
- property Nz
- actual total number of grid cells in the z dimension.
- property dirname
- os.path.dirname(self.filename).if self.filename is None, raise FileNotFoundError.
- property dists
- alias to distributions
- dlist_type
alias of
EppicDistList
- classmethod from_file(filename='eppic.i', *, dist_names=None, **kw__init)
- return EppicInputDeck from eppic.i file.
- filename: str
- path to eppic.i file.abspath(filename) will be saved to result, for easier bookkeeping.
- dist_names: None or dict
- {N: name for distribution N} for any number of distributions in filename.None –> infer from file.
- get(key, default=UNSET)
- return self[key]. if default is provided and self[key] doesn’t exist, return default.
- get_coord(xstr)
- get coordinate array [raw units] for this dimension.
- xstr: str
- dimension name. ‘x’, ‘y’, or ‘z’.
- get_dspace(xstr)
- get d{x} [raw units] between output cells.accounts for nout_avg; see also: Dx, Dy, Dz.if {x} not provided in self (e.g. 2D in x & y, xstr=’z’), returns 1 * nout_avg.
- get_dspace_max()
- return max of self.Dx, self.Dy, self.Dz.
- get_dspace_min()
- return min of self.Dx, self.Dy, self.Dz.
- get_nspace(xstr)
- get number of cells in {x} dimension, accounting for nout_avg and nsubdomains.See also: Nx, Ny, Nz.
- get_space_coords()
- return dict of {x: xcoord array} for x in self.maindims(), a subset of (‘x’, ‘y’, ‘z’).
- get_units_manager(*, u_l=None, u_t=None, u_n=None, ne_si=None, **kw_u_from_pic)
- return UnitsManagerPIC for this input deck. Assumes distribution 0 is electrons.Must provide u_l, u_t, u_n, or ne_si.Will read ne, qe, me, and eps0 from the input deck, unless they are provided in kw_u_from_pic.See help(UnitsManagerPIC.pic_ambiguous_unit) for details.
- get_velocity_nspace(xstr, N)
- get number of cells in {vx} dimension.N is the distribution number.See also: Nvx, Nvy, Nvz.
- is_quasineutral()
- return whether this input deck is in quasineutral mode.as a proxy, guessing quasineutral iff any dist.is_hybrid() for dist in self.dists.
- items()
- return tuple of (key, value) pairs corresponding to self.keys() and self.values().
- keys()
- return tuple of keys to access self.dists or self.params
- maindims()
- returns tuple of main dimensions in this input deck.inferred from self[‘nx’], ‘ny’, ‘nz’, and ‘ndim_space’
- neutral_type
alias of
EppicNeutral
- nlist_type
alias of
EppicNeutralList
- values()
- return tuple of values corresponding to self.keys().