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.Methods
__getitem__(key)return self.params[key] if key in self.params, else self.dists[key].
__iter__()raises TypeError; use .keys(), .values(), or .items() instead.
from_file([filename, dist_names])return EppicInputDeck from eppic.i file.
get(key[, default])return self[key].
get_coord(xstr)get coordinate array [raw units] for this dimension.
get_dspace(xstr)get d{x} [raw units] between output cells.
return max of self.Dx, self.Dy, self.Dz.
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.
return dict of {x: xcoord array} for x in self.maindims(), a subset of ('x', 'y', 'z').
get_units_manager(*[, u_l, u_t, u_n, ne_si])return UnitsManagerPIC for this input deck.
get_velocity_nspace(xstr, N)get number of cells in {vx} dimension.
return whether this input deck is in quasineutral mode.
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.
values()return tuple of values corresponding to self.keys().
_get_nspace_simple(xstr)get "simple" number of cells in {x} dimension.
_get_velocity_extents(xstr, N)get (p{vx}min{N}, p{vx}max{N}) [raw units].
_get_velocity_nspace_simple(xstr, N)get "simple" number of cells in {vx} dimension.
sets self.neutral and self.neutrals based on params of self.
Attributes
dx between adjacent output cells [raw units]
dy between adjacent output cells [raw units]
dz between adjacent output cells [raw units]
list of actual total numbers of grid cells in the vx dimension (ordered by distribution).
list of actual total numbers of grid cells in the vy dimension (ordered by distribution).
list of actual total numbers of grid cells in the vz dimension (ordered by distribution).
actual total number of grid cells in the x dimension.
actual total number of grid cells in the y dimension.
actual total number of grid cells in the z dimension.
os.path.dirname(self.filename).
alias to distributions
- 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.
- __getitem__(key)
return self.params[key] if key in self.params, else self.dists[key].
- __iter__()
raises TypeError; use .keys(), .values(), or .items() instead.
- _get_nspace_simple(xstr)
get “simple” number of cells in {x} dimension. == n{x} // nout_avg
xstr should be ‘x’, ‘y’, or ‘z’.Note that for x=’x’, actual number of cells may be affected by nsubdomains.See also: self._get_nspace.
- _get_velocity_extents(xstr, N)
get (p{vx}min{N}, p{vx}max{N}) [raw units].
N is the distribution number.See also: Dvx, Dvy, Dvz.
- _get_velocity_nspace_simple(xstr, N)
get “simple” number of cells in {vx} dimension. == pn{vx}{N}
xstr should be ‘vx’, ‘vy’, or ‘vz’.N is the distribution number.Note that for x=’x’, actual number of cells may be affected by nsubdomains.See also: self.get_nspace.
- _init_neutral_fluid()
sets self.neutral and self.neutrals based on params of self.
Particularly, uses params[‘m_neutral’].
- 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().