Rename source classes

This commit is contained in:
Paul Romano 2020-10-23 13:45:28 -05:00
parent f2526ec439
commit 0bb39005bc
8 changed files with 46 additions and 41 deletions

View file

@ -1,9 +1,9 @@
#include "openmc/source.h"
#include "openmc/particle.h"
class Source : public openmc::SourceDistribution {
class CustomSource : public openmc::Source {
public:
Source(double energy) : energy_(energy) { }
CustomSource(double energy) : energy_(energy) { }
// Samples from an instance of this class.
openmc::Particle::Bank sample(uint64_t* seed)
@ -31,8 +31,8 @@ class Source : public openmc::SourceDistribution {
// 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<Source> openmc_create_source(std::string parameter)
extern "C" std::unique_ptr<CustomSource> openmc_create_source(std::string parameter)
{
double energy = std::stod(parameter);
return std::make_unique<Source>(energy);
return std::make_unique<CustomSource>(energy);
}