Skip to content

Commit

Permalink
use base class to handle layout of particle data
Browse files Browse the repository at this point in the history
  • Loading branch information
gridley committed May 3, 2021
1 parent 5cf8482 commit 2af4c9c
Show file tree
Hide file tree
Showing 39 changed files with 834 additions and 795 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ list(APPEND libopenmc_SOURCES
src/nuclide.cpp
src/output.cpp
src/particle.cpp
src/particle_data.cpp
src/particle_restart.cpp
src/photon.cpp
src/physics.cpp
Expand Down
6 changes: 3 additions & 3 deletions include/openmc/bank.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ namespace openmc {

namespace simulation {

extern std::vector<Particle::Bank> source_bank;
extern std::vector<ParticleBank> source_bank;

extern SharedArray<Particle::Bank> surf_source_bank;
extern SharedArray<ParticleBank> surf_source_bank;

extern SharedArray<Particle::Bank> fission_bank;
extern SharedArray<ParticleBank> fission_bank;

extern std::vector<int64_t> progeny_per_particle;

Expand Down
2 changes: 1 addition & 1 deletion include/openmc/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace openmc {
// consistent locality improvements.
struct EventQueueItem{
int64_t idx; //!< particle index in event-based particle buffer
Particle::Type type; //!< particle type
ParticleType type; //!< particle type
int64_t material; //!< material that particle is in
double E; //!< particle energy

Expand Down
6 changes: 4 additions & 2 deletions include/openmc/geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@
#include <cstdint>
#include <vector>

#include "openmc/particle.h"

#include "openmc/constants.h"

namespace openmc {

class BoundaryInfo;
class Particle;

//==============================================================================
// Global variables
//==============================================================================
Expand Down
9 changes: 4 additions & 5 deletions include/openmc/mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,8 @@ class StructuredMesh : public Mesh {
//! \param[in] Pointer to bank sites
//! \param[in] Number of bank sites
//! \param[out] Whether any bank sites are outside the mesh
xt::xtensor<double, 1> count_sites(const Particle::Bank* bank,
int64_t length, bool* outside) const;
xt::xtensor<double, 1> count_sites(
const ParticleBank* bank, int64_t length, bool* outside) const;

//! Get bin given mesh indices
//
Expand Down Expand Up @@ -256,9 +256,8 @@ class RegularMesh : public StructuredMesh
//! \param[in] bank Array of bank sites
//! \param[out] Whether any bank sites are outside the mesh
//! \return Array indicating number of sites in each mesh/energy bin
xt::xtensor<double, 1> count_sites(const Particle::Bank* bank,
int64_t length,
bool* outside) const;
xt::xtensor<double, 1> count_sites(
const ParticleBank* bank, int64_t length, bool* outside) const;

// Data members
double volume_frac_; //!< Volume fraction of each mesh element
Expand Down
Loading

0 comments on commit 2af4c9c

Please sign in to comment.