Move global_tally_absorption to tally.h

This commit is contained in:
Paul Romano 2018-10-15 11:52:03 -05:00
parent 9c787f988e
commit 217f87c085
4 changed files with 24 additions and 2 deletions

View file

@ -148,8 +148,6 @@ extern "C" {
extern int32_t n_surfaces;
extern int32_t n_tallies;
extern int32_t n_universes;
extern double global_tally_absorption;
#pragma omp threadprivate(global_tally_absorption)
// Variables that are shared by necessity (can be removed from public header
// later)

View file

@ -7,12 +7,31 @@
namespace openmc {
//==============================================================================
// Global variable declarations
//==============================================================================
extern "C" double total_weight;
// Threadprivate variables
extern "C" double global_tally_absorption;
#pragma omp threadprivate(global_tally_absorption)
//==============================================================================
// Non-member functions
//==============================================================================
template <std::size_t N>
using adaptor_type = xt::xtensor_adaptor<xt::xbuffer_adaptor<double*&, xt::no_ownership>, N>;
//! Get the global tallies as a multidimensional array
//! \return Global tallies array
adaptor_type<2> global_tallies();
//! Get tally results as a multidimensional array
//! \param idx Index in tallies array
//! \return Tally results array
adaptor_type<3> tally_results(int idx);
#ifdef OPENMC_MPI

View file

@ -16,6 +16,7 @@
#include "openmc/random_lcg.h"
#include "openmc/settings.h"
#include "openmc/simulation.h"
#include "openmc/tallies/tally.h"
namespace openmc {

View file

@ -13,6 +13,10 @@
namespace openmc {
//==============================================================================
// Non-member functions
//==============================================================================
adaptor_type<2> global_tallies()
{
// Get pointer to global tallies