Store reactions as a vector on Nuclide

This commit is contained in:
Paul Romano 2018-11-16 16:22:22 -06:00
parent 2c8bdbba6e
commit 71e36db418
6 changed files with 164 additions and 55 deletions

View file

@ -5,11 +5,13 @@
#define OPENMC_NUCLIDE_H
#include <array>
#include <memory> // for unique_ptr
#include <vector>
#include <hdf5.h>
#include "openmc/constants.h"
#include "openmc/reaction.h"
namespace openmc {
@ -20,7 +22,7 @@ namespace openmc {
class Nuclide {
public:
// Constructors
Nuclide(hid_t group);
Nuclide(hid_t group, const double* temperature, int n);
// Data members
std::string name_; //! Name of nuclide, e.g. "U235"
@ -28,7 +30,7 @@ public:
int A_; //! Mass number
int metastable_; //! Metastable state
double awr_; //! Atomic weight ratio
std::vector<std::unique_ptr<Reaction>> reactions_; //! Reactions
};
//==============================================================================
@ -42,7 +44,7 @@ namespace data {
extern std::array<double, 2> energy_min;
extern std::array<double, 2> energy_max;
extern std::vector<Nuclide> nuclides;
extern std::vector<std::unique_ptr<Nuclide>> nuclides;
} // namespace data

View file

@ -51,8 +51,6 @@ std::string reaction_name(int mt);
//==============================================================================
extern "C" {
Reaction* reaction_from_hdf5(hid_t group, int* temperatures, int n);
void reaction_delete(Reaction* rx);
int reaction_mt(Reaction* rx);
double reaction_q_value(Reaction* rx);
bool reaction_scatter_in_cm(Reaction* rx);