Class ParticleSplitting
Defined in File Acceleration.h
Inheritance Relationships
Base Type
public Module(Class Module)
Class Documentation
-
class ParticleSplitting : public Module
Implements particle splitting, i.e. inverse thinning, to speed up the simulation.
After crossing a surface a given number of times, the particle is split to N partilces with weight 1/N. This eases performance constraints in acceleration simulations due to the power law nature of many acceleration mechanisms. Thanks to Matthew Weiss, Penn State University for the first work on this feature in 2017.
Public Functions
-
ParticleSplitting(Surface *surface, int crossingThreshold = 50, int numberSplits = 5, double minWeight = 0.01, std::string counterid = "ParticleSplittingCounter")
Constructor
- Parameters:
surface – The surface to monitor
crossingThreshold – Number of crossings after which a particle is split
numberSplits – Number of particles the candidate is split into
minWeight – Minimum weight to consider. Particles with a lower weight are not split again.
counterid – An unique string to identify the particle property used for counting. Useful if multiple splitting modules are present.
-
virtual void process(Candidate *candidate) const
Process function This is the main function to work with, it is called during every ModuleList::run step. Derived functions need to override this overload of process!
- Parameters:
candidate – Candidate raw pointer
-
virtual std::string getDescription() const
Returns description, can be overriden by derived class.
-
void setDescription(const std::string &description)
Sets description, can be used instead of getDescription in derived class
- Parameters:
description – Description string
-
inline void process(ref_ptr<Candidate> candidate) const
Process function Overload for process function to explicitly make a conversion from ref_ptr to a raw pointer
-
inline size_t addReference() const
-
inline size_t removeReference() const
-
inline int removeReferenceNoDelete() const
-
inline size_t getReferenceCount() const
Protected Attributes
-
mutable size_t _referenceCount
-
ParticleSplitting(Surface *surface, int crossingThreshold = 50, int numberSplits = 5, double minWeight = 0.01, std::string counterid = "ParticleSplittingCounter")