Manages particle sizes and validates site occupancy constraints.  
 More...
#include <ParticleSizeManager.h>
|  | 
|  | ParticleSizeManager (uint32_t maxParticleTypes=256) | 
|  | Constructor with maximum particle types. 
 | 
|  | ~ParticleSizeManager ()=default | 
|  | Destructor. 
 | 
| void | setParticleSize (particle_t particleType, uint32_t size) | 
|  | Set the size for a specific particle type. 
 | 
| uint32_t | getParticleSize (particle_t particleType) const | 
|  | Get the size for a specific particle type. 
 | 
| uint32_t | calculateSiteOccupancy (const particle_t *particles, site_size_t count) const | 
|  | Calculate total size of particles at a site. 
 | 
| bool | canAddParticle (const particle_t *particles, site_size_t count, particle_t newParticle, uint32_t maxCapacity) const | 
|  | Check if adding a particle would exceed capacity. 
 | 
| bool | canAddParticles (const particle_t *particles, site_size_t count, const particle_t *newParticles, site_size_t newCount, uint32_t maxCapacity) const | 
|  | Check if particles can be added without exceeding capacity. 
 | 
| uint32_t | getMaxParticleCount (particle_t particleType, uint32_t currentOccupancy, uint32_t maxCapacity) const | 
|  | Get maximum number of particles of a type that can fit. 
 | 
| void | validateConfiguration () const | 
|  | Validate particle size configuration. 
 | 
| const std::vector< uint32_t > & | getParticleSizes () const | 
|  | Get all configured particle sizes. 
 | 
| void | clear () | 
|  | Clear all particle size configurations. 
 | 
| size_t | getConfiguredParticleCount () const | 
|  | Get number of configured particle types. 
 | 
| void | setParticleSizesFromDict (const std::map< particle_t, uint32_t > &sizeDict) | 
|  | Set particle sizes from a dictionary/map. 
 | 
| std::map< particle_t, uint32_t > | getParticleSizesDict () const | 
|  | Get particle sizes as a dictionary/map. 
 | 
Manages particle sizes and validates site occupancy constraints. 
This class provides efficient particle size tracking and capacity validation for RDME simulations. It ensures that particles with different sizes don't exceed the maximum occupancy limit of lattice sites. 
◆ ParticleSizeManager()
  
  | 
        
          | lm::rdme::ParticleSizeManager::ParticleSizeManager | ( | uint32_t | maxParticleTypes = 256 | ) |  |  | explicit | 
 
Constructor with maximum particle types. 
- Parameters
- 
  
    | maxParticleTypes | Maximum number of particle types to support |  
 
 
 
◆ ~ParticleSizeManager()
  
  | 
        
          | lm::rdme::ParticleSizeManager::~ParticleSizeManager | ( |  | ) |  |  | default | 
 
 
◆ calculateSiteOccupancy()
      
        
          | uint32_t lm::rdme::ParticleSizeManager::calculateSiteOccupancy | ( | const particle_t * | particles, | 
        
          |  |  | site_size_t | count ) const | 
      
 
Calculate total size of particles at a site. 
- Parameters
- 
  
    | particles | Array of particle types at the site |  | count | Number of particles at the site |  
 
- Returns
- Total size of all particles 
 
 
◆ canAddParticle()
Check if adding a particle would exceed capacity. 
- Parameters
- 
  
    | particles | Current particles at the site |  | count | Current number of particles |  | newParticle | Particle type to add |  | maxCapacity | Maximum capacity of the site |  
 
- Returns
- True if particle can be added without exceeding capacity 
 
 
◆ canAddParticles()
Check if particles can be added without exceeding capacity. 
- Parameters
- 
  
    | particles | Current particles at the site |  | count | Current number of particles |  | newParticles | Array of particle types to add |  | newCount | Number of new particles to add |  | maxCapacity | Maximum capacity of the site |  
 
- Returns
- True if all particles can be added without exceeding capacity 
 
 
◆ clear()
      
        
          | void lm::rdme::ParticleSizeManager::clear | ( |  | ) |  | 
      
 
Clear all particle size configurations. 
 
 
◆ getConfiguredParticleCount()
      
        
          | size_t lm::rdme::ParticleSizeManager::getConfiguredParticleCount | ( |  | ) | const | 
      
 
Get number of configured particle types. 
- Returns
- Number of particle types with configured sizes 
 
 
◆ getMaxParticleCount()
      
        
          | uint32_t lm::rdme::ParticleSizeManager::getMaxParticleCount | ( | particle_t | particleType, | 
        
          |  |  | uint32_t | currentOccupancy, | 
        
          |  |  | uint32_t | maxCapacity ) const | 
      
 
Get maximum number of particles of a type that can fit. 
- Parameters
- 
  
    | particleType | The particle type |  | currentOccupancy | Current site occupancy |  | maxCapacity | Maximum site capacity |  
 
- Returns
- Maximum number of particles that can fit 
 
 
◆ getParticleSize()
      
        
          | uint32_t lm::rdme::ParticleSizeManager::getParticleSize | ( | particle_t | particleType | ) | const | 
      
 
Get the size for a specific particle type. 
- Parameters
- 
  
    | particleType | The particle type ID |  
 
- Returns
- The size of the particle (default is 1 if not set) 
 
 
◆ getParticleSizes()
      
        
          | const std::vector< uint32_t > & lm::rdme::ParticleSizeManager::getParticleSizes | ( |  | ) | const | 
      
 
Get all configured particle sizes. 
- Returns
- Vector of particle sizes indexed by particle type 
 
 
◆ getParticleSizesDict()
      
        
          | std::map< particle_t, uint32_t > lm::rdme::ParticleSizeManager::getParticleSizesDict | ( |  | ) | const | 
      
 
Get particle sizes as a dictionary/map. 
- Returns
- Map of particle type to size for all configured particles 
 
 
◆ setParticleSize()
      
        
          | void lm::rdme::ParticleSizeManager::setParticleSize | ( | particle_t | particleType, | 
        
          |  |  | uint32_t | size ) | 
      
 
Set the size for a specific particle type. 
- Parameters
- 
  
    | particleType | The particle type ID |  | size | The size of the particle (must be > 0) |  
 
- Exceptions
- 
  
  
 
 
◆ setParticleSizesFromDict()
      
        
          | void lm::rdme::ParticleSizeManager::setParticleSizesFromDict | ( | const std::map< particle_t, uint32_t > & | sizeDict | ) |  | 
      
 
Set particle sizes from a dictionary/map. 
- Parameters
- 
  
    | sizeDict | Map of particle type to size |  
 
 
 
◆ validateConfiguration()
      
        
          | void lm::rdme::ParticleSizeManager::validateConfiguration | ( |  | ) | const | 
      
 
Validate particle size configuration. 
- Exceptions
- 
  
  
 
 
The documentation for this class was generated from the following files: