sailfish.solvers.cbdisodg_2d.Solver
- class sailfish.solvers.cbdisodg_2d.Solver(setup=None, mesh=None, time=0.0, solution=None, num_patches=1, mode='cpu', physics={}, options={})[source]
Bases:
SolverBase
Adapter class to drive the cbdisodg_2d C extension module.
- __init__(setup=None, mesh=None, time=0.0, solution=None, num_patches=1, mode='cpu', physics={}, options={})[source]
Methods
__init__
([setup, mesh, time, solution, ...])advance
(dt)Advance the solution state by one iteration.
advance_rk
(rk_param, dt)Return the global maximum wavespeed over the whole domain.
new_iteration
()Generate runtime reductions on the solution data for time series.
set_bc
(array)set_bc_patch
(pl, pc, pr, patch_index)Attributes
Return the largest CFL number that should be used for this solver.
A dictionary that reflects the solver solution scheme.
A dictionary describing the physics parameters of the system.
Return primitive hydrodynamic data for use in plotting.
Return a recommended CFL number to the driver, default to the maximum.
Return an object representing the solution state.
Return the simulation time.
- property maximum_cfl
Return the largest CFL number that should be used for this solver.
- property options
A dictionary that reflects the solver solution scheme.
An example of an options object would be
dict(plm=1.5, rk=2)
. The items should describe the solver algorithm, not the parameters of the physical system being solved, such as an equation of state or cooling prescription.Solver options and physics parameters are kept logically separate because their configuration comes from different places: the physics parameters come from the
sailfish.setup.Setup
class instance (which can in turn be set from model parameters), whereas the solver options come directly from the driver instance (i.e. command line--solver key=val
if sailfish is invoked as an executable).
- property physics
A dictionary describing the physics parameters of the system.
The physics parameters are supplied by the setup. They can include things like an equation of state, a cooling prescription, external gravity, a wavespeed in the case of passive scalar advection, fluid viscocity model, etc. These items can still be influenced at runtime through the setup’s model parameters.
- property primitive
Return primitive hydrodynamic data for use in plotting.
The primitive variable data returned from this function could be written to checkpoint files, but it might also be written to non-checkpoint output files for offline analysis, or passed along to runtime post-processing routines.
- property recommended_cfl
Return a recommended CFL number to the driver, default to the maximum.
- reductions()[source]
Generate runtime reductions on the solution data for time series.
As of now, the reductions generated are the rates of mass accretion, and of x and y momentum (combined gravitational and accretion) resulting from each of the point masses. If there are 2 point masses, then the result of this function is a 7-element list: [time, mdot1, fx1, fy1, mdot2, fx2, fy2].
- property solution
Return an object representing the solution state.
The solution object is generally going to be either an array of primitive hydrodynamic data, or of conserved quantities, depending on which the solver considers to be more fundamental. If the solver maintains state in addition to the hydrodynamic data, such as a list of tracer or star particles, then objects like that should also be returned as part of the solution object.
The solution object will be written to the checkpoint file, read back on restarts, and passed to the solver constructor. When the run is not a restart, the solver should instead construct its initial solution object from the setup and mesh instances.
- property time
Return the simulation time.