Celeritas 0.7.0-dev.246+develop.67e9bdac
Loading...
Searching...
No Matches
Public Member Functions | List of all members
celeritas::AtomicRelaxationHelper Class Reference

Helper class for atomic relaxation. More...

#include <AtomicRelaxationHelper.hh>

Public Member Functions

 AtomicRelaxationHelper (AtomicRelaxParamsRef const &shared, AtomicRelaxStateRef const &states, ElementId el_id, TrackSlotId tid)
 Construct with shared and state data.
 
 operator bool () const
 Whether atomic relaxation should be applied.
 
size_type max_secondaries () const
 Maximum number of secondaries that can be produced.
 
Span< SubshellIdscratch () const
 Access scratch space.
 
AtomicRelaxation build_distribution (CutoffView const &cutoffs, SubshellId shell_id, Span< Secondary > secondaries) const
 Create the sampling distribution.
 

Detailed Description

Helper class for atomic relaxation.

This class can be used inside an Interactor to simplify the creation of the sampling distribution for relaxation and the allocation of storage for secondaries created in both relaxation and the primary process.

// Allocate secondaries for a model that produces a single secondary
Span<Secondary> secondaries;
size_type count = relax_helper.max_secondaries() + 1;
if (Secondary* ptr = allocate_secondaries(count))
{
secondaries = {ptr, count};
}
else
{
}
Interaction result;
// ...
AtomicRelaxation sample_relaxation = relax_helper.build_distribution(
cutoffs, shell_id, secondaries.subspan(1));
auto outgoing = sample_relaxation(rng);
result.secondaries = outgoing.secondaries;
result.energy_deposition -= outgoing.energy;
CELER_CONSTEXPR_FUNCTION Count< T > count()
Count upward from zero.
Definition Range.hh:209
Non-owning reference to a contiguous span of data.
Definition Span.hh:49
unsigned int size_type
Standard type for container sizes, optimized for GPU use.
Definition corecel/Types.hh:30
static Interaction from_failure()
Indicate a failure to allocate memory for secondaries.
Definition phys/Interaction.hh:143
New particle created via an Interaction.
Definition Secondary.hh:23

Member Function Documentation

◆ scratch()

Span< SubshellId > celeritas::AtomicRelaxationHelper::scratch ( ) const
inline

Access scratch space.

This temporary data is needed as part of a stack while processing the cascade of electrons.


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