PyNE C++
tally.h
1 
6 #ifndef PYNE_IQ4M73STINHJDPRV6KWUZZXOYE
7 #define PYNE_IQ4M73STINHJDPRV6KWUZZXOYE
8 
9 #include <iostream>
10 #include <fstream>
11 #include <string>
12 #include <map>
13 #include <set>
14 #include <stdio.h>
15 #include <stdlib.h>
16 
17 #ifndef PYNE_IS_AMALGAMATED
18  #include "h5wrap.h"
19  #include "utils.h"
20 #endif
21 
22 
23 namespace pyne
24 {
25  class Tally
26  {
27  public:
28  std::map<std::string, std::string> rx2fluka;
29  std::map<std::string, std::string> rx2mcnp5;
30  std::map<std::string, std::string> rx2mcnp6;
31 
33  Tally ();
34 
45  Tally(std::string type, std::string particle_name, int entity,
46  std::string entity_type, std::string entity_name,
47  std::string tally_name = "", double entity_size = 0.0,
48  double normalization = 1.0);
49 
50  ~Tally ();
51 
52 
53  // Create hdf5 datatable for tallies
54  hid_t create_dataspace(hid_t file, std::string datapath);
55 
56  // create filetype of data
57  hid_t create_filetype();
58 
59  // create memory type for tally struct
60  hid_t create_memtype();
61 
67  void from_hdf5(char * filename, char *datapath, int row = -1);
68 
74  void from_hdf5(std::string filename, std::string datapath, int row = -1);
75 
80  void write_hdf5( char * filename, char * datapath);
81 
86  void write_hdf5(std::string filename, std::string datapath);
87 
88  // mcnp tally
89  std::string mcnp(int tally_index = 1, std::string mcnp_version = "mcnp5" );
90 
91  // fluka tally
92  std::string fluka(std::string unit_number = "-21");
93 
95  std::string entity_type;
96  std::string entity_name;
97  std::string particle_name;
98  std::string tally_type;
99  std::string tally_name;
100  int entity_id;
101  double entity_size;
102  double normalization;
103  };
104 
106  std::ostream& operator<< (std::ostream& os, Tally tally);
107 
108 
112  typedef struct tally_struct {
113  int entity_id;
114  int entity_type;
115  int tally_type;
116  const char * particle_name;
117  const char * entity_name;
118  const char * tally_name;
119  double entity_size;
120  double normalization;
121  } tally_struct;
122 
123 // End pyne namespace
124 }
125 
126 #endif
double entity_size
the physical size of the entity
Definition: tally.h:101
std::string tally_type
type of tally flux or current
Definition: tally.h:98
std::string tally_name
name of the tally
Definition: tally.h:99
std::string entity_name
the name of the entity (optional)
Definition: tally.h:96
Definition: tally.h:112
std::string entity_type
fundamental tally variables
Definition: tally.h:95
std::string particle_name
particle name string
Definition: tally.h:97
struct pyne::tally_struct tally_struct
Tally()
Tally Constructors.
Definition: tally.cpp:33
Provides some HDF5 helper functionality in its own namespace.
Definition: tally.h:25
std::ostream & operator<<(std::ostream &os, Material mat)
Definition: material.cpp:1053
void write_hdf5(char *filename, char *datapath)
Definition: tally.cpp:154
A container representing enrichment cascades.
Definition: _atomic_data.h:7
int entity_id
id number of the entity being tallied upon
Definition: tally.h:100
void from_hdf5(char *filename, char *datapath, int row=-1)
Definition: tally.cpp:69
double normalization
the tally normalization
Definition: tally.h:102
hid_t create_dataspace(hid_t file, std::string datapath)
default destructor
Definition: tally.cpp:216