yt.frontends.amrex.fields module¶
- class yt.frontends.amrex.fields.BoxlibFieldInfo(ds, field_list: list[tuple[str, str]], slice_info=None)[source]¶
Bases:
FieldInfoContainer
- add_deprecated_field(name, function, sampling_type, since, removal=None, ret_name=None, **kwargs)¶
Add a new field which is deprecated, along with supplemental metadata, to the list of available fields. This respects a number of arguments, all of which are passed on to the constructor for
DerivedField
.- Parameters:
name (str) – is the name of the field.
function (callable) – A function handle that defines the field. Should accept arguments (field, data)
sampling_type (str) – “cell” or “particle” or “local”
since (str) – The version string marking when this field was deprecated.
removal (str) – The version string marking when this field will be removed.
ret_name (str) – The name of the field which will actually be returned, used only by
alias()
.units (str) – A plain text string encoding the unit. Powers must be in python syntax (** instead of ^). If set to “auto” the units will be inferred from the return value of the field function.
take_log (bool) – Describes whether the field should be logged
validators (list) – A list of
FieldValidator
objectsvector_field (bool) – Describes the dimensionality of the field. Currently unused.
display_name (str) – A name used in the plots
- add_field(name: tuple[str, str], function: Callable, sampling_type: str, *, alias: DerivedField | None = None, force_override: bool = False, **kwargs) None ¶
Add a new field, along with supplemental metadata, to the list of available fields. This respects a number of arguments, all of which are passed on to the constructor for
DerivedField
.- Parameters:
name (tuple[str, str]) – field (or particle) type, field name
function (callable) – A function handle that defines the field. Should accept arguments (field, data)
sampling_type (str) – “cell” or “particle” or “local”
force_override (bool) – If False (default), an error will be raised if a field of the same name already exists.
alias (DerivedField (optional):) – existing field to be aliased
units (str) – A plain text string encoding the unit. Powers must be in python syntax (** instead of ^). If set to “auto” the units will be inferred from the return value of the field function.
take_log (bool) – Describes whether the field should be logged
validators (list) – A list of
FieldValidator
objectsvector_field (bool) – Describes the dimensionality of the field. Currently unused.
display_name (str) – A name used in the plots
- add_output_field(name, sampling_type, **kwargs)¶
- alias(alias_name: tuple[str, str], original_name: tuple[str, str], units: str | None = None, deprecate: tuple[str, str | None] | None = None)¶
Alias one field to another field.
- Parameters:
units (str) – A plain text string encoding the unit. Powers must be in python syntax (** instead of ^). If set to “auto” the units will be inferred from the return value of the field function.
deprecate (tuple[str, str | None] | None) – If this is set, then the tuple contains two string version numbers: the first marking the version when the field was deprecated, and the second marking when the field will be removed.
- check_derived_fields(fields_to_check=None)¶
- clear() None. Remove all items from D. ¶
- copy()¶
- classmethod create_with_fallback(fallback, name='')¶
- fallback = None¶
- find_dependencies(loaded)¶
- classmethod fromkeys(iterable, value=None)¶
- get(k[, d]) D[k] if k in D, else d. d defaults to None. ¶
- has_key(key)¶
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- known_other_fields: tuple[tuple[str, tuple[str, list[str], str | None]], ...] = (('density', ('code_mass / code_length**3', ['density'], None)), ('eden', ('code_mass / (code_time**2 * code_length)', ['total_energy_density'], None)), ('xmom', ('code_mass / (code_time * code_length**2)', ['momentum_density_x'], None)), ('ymom', ('code_mass / (code_time * code_length**2)', ['momentum_density_y'], None)), ('zmom', ('code_mass / (code_time * code_length**2)', ['momentum_density_z'], None)), ('temperature', ('K', ['temperature'], None)), ('Temp', ('K', ['temperature'], None)), ('x_velocity', ('cm/s', ['velocity_x'], None)), ('y_velocity', ('cm/s', ['velocity_y'], None)), ('z_velocity', ('cm/s', ['velocity_z'], None)), ('xvel', ('cm/s', ['velocity_x'], None)), ('yvel', ('cm/s', ['velocity_y'], None)), ('zvel', ('cm/s', ['velocity_z'], None)))¶
- known_particle_fields: tuple[tuple[str, tuple[str, list[str], str | None]], ...] = (('particle_mass', ('code_mass', [], None)), ('particle_position_x', ('code_length', [], None)), ('particle_position_y', ('code_length', [], None)), ('particle_position_z', ('code_length', [], None)), ('particle_momentum_x', ('code_mass*code_length/code_time', [], None)), ('particle_momentum_y', ('code_mass*code_length/code_time', [], None)), ('particle_momentum_z', ('code_mass*code_length/code_time', [], None)), ('particle_angmomen_x', ('code_length**2/code_time', [], None)), ('particle_angmomen_y', ('code_length**2/code_time', [], None)), ('particle_angmomen_z', ('code_length**2/code_time', [], None)), ('particle_id', ('', ['particle_index'], None)), ('particle_mdot', ('code_mass/code_time', [], None)))¶
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair ¶
as a 2-tuple; but raise KeyError if D is empty.
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D ¶
- setup_extra_union_fields(ptype='all')¶
- setup_fluid_index_fields()¶
- setup_smoothed_fields(ptype, num_neighbors=64, ftype='gas')¶
- update([E, ]**F) None. Update D from mapping/iterable E and F. ¶
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values ¶
- class yt.frontends.amrex.fields.CastroFieldInfo(ds, field_list: list[tuple[str, str]], slice_info=None)[source]¶
Bases:
FieldInfoContainer
- add_deprecated_field(name, function, sampling_type, since, removal=None, ret_name=None, **kwargs)¶
Add a new field which is deprecated, along with supplemental metadata, to the list of available fields. This respects a number of arguments, all of which are passed on to the constructor for
DerivedField
.- Parameters:
name (str) – is the name of the field.
function (callable) – A function handle that defines the field. Should accept arguments (field, data)
sampling_type (str) – “cell” or “particle” or “local”
since (str) – The version string marking when this field was deprecated.
removal (str) – The version string marking when this field will be removed.
ret_name (str) – The name of the field which will actually be returned, used only by
alias()
.units (str) – A plain text string encoding the unit. Powers must be in python syntax (** instead of ^). If set to “auto” the units will be inferred from the return value of the field function.
take_log (bool) – Describes whether the field should be logged
validators (list) – A list of
FieldValidator
objectsvector_field (bool) – Describes the dimensionality of the field. Currently unused.
display_name (str) – A name used in the plots
- add_field(name: tuple[str, str], function: Callable, sampling_type: str, *, alias: DerivedField | None = None, force_override: bool = False, **kwargs) None ¶
Add a new field, along with supplemental metadata, to the list of available fields. This respects a number of arguments, all of which are passed on to the constructor for
DerivedField
.- Parameters:
name (tuple[str, str]) – field (or particle) type, field name
function (callable) – A function handle that defines the field. Should accept arguments (field, data)
sampling_type (str) – “cell” or “particle” or “local”
force_override (bool) – If False (default), an error will be raised if a field of the same name already exists.
alias (DerivedField (optional):) – existing field to be aliased
units (str) – A plain text string encoding the unit. Powers must be in python syntax (** instead of ^). If set to “auto” the units will be inferred from the return value of the field function.
take_log (bool) – Describes whether the field should be logged
validators (list) – A list of
FieldValidator
objectsvector_field (bool) – Describes the dimensionality of the field. Currently unused.
display_name (str) – A name used in the plots
- add_output_field(name, sampling_type, **kwargs)¶
- alias(alias_name: tuple[str, str], original_name: tuple[str, str], units: str | None = None, deprecate: tuple[str, str | None] | None = None)¶
Alias one field to another field.
- Parameters:
units (str) – A plain text string encoding the unit. Powers must be in python syntax (** instead of ^). If set to “auto” the units will be inferred from the return value of the field function.
deprecate (tuple[str, str | None] | None) – If this is set, then the tuple contains two string version numbers: the first marking the version when the field was deprecated, and the second marking when the field will be removed.
- check_derived_fields(fields_to_check=None)¶
- clear() None. Remove all items from D. ¶
- copy()¶
- classmethod create_with_fallback(fallback, name='')¶
- fallback = None¶
- find_dependencies(loaded)¶
- classmethod fromkeys(iterable, value=None)¶
- get(k[, d]) D[k] if k in D, else d. d defaults to None. ¶
- has_key(key)¶
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- known_other_fields: tuple[tuple[str, tuple[str, list[str], str | None]], ...] = (('density', ('g/cm**3', ['density'], '\\rho')), ('xmom', ('g/(cm**2 * s)', ['momentum_density_x'], '\\rho u')), ('ymom', ('g/(cm**2 * s)', ['momentum_density_y'], '\\rho v')), ('zmom', ('g/(cm**2 * s)', ['momentum_density_z'], '\\rho w')), ('x_velocity', ('cm/s', ['velocity_x'], 'u')), ('y_velocity', ('cm/s', ['velocity_y'], 'v')), ('z_velocity', ('cm/s', ['velocity_z'], 'w')), ('rho_E', ('erg/cm**3', ['total_energy_density'], '\\rho E')), ('rho_e', ('erg/cm**3', [], '\\rho e')), ('Temp', ('K', ['temperature'], 'T')), ('grav_x', ('cm/s**2', [], '\\mathbf{g} \\cdot \\mathbf{e}_x')), ('grav_y', ('cm/s**2', [], '\\mathbf{g} \\cdot \\mathbf{e}_y')), ('grav_z', ('cm/s**2', [], '\\mathbf{g} \\cdot \\mathbf{e}_z')), ('pressure', ('dyne/cm**2', [], 'p')), ('kineng', ('erg/cm**3', ['kinetic_energy_density'], '\\frac{1}{2}\\rho|\\mathbf{U}|^2')), ('soundspeed', ('cm/s', ['sound_speed'], 'Sound Speed')), ('MachNumber', ('', ['mach_number'], 'Mach Number')), ('abar', ('', [], '$\\bar{A}$')), ('Ye', ('', [], '$Y_e$')), ('entropy', ('erg/(g*K)', ['entropy'], 's')), ('magvort', ('1/s', ['vorticity_magnitude'], '|\\nabla \\times \\mathbf{U}|')), ('divu', ('1/s', ['velocity_divergence'], '\\nabla \\cdot \\mathbf{U}')), ('eint_E', ('erg/g', [], 'e(E,U)')), ('eint_e', ('erg/g', [], 'e')), ('magvel', ('cm/s', ['velocity_magnitude'], '|\\mathbf{U}|')), ('radvel', ('cm/s', ['radial_velocity'], '\\mathbf{U} \\cdot \\mathbf{e}_r')), ('magmom', ('g*cm/s', ['momentum_magnitude'], '\\rho |\\mathbf{U}|')), ('maggrav', ('cm/s**2', [], '|\\mathbf{g}|')), ('phiGrav', ('erg/g', [], '\\Phi')), ('enuc', ('erg/(g*s)', [], '\\dot{e}_{\\rm{nuc}}')), ('rho_enuc', ('erg/(cm**3*s)', [], '\\rho \\dot{e}_{\\rm{nuc}}')), ('angular_momentum_x', ('g/(cm*s)', [], '\\ell_x')), ('angular_momentum_y', ('g/(cm*s)', [], '\\ell_y')), ('angular_momentum_z', ('g/(cm*s)', [], '\\ell_z')), ('phiRot', ('erg/g', [], '\\Phi_{\\rm{rot}}')), ('rot_x', ('cm/s**2', [], '\\mathbf{f}_{\\rm{rot}} \\cdot \\mathbf{e}_x')), ('rot_y', ('cm/s**2', [], '\\mathbf{f}_{\\rm{rot}} \\cdot \\mathbf{e}_y')), ('rot_z', ('cm/s**2', [], '\\mathbf{f}_{\\rm{rot}} \\cdot \\mathbf{e}_z')))¶
- known_particle_fields: tuple[tuple[str, tuple[str, list[str], str | None]], ...] = (('particle_position_x', ('code_length', [], None)), ('particle_position_y', ('code_length', [], None)), ('particle_position_z', ('code_length', [], None)))¶
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair ¶
as a 2-tuple; but raise KeyError if D is empty.
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D ¶
- setup_extra_union_fields(ptype='all')¶
- setup_fluid_index_fields()¶
- setup_particle_fields(ptype, ftype='gas', num_neighbors=64)¶
- setup_smoothed_fields(ptype, num_neighbors=64, ftype='gas')¶
- update([E, ]**F) None. Update D from mapping/iterable E and F. ¶
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values ¶
- class yt.frontends.amrex.fields.MaestroFieldInfo(ds, field_list: list[tuple[str, str]], slice_info=None)[source]¶
Bases:
FieldInfoContainer
- add_deprecated_field(name, function, sampling_type, since, removal=None, ret_name=None, **kwargs)¶
Add a new field which is deprecated, along with supplemental metadata, to the list of available fields. This respects a number of arguments, all of which are passed on to the constructor for
DerivedField
.- Parameters:
name (str) – is the name of the field.
function (callable) – A function handle that defines the field. Should accept arguments (field, data)
sampling_type (str) – “cell” or “particle” or “local”
since (str) – The version string marking when this field was deprecated.
removal (str) – The version string marking when this field will be removed.
ret_name (str) – The name of the field which will actually be returned, used only by
alias()
.units (str) – A plain text string encoding the unit. Powers must be in python syntax (** instead of ^). If set to “auto” the units will be inferred from the return value of the field function.
take_log (bool) – Describes whether the field should be logged
validators (list) – A list of
FieldValidator
objectsvector_field (bool) – Describes the dimensionality of the field. Currently unused.
display_name (str) – A name used in the plots
- add_field(name: tuple[str, str], function: Callable, sampling_type: str, *, alias: DerivedField | None = None, force_override: bool = False, **kwargs) None ¶
Add a new field, along with supplemental metadata, to the list of available fields. This respects a number of arguments, all of which are passed on to the constructor for
DerivedField
.- Parameters:
name (tuple[str, str]) – field (or particle) type, field name
function (callable) – A function handle that defines the field. Should accept arguments (field, data)
sampling_type (str) – “cell” or “particle” or “local”
force_override (bool) – If False (default), an error will be raised if a field of the same name already exists.
alias (DerivedField (optional):) – existing field to be aliased
units (str) – A plain text string encoding the unit. Powers must be in python syntax (** instead of ^). If set to “auto” the units will be inferred from the return value of the field function.
take_log (bool) – Describes whether the field should be logged
validators (list) – A list of
FieldValidator
objectsvector_field (bool) – Describes the dimensionality of the field. Currently unused.
display_name (str) – A name used in the plots
- add_output_field(name, sampling_type, **kwargs)¶
- alias(alias_name: tuple[str, str], original_name: tuple[str, str], units: str | None = None, deprecate: tuple[str, str | None] | None = None)¶
Alias one field to another field.
- Parameters:
units (str) – A plain text string encoding the unit. Powers must be in python syntax (** instead of ^). If set to “auto” the units will be inferred from the return value of the field function.
deprecate (tuple[str, str | None] | None) – If this is set, then the tuple contains two string version numbers: the first marking the version when the field was deprecated, and the second marking when the field will be removed.
- check_derived_fields(fields_to_check=None)¶
- clear() None. Remove all items from D. ¶
- copy()¶
- classmethod create_with_fallback(fallback, name='')¶
- fallback = None¶
- find_dependencies(loaded)¶
- classmethod fromkeys(iterable, value=None)¶
- get(k[, d]) D[k] if k in D, else d. d defaults to None. ¶
- has_key(key)¶
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- known_other_fields: tuple[tuple[str, tuple[str, list[str], str | None]], ...] = (('density', ('g/cm**3', ['density'], None)), ('x_vel', ('cm/s', ['velocity_x'], '\\tilde{u}')), ('y_vel', ('cm/s', ['velocity_y'], '\\tilde{v}')), ('z_vel', ('cm/s', ['velocity_z'], '\\tilde{w}')), ('magvel', ('cm/s', ['velocity_magnitude'], '|\\tilde{\\mathbf{U}} + w_0 \\mathbf{e}_r|')), ('radial_velocity', ('cm/s', ['radial_velocity'], '\\mathbf{U}\\cdot \\mathbf{e}_r')), ('circum_velocity', ('cm/s', ['tangential_velocity'], 'U - U\\cdot e_r')), ('tfromp', ('K', [], 'T(\\rho,p,X)')), ('tfromh', ('K', [], 'T(\\rho,h,X)')), ('Machnumber', ('', ['mach_number'], 'M')), ('S', ('1/s', [], None)), ('ad_excess', ('', [], '\\nabla - \\nabla_\\mathrm{ad}')), ('deltaT', ('', [], '[T(\\rho,h,X) - T(\\rho,p,X)]/T(\\rho,h,X)')), ('deltagamma', ('', [], '\\Gamma_1 - \\overline{\\Gamma_1}')), ('deltap', ('', [], '[p(\\rho,h,X) - p_0] / p_0')), ('divw0', ('1/s', [], '\\nabla \\cdot \\mathbf{w}_0')), ('entropy', ('erg/(g*K)', ['entropy'], 's')), ('entropypert', ('', [], '[s - \\overline{s}] / \\overline{s}')), ('enucdot', ('erg/(g*s)', [], '\\dot{\\epsilon}_{nuc}')), ('Hext', ('erg/(g*s)', [], 'H_{ext}')), ('gpi_x', ('dyne/cm**3', [], '\\left(\\nabla\\pi\\right)_x')), ('gpi_y', ('dyne/cm**3', [], '\\left(\\nabla\\pi\\right)_y')), ('gpi_z', ('dyne/cm**3', [], '\\left(\\nabla\\pi\\right)_z')), ('h', ('erg/g', [], 'h')), ('h0', ('erg/g', [], 'h_0')), ('momentum', ('g*cm/s', ['momentum_magnitude'], '\\rho |\\mathbf{U}|')), ('p0', ('erg/cm**3', [], 'p_0')), ('p0pluspi', ('erg/cm**3', [], 'p_0 + \\pi')), ('pi', ('erg/cm**3', [], '\\pi')), ('pioverp0', ('', [], '\\pi/p_0')), ('rho0', ('g/cm**3', [], '\\rho_0')), ('rhoh', ('erg/cm**3', ['enthalpy_density'], '(\\rho h)')), ('rhoh0', ('erg/cm**3', [], '(\\rho h)_0')), ('rhohpert', ('erg/cm**3', [], '(\\rho h)^\\prime')), ('rhopert', ('g/cm**3', [], '\\rho^\\prime')), ('soundspeed', ('cm/s', ['sound_speed'], None)), ('sponge', ('', [], None)), ('tpert', ('K', [], 'T - \\overline{T}')), ('vort', ('1/s', ['vorticity_magnitude'], '|\\nabla\\times\\tilde{U}|')), ('w0_x', ('cm/s', [], '(w_0)_x')), ('w0_y', ('cm/s', [], '(w_0)_y')), ('w0_z', ('cm/s', [], '(w_0)_z')))¶
- known_particle_fields: KnownFieldsT = ()¶
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair ¶
as a 2-tuple; but raise KeyError if D is empty.
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D ¶
- setup_extra_union_fields(ptype='all')¶
- setup_fluid_index_fields()¶
- setup_particle_fields(ptype, ftype='gas', num_neighbors=64)¶
- setup_smoothed_fields(ptype, num_neighbors=64, ftype='gas')¶
- update([E, ]**F) None. Update D from mapping/iterable E and F. ¶
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values ¶
- class yt.frontends.amrex.fields.NyxFieldInfo(ds, field_list: list[tuple[str, str]], slice_info=None)[source]¶
Bases:
FieldInfoContainer
- add_deprecated_field(name, function, sampling_type, since, removal=None, ret_name=None, **kwargs)¶
Add a new field which is deprecated, along with supplemental metadata, to the list of available fields. This respects a number of arguments, all of which are passed on to the constructor for
DerivedField
.- Parameters:
name (str) – is the name of the field.
function (callable) – A function handle that defines the field. Should accept arguments (field, data)
sampling_type (str) – “cell” or “particle” or “local”
since (str) – The version string marking when this field was deprecated.
removal (str) – The version string marking when this field will be removed.
ret_name (str) – The name of the field which will actually be returned, used only by
alias()
.units (str) – A plain text string encoding the unit. Powers must be in python syntax (** instead of ^). If set to “auto” the units will be inferred from the return value of the field function.
take_log (bool) – Describes whether the field should be logged
validators (list) – A list of
FieldValidator
objectsvector_field (bool) – Describes the dimensionality of the field. Currently unused.
display_name (str) – A name used in the plots
- add_field(name: tuple[str, str], function: Callable, sampling_type: str, *, alias: DerivedField | None = None, force_override: bool = False, **kwargs) None ¶
Add a new field, along with supplemental metadata, to the list of available fields. This respects a number of arguments, all of which are passed on to the constructor for
DerivedField
.- Parameters:
name (tuple[str, str]) – field (or particle) type, field name
function (callable) – A function handle that defines the field. Should accept arguments (field, data)
sampling_type (str) – “cell” or “particle” or “local”
force_override (bool) – If False (default), an error will be raised if a field of the same name already exists.
alias (DerivedField (optional):) – existing field to be aliased
units (str) – A plain text string encoding the unit. Powers must be in python syntax (** instead of ^). If set to “auto” the units will be inferred from the return value of the field function.
take_log (bool) – Describes whether the field should be logged
validators (list) – A list of
FieldValidator
objectsvector_field (bool) – Describes the dimensionality of the field. Currently unused.
display_name (str) – A name used in the plots
- add_output_field(name, sampling_type, **kwargs)¶
- alias(alias_name: tuple[str, str], original_name: tuple[str, str], units: str | None = None, deprecate: tuple[str, str | None] | None = None)¶
Alias one field to another field.
- Parameters:
units (str) – A plain text string encoding the unit. Powers must be in python syntax (** instead of ^). If set to “auto” the units will be inferred from the return value of the field function.
deprecate (tuple[str, str | None] | None) – If this is set, then the tuple contains two string version numbers: the first marking the version when the field was deprecated, and the second marking when the field will be removed.
- check_derived_fields(fields_to_check=None)¶
- clear() None. Remove all items from D. ¶
- copy()¶
- classmethod create_with_fallback(fallback, name='')¶
- fallback = None¶
- find_dependencies(loaded)¶
- classmethod fromkeys(iterable, value=None)¶
- get(k[, d]) D[k] if k in D, else d. d defaults to None. ¶
- has_key(key)¶
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- known_other_fields: KnownFieldsT = ()¶
- known_particle_fields: tuple[tuple[str, tuple[str, list[str], str | None]], ...] = (('particle_position_x', ('code_length', [], None)), ('particle_position_y', ('code_length', [], None)), ('particle_position_z', ('code_length', [], None)))¶
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair ¶
as a 2-tuple; but raise KeyError if D is empty.
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D ¶
- setup_extra_union_fields(ptype='all')¶
- setup_fluid_fields()¶
- setup_fluid_index_fields()¶
- setup_particle_fields(ptype, ftype='gas', num_neighbors=64)¶
- setup_smoothed_fields(ptype, num_neighbors=64, ftype='gas')¶
- update([E, ]**F) None. Update D from mapping/iterable E and F. ¶
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values ¶
- class yt.frontends.amrex.fields.WarpXFieldInfo(ds, field_list)[source]¶
Bases:
FieldInfoContainer
- add_deprecated_field(name, function, sampling_type, since, removal=None, ret_name=None, **kwargs)¶
Add a new field which is deprecated, along with supplemental metadata, to the list of available fields. This respects a number of arguments, all of which are passed on to the constructor for
DerivedField
.- Parameters:
name (str) – is the name of the field.
function (callable) – A function handle that defines the field. Should accept arguments (field, data)
sampling_type (str) – “cell” or “particle” or “local”
since (str) – The version string marking when this field was deprecated.
removal (str) – The version string marking when this field will be removed.
ret_name (str) – The name of the field which will actually be returned, used only by
alias()
.units (str) – A plain text string encoding the unit. Powers must be in python syntax (** instead of ^). If set to “auto” the units will be inferred from the return value of the field function.
take_log (bool) – Describes whether the field should be logged
validators (list) – A list of
FieldValidator
objectsvector_field (bool) – Describes the dimensionality of the field. Currently unused.
display_name (str) – A name used in the plots
- add_field(name: tuple[str, str], function: Callable, sampling_type: str, *, alias: DerivedField | None = None, force_override: bool = False, **kwargs) None ¶
Add a new field, along with supplemental metadata, to the list of available fields. This respects a number of arguments, all of which are passed on to the constructor for
DerivedField
.- Parameters:
name (tuple[str, str]) – field (or particle) type, field name
function (callable) – A function handle that defines the field. Should accept arguments (field, data)
sampling_type (str) – “cell” or “particle” or “local”
force_override (bool) – If False (default), an error will be raised if a field of the same name already exists.
alias (DerivedField (optional):) – existing field to be aliased
units (str) – A plain text string encoding the unit. Powers must be in python syntax (** instead of ^). If set to “auto” the units will be inferred from the return value of the field function.
take_log (bool) – Describes whether the field should be logged
validators (list) – A list of
FieldValidator
objectsvector_field (bool) – Describes the dimensionality of the field. Currently unused.
display_name (str) – A name used in the plots
- add_output_field(name, sampling_type, **kwargs)¶
- alias(alias_name: tuple[str, str], original_name: tuple[str, str], units: str | None = None, deprecate: tuple[str, str | None] | None = None)¶
Alias one field to another field.
- Parameters:
units (str) – A plain text string encoding the unit. Powers must be in python syntax (** instead of ^). If set to “auto” the units will be inferred from the return value of the field function.
deprecate (tuple[str, str | None] | None) – If this is set, then the tuple contains two string version numbers: the first marking the version when the field was deprecated, and the second marking when the field will be removed.
- check_derived_fields(fields_to_check=None)¶
- clear() None. Remove all items from D. ¶
- copy()¶
- classmethod create_with_fallback(fallback, name='')¶
- extra_union_fields: tuple[FieldKey, ...] = (('kg', 'particle_mass'), ('C', 'particle_charge'), ('', 'particle_ones'))¶
- fallback = None¶
- find_dependencies(loaded)¶
- classmethod fromkeys(iterable, value=None)¶
- get(k[, d]) D[k] if k in D, else d. d defaults to None. ¶
- has_key(key)¶
- items() a set-like object providing a view on D's items ¶
- keys() a set-like object providing a view on D's keys ¶
- known_other_fields: tuple[tuple[str, tuple[str, list[str], str | None]], ...] = (('Bx', ('T', ['magnetic_field_x', 'B_x'], None)), ('By', ('T', ['magnetic_field_y', 'B_y'], None)), ('Bz', ('T', ['magnetic_field_z', 'B_z'], None)), ('Ex', ('V/m', ['electric_field_x', 'E_x'], None)), ('Ey', ('V/m', ['electric_field_y', 'E_y'], None)), ('Ez', ('V/m', ['electric_field_z', 'E_z'], None)), ('jx', ('A', ['current_x', 'Jx', 'J_x'], None)), ('jy', ('A', ['current_y', 'Jy', 'J_y'], None)), ('jz', ('A', ['current_z', 'Jz', 'J_z'], None)))¶
- known_particle_fields: tuple[tuple[str, tuple[str, list[str], str | None]], ...] = (('particle_weight', ('', ['particle_weighting'], None)), ('particle_position_x', ('m', [], None)), ('particle_position_y', ('m', [], None)), ('particle_position_z', ('m', [], None)), ('particle_velocity_x', ('m/s', [], None)), ('particle_velocity_y', ('m/s', [], None)), ('particle_velocity_z', ('m/s', [], None)), ('particle_momentum_x', ('kg*m/s', [], None)), ('particle_momentum_y', ('kg*m/s', [], None)), ('particle_momentum_z', ('kg*m/s', [], None)))¶
- pop(k[, d]) v, remove specified key and return the corresponding value. ¶
If key is not found, d is returned if given, otherwise KeyError is raised.
- popitem() (k, v), remove and return some (key, value) pair ¶
as a 2-tuple; but raise KeyError if D is empty.
- setdefault(k[, d]) D.get(k,d), also set D[k]=d if k not in D ¶
- setup_extra_union_fields(ptype='all')¶
- setup_fluid_index_fields()¶
- setup_smoothed_fields(ptype, num_neighbors=64, ftype='gas')¶
- update([E, ]**F) None. Update D from mapping/iterable E and F. ¶
If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
- values() an object providing a view on D's values ¶