use base class to handle layout of particle data

This commit is contained in:
Gavin Ridley 2021-04-16 15:35:33 -04:00
parent 5cf8482d9a
commit 2af4c9cd92
39 changed files with 834 additions and 795 deletions

View file

@ -1,16 +1,16 @@
#include "openmc/particle_data.h"
#include "openmc/source.h"
#include "openmc/particle.h"
class CustomSource : public openmc::Source {
public:
CustomSource(double energy) : energy_(energy) { }
// Samples from an instance of this class.
openmc::Particle::Bank sample(uint64_t* seed) const
openmc::ParticleBank sample(uint64_t* seed) const
{
openmc::Particle::Bank particle;
openmc::ParticleBank particle;
// wgt
particle.particle = openmc::Particle::Type::neutron;
particle.particle = openmc::ParticleType::neutron;
particle.wgt = 1.0;
// position
particle.r.x = 0.0;