PlasmaCalcs.hookups.copapic.copapic_dimensions.CopapicNeutral
- class PlasmaCalcs.hookups.copapic.copapic_dimensions.CopapicNeutral(m, *, name='neutral', i=0, vth=None, v0=None)
Bases:
Fluidinfo about the neutral fluids, in Copapic.[raw] units system; numerical values match input deck.- m: number
- mass of neutral fluid particle.
- name: str, default ‘neutral’
- name of the neutral fluid.
- i: int, default 0
- Copapic dist that this neutral fluid is associated with.
- vth: None or number
- thermal velocity of the neutral fluid. None –> unknown.
- v0: None or number
- drift velocity of the neutral fluid. None –> unknown.
- __init__(m, *, name='neutral', i=0, vth=None, v0=None)
Methods
__init__(m, *[, name, i, vth, v0])copy(**kw_init)deserialize(serial)from_dict(d)get_v0([x])get_vth([x])is_ion()register_type(cls_to_register[, ...])to_dict()with_i(i)Attributes
SERIAL_TYPESndimprecisionsize- copy(**kw_init)
- return a copy of self. Can provide new kwargs here to override old values in result.E.g. self.copy(i=7) makes a copy of self but with i=7 instead of self.i.
- static deserialize(serial)
- creates an XarrayIoSerializable object from a serialized representation.
- serial: dict or str
- str –> convert to dict via ast.literal_eval.dict must contain ‘typename’ key.
The output here will be an instance of XarrayIoSerializable.SERIAL_TYPES[typename]
- equal_except_i(v)
- returns whether self == v (another DimensionValue), ignoring i.equal if v is an instance of type(self) andall kw from both self._kw_eq and v._kw_eq have the same values.(any kw missing attrs will be treated as UNSET.)For DimensionValue: self.s==v.s and self.i==v.i. Subclasses may add more.
- classmethod from_dict(d)
- return cls from dict d.If ‘d’ contains ‘typename’, result is like cls.deserialize(d) instead,however, first require that result is an instance of cls (or subclass of cls).E.g. Fluid.from_dict(dict(typename=’EppicDist’, …)) returns EppicDist,but Snap.from_dict(dict(typename=’EppicDist’, …)) crashes with InputError.Subclasses wishing to alter deserialize behavior will probably override this method instead.
- get_v0(x=None)
- returns drift velocity, as a tuple of (vx, vy, xz) values,or the x component if x provided (x should be a string if provided).if self.v0 is None, raise InputMissingError.
- property get_v0d
- alias to self.get_v0. Provides interface consistency with CopapicDist.get_v0d.
note: neutral v0 doesn’t vary with time.
- get_vth(x=None)
- returns thermal velocity, as a tuple of (vx, vy, xz) values,or the x component if x provided (x should be a string if provided).(Note that for neutrals, vth is the same for all 3 components.)if self.vth is None, raise InputMissingError.
- property get_vth0
- alias to self.get_vth. Provides interface consistency with CopapicDist.get_vth0.
note: neutral vth is the same for all 3 components, and doesn’t vary with time.
- is_charged()
- tells whether self is a charged fluid. i.e. self.q != 0.if self.q is None, returns None instead of bool.
- is_electron()
- tells whether self is an electron. i.e. self.q < 0.if self.q is None, returns None instead of bool.
- is_ion()
- tells whether self is an ion. i.e. self.q > 0.if self.q is None, returns None instead of bool.
- is_neutral()
- tells whether self is a neutral fluid. i.e. self.q == 0.if self.q is None, returns None instead of bool.
- lookup_dict()
- returns dict for looking up self within a DimensionValueList, given int, str, or self.(used by DimensionValueList.lookup_dict)
- property name
- alias to s
- static register_type(cls_to_register, _serial_typename=None)
- register cls_to_register as a serializable subclass of XarrayIoSerializable.
- _serial_typename: str or None
- name to use for serialization. if None, use cls_to_register.__name__.
- serialize()
- return dict of info about self, including ‘typename’ key.
- to_dict()
- return dictionary of info about self. Attribute values for keys in self._kw_def.e.g. if _kw_def={‘s’, ‘i’}: result = {‘s’: self.s, ‘i’: self.i}
- with_i(i)
- return copy of self with i=i, or self if self.i==i already.