mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 13:45:36 -04:00
Make regular source distributions obey the same interface as custom sources
This commit is contained in:
parent
8f71ed2a1d
commit
713469bf59
8 changed files with 38 additions and 36 deletions
|
|
@ -5,7 +5,7 @@
|
|||
#include "openmc/source.h"
|
||||
#include "openmc/particle.h"
|
||||
|
||||
class Source : openmc::CustomSource
|
||||
class Source : public openmc::SourceDistribution
|
||||
{
|
||||
openmc::Particle::Bank sample(uint64_t *seed)
|
||||
{
|
||||
|
|
@ -14,7 +14,7 @@ class Source : openmc::CustomSource
|
|||
particle.particle = openmc::Particle::Type::neutron;
|
||||
particle.wgt = 1.0;
|
||||
// position
|
||||
|
||||
|
||||
particle.r.x = 0.;
|
||||
particle.r.y = 0.;
|
||||
particle.r.z = 0.;
|
||||
|
|
@ -22,7 +22,7 @@ class Source : openmc::CustomSource
|
|||
particle.u = {1.0, 0.0, 0.0};
|
||||
particle.E = 14.08e6;
|
||||
particle.delayed_group = 0;
|
||||
return particle;
|
||||
return particle;
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue