Celeritas  0.5.0-56+6b053cd
Public Member Functions | List of all members
celeritas::BeginRunActionInterface< P, S > Class Template Referenceabstract

Interface for updating states at the beginning of the simulation. More...

#include <ActionInterface.hh>

Inheritance diagram for celeritas::BeginRunActionInterface< P, S >:
Inheritance graph
[legend]

Public Member Functions

virtual void begin_run (P const &, S< MemSpace::host > &)=0
 Set host data at the beginning of a run.
 
virtual void begin_run (P const &, S< MemSpace::device > &)=0
 Set device data at the beginning of a run.
 
- Public Member Functions inherited from celeritas::ActionInterface
virtual ~ActionInterface () noexcept=0
 Default destructor.
 
virtual ActionId action_id () const =0
 ID of this action for verification and ordering.
 
virtual std::string_view label () const =0
 Short unique label of the action.
 
virtual std::string_view description () const =0
 Description of the action.
 

Additional Inherited Members

- Public Types inherited from celeritas::ActionTypeTraits< P, S >
using CoreParams = P
 
using CoreStateHost = S< MemSpace::host >
 
using CoreStateDevice = S< MemSpace::device >
 
using SpanCoreStateHost = Span< S< MemSpace::host > *const >
 
using SpanCoreStateDevice = Span< S< MemSpace::device > *const >
 
- Protected Member Functions inherited from celeritas::ActionInterface
 ActionInterface ()=default
 
 CELER_DEFAULT_COPY_MOVE (ActionInterface)
 

Detailed Description

template<class P, template< MemSpace M > class S>
class celeritas::BeginRunActionInterface< P, S >

Interface for updating states at the beginning of the simulation.

This is necessary for some classes that require deferred initialization (either to the class itself or the state), for example because it needs the number of total actions being run.

If the class itself–rather than the state–needs initialization, try to initialize in the constructor and avoid using this interface if possible.

Todo:
This is currently called once per each state on each CPU thread, and it would be more sensible to call a single with all cooperative states.
Warning
Because this is called once per thread, the inheriting class is responsible for thread safety (e.g. adding mutexes).

The documentation for this class was generated from the following file: