tardis.transport.montecarlo.base module

class tardis.transport.montecarlo.base.MonteCarloTransportSolver(*args: Any, **kwargs: Any)[source]

Bases: HDFWriterMixin

This class modifies the MonteCarloTransportState to solve the radiative transfer problem.

Create a new instance and initialize HDF properties.

Parameters:
*argsAny

Positional arguments passed to the parent class.

**kwargsAny

Keyword arguments passed to the parent class.

Returns:
HDFWriterMixin

The new instance with initialized HDF properties.

classmethod from_config(config, packet_source, enable_virtual_packet_logging=False)[source]

Create a new MontecarloTransport instance from a Configuration object.

Parameters:
configtardis.io.config_reader.Configuration
virtual_packet_loggingbool
Returns:
MontecarloTransport
hdf_name = 'transport'
hdf_properties = ['transport_state']
initialize_transport_state(simulation_state, opacity_state, macro_atom_state, plasma, no_of_packets, no_of_virtual_packets=0, iteration=0)[source]
run(transport_state, show_progress_bars=True)[source]

Run the montecarlo calculation

Parameters:
transport_statetardis.transport.montecarlo.transport_state.TransportState

Transport state containing all the data needed for the Monte Carlo simulation

show_progress_barsbool

Show progress bars

Returns:
v_packets_energy_histndarray

Histogram of energy from virtual packets