mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Python source class refactor (#2524)
Co-authored-by: Paul Romano <paul.k.romano@gmail.com>
This commit is contained in:
parent
ee7b95245a
commit
eda39ad9ca
146 changed files with 648 additions and 4310 deletions
|
|
@ -5,8 +5,7 @@
|
|||
#include "openmc/random_lcg.h"
|
||||
#include "openmc/source.h"
|
||||
|
||||
class CustomSource : public openmc::Source
|
||||
{
|
||||
class CustomSource : public openmc::Source {
|
||||
openmc::SourceSite sample(uint64_t* seed) const
|
||||
{
|
||||
openmc::SourceSite particle;
|
||||
|
|
@ -20,16 +19,17 @@ class CustomSource : public openmc::Source
|
|||
particle.r.z = 0.;
|
||||
// angle
|
||||
particle.u = {1.0, 0.0, 0.0};
|
||||
particle.E = 14.08e6;
|
||||
particle.E = 1.00e3;
|
||||
particle.delayed_group = 0;
|
||||
return particle;
|
||||
}
|
||||
};
|
||||
|
||||
// A function to create a unique pointer to an instance of this class when generated
|
||||
// via a plugin call using dlopen/dlsym.
|
||||
// You must have external C linkage here otherwise dlopen will not find the file
|
||||
extern "C" std::unique_ptr<CustomSource> openmc_create_source(std::string parameters)
|
||||
// A function to create a unique pointer to an instance of this class when
|
||||
// generated via a plugin call using dlopen/dlsym. You must have external C
|
||||
// linkage here otherwise dlopen will not find the file
|
||||
extern "C" std::unique_ptr<CustomSource> openmc_create_source(
|
||||
std::string parameters)
|
||||
{
|
||||
return std::make_unique<CustomSource>();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue