Medium
- class stride.problem.medium.Medium(name='medium', problem=None, **kwargs)[source]
Bases:
ProblemBase
A Medium contains the fields that define a physical medium, such as density or longitudinal speed of sound.
A Medium defines these properties by keeping track of a series of named fields, that can be added to it through
Medium.add
.A field with a name
field_name
can be accessed directly throughmedium.field_name
ormedium['field_name']
.The Medium also provides utilities for loading and dumping these fields and for plotting them.
- Parameters:
- add(field)[source]
Add a named field to the Medium.
- Parameters:
field (Field object) – Field to add to the Medium.
- dump(*args, **kwargs)[source]
Dump all fields in the Medium.
See
HDF5
for more information on the parameters of this method.
- property fields
Access fields dictionary.
- items()[source]
Access all fields as (name, field) pairs.
- Returns:
Iterable of (name, field) pairs.
- Return type:
Fields