mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-25 20:45:35 -04:00
use base class to handle layout of particle data
This commit is contained in:
parent
5cf8482d9a
commit
2af4c9cd92
39 changed files with 834 additions and 795 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue