mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
add placeholder skeleton for MCPL-input
This commit is contained in:
parent
bab55c0b69
commit
debc085cf6
2 changed files with 40 additions and 0 deletions
|
|
@ -100,6 +100,25 @@ private:
|
|||
vector<SourceSite> sites_; //!< Source sites from a file
|
||||
};
|
||||
|
||||
//==============================================================================
|
||||
// MCPL-file input source
|
||||
//==============================================================================
|
||||
class MCPLFileSource : public Source {
|
||||
public:
|
||||
// Constructors, destructors
|
||||
MCPLFileSource(std::string path);
|
||||
~MCPLFileSource();
|
||||
|
||||
// Defer implementation to custom source library
|
||||
SourceSite sample(uint64_t* seed) const override
|
||||
|
||||
private:
|
||||
vector <SourceSite> sites_; //!<source sites from an MCPL-file
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//==============================================================================
|
||||
//! Wrapper for custom sources that manages opening/closing shared library
|
||||
//==============================================================================
|
||||
|
|
|
|||
|
|
@ -332,6 +332,27 @@ CustomSourceWrapper::~CustomSourceWrapper()
|
|||
#endif
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// Read an MCPL-file
|
||||
//===========================================================================
|
||||
MCPLFileSource::MCPLFileSource(std::string path)
|
||||
{
|
||||
// Check if source file exists
|
||||
if (!file_exists(path)) {
|
||||
fatal_error(fmt::format("Source file '{}' does not exist.", path));
|
||||
}
|
||||
|
||||
// Read the source from a binary file instead of sampling from some
|
||||
// assumed source distribution
|
||||
write_message(6, "Reading source file from {}...", path);
|
||||
|
||||
// Open the mcpl file
|
||||
id_t file_id = mcpl_open(path.c_str)
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//==============================================================================
|
||||
// Non-member functions
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue