sailfish.setups.simple1d.Shocktube
- class sailfish.setups.simple1d.Shocktube(**kwargs)[source]
Bases:
SetupBase
Discontinuous initial data, with uniform density and pressure to either side of the discontintuity at x=0.5.
- __init__(**kwargs)
Methods
__init__
(**kwargs)checkpoint_diagnostics
(time)Return a dict of post-processing data to include in checkpoint files.
Return a dash-case name of this setup class.
Return an iterator over the default model parameters for this class.
Print formatted text describing the setup.
find_setup_class
(name)Finds a setup class with the given name.
Determine if this class has any model parameters.
Return an iterator over the immutable model parameter keys.
mesh
(num_zones)Return a mesh instance describing the problem domain.
Return a dictionary of the model parameters.
Return an iterator over the model parameters chosen for this setup.
primitive
(t, x, primitive)Set initial or boundary data at a point.
print_model_parameters
([logger, newlines])Print parameter names, values, and about messages to stdout.
validate
()Confirm that the model parameters are physically valid.
Attributes
Return a boundary condition mode.
Provide a default end-time to the simulation driven.
Provide a default grid resolution.
A list of diagnostics to be dispatched to the solver.
Return physics parameters used by the solver: EOS, gravity, etc.
The time scale used to convert raw simulation time to user time.
Return the name of the setup class.
The start time for the simulation.
- property boundary_condition
Return a boundary condition mode.
This method must be overridden, and the mode must be supported by the solver. 1D solvers should accept either a single return value specifying the BC mode at both the domain edges, or a pair of modes, one for each edge.
- checkpoint_diagnostics(time)
Return a dict of post-processing data to include in checkpoint files.
An example use case is to record the positions of point masses (with prescribed trajectory) in a gravitating hydrodynmics problem.
- classmethod dash_case_class_name()
Return a dash-case name of this setup class.
Dash case is used in configuration, including the setup name passed to the driver, and written in checkpoint files.
- property default_end_time
Provide a default end-time to the simulation driven.
This value will be superceded if a non-None end time was provided to the driver. If neither the driver nor the setup has an end time, then the simulation runs until it’s killed.
- classmethod default_model_parameters()
Return an iterator over the default model parameters for this class.
- property default_resolution
Provide a default grid resolution.
- classmethod describe_class()
Print formatted text describing the setup.
The output will include a normlized version of the class doc string, and the model parameter names, default values, and about message.
- property diagnostics
A list of diagnostics to be dispatched to the solver.
- classmethod find_setup_class(name)
Finds a setup class with the given name.
The class name is expected in dash-case format. If no setup is found, a SetupError exception is raised.
- classmethod has_model_parameters()
Determine if this class has any model parameters.
- classmethod immutable_parameter_keys()
Return an iterator over the immutable model parameter keys.
- mesh(num_zones)[source]
Return a mesh instance describing the problem domain.
This method must be overridden, and the domain type must be supported by the solver. A resolution parameter is passed here from the driver.
- model_parameter_dict()
Return a dictionary of the model parameters.
- model_parameters()
Return an iterator over the model parameters chosen for this setup.
- property physics
Return physics parameters used by the solver: EOS, gravity, etc.
Physics parameters should be distinct from the solver options, such as PLM theta value, RK integration type, or DG order.
- primitive(t, x, primitive)[source]
Set initial or boundary data at a point.
This method must be overridden to set the primitive hydrodynamic variables at a single point (given by coordinate) and time. The meaning of the coordinate is influenced by the type of mesh being used. Data is written to the output variable primitive for efficiency, since otherwise a tiny allocation is made for each zone in the simulation grid.
The time coordinate enables the use of a time-dependent boundary condition.
- print_model_parameters(logger=None, newlines=False)
Print parameter names, values, and about messages to stdout.
- property reference_time_scale
The time scale used to convert raw simulation time to user time.
Typically the reference time can be 1.0, meaning that raw simulation time and user time are the same. However it sometimes makes sense for the user time to be something else, like the orbital period of 2 pi for example. The start_time and default_time_time properties are in uner time, not raw simulation time. Similarly, messages written to stdout, and event recurrences are both in user time, i.e. if the reference time is 2 pi and –checkpoint=1.0, you’ll get one checkpoint written per orbital period. The “time” field of the checkpoint file contains the raw simulation time, not the user time.
- property solver
Return the name of the setup class.
- property start_time
The start time for the simulation. This is 0.0 by default.
- validate()
Confirm that the model parameters are physically valid.
This method should be overridden to indicate a failure by throwing a SetupError exception.