mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Move FileSource MCPL reading to mcpl_interface.h/cpp
This commit is contained in:
parent
987293cfff
commit
a3065b479c
6 changed files with 126 additions and 83 deletions
25
include/openmc/mcpl_interface.h
Normal file
25
include/openmc/mcpl_interface.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef OPENMC_MCPL_INTERFACE_H
|
||||
#define OPENMC_MCPL_INTERFACE_H
|
||||
|
||||
#include "openmc/particle_data.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#ifdef OPENMC_MCPL
|
||||
#include <mcpl.h>
|
||||
#endif
|
||||
|
||||
namespace openmc {
|
||||
|
||||
extern "C" const bool MCPL_ENABLED;
|
||||
|
||||
//! Get a vector of source sites from an MCPL file
|
||||
//
|
||||
//! \param[in] path Path to MCPL file
|
||||
//! \return Vector of source sites
|
||||
vector<SourceSite> mcpl_source_sites(std::string path);
|
||||
|
||||
} // namespace openmc
|
||||
|
||||
#endif // OPENMC_MCPL_INTERFACE_H
|
||||
|
|
@ -14,10 +14,6 @@
|
|||
#include "openmc/particle.h"
|
||||
#include "openmc/vector.h"
|
||||
|
||||
#ifdef OPENMC_MCPL
|
||||
#include <mcpl.h>
|
||||
#endif
|
||||
|
||||
namespace openmc {
|
||||
|
||||
//==============================================================================
|
||||
|
|
@ -32,7 +28,6 @@ constexpr double EXTSRC_REJECT_FRACTION {0.05};
|
|||
//==============================================================================
|
||||
// Global variables
|
||||
//==============================================================================
|
||||
extern "C" const bool MCPL_ENABLED;
|
||||
|
||||
class Source;
|
||||
|
||||
|
|
@ -107,9 +102,8 @@ class FileSource : public Source {
|
|||
public:
|
||||
// Constructors
|
||||
explicit FileSource(std::string path);
|
||||
#ifdef OPENMC_MCPL
|
||||
explicit FileSource(mcpl_file_t mcpl_file);
|
||||
#endif
|
||||
explicit FileSource(const vector<SourceSite>& sites) : sites_ {sites} {}
|
||||
|
||||
// Methods
|
||||
SourceSite sample(uint64_t* seed) const override;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue