1 #include "moab/Core.hpp"
2 #include "moab/Range.hpp"
3 #include <iostream>
4 #define MCNP mc_instance()
5 #define BOXMIN_TAG "BOXMIN_TAG"
6 #define BOXMAX_TAG "BOXMAX_TAG"
7 #define TALLY_TAG  "TALLY_TAG"
8 #define ERROR_TAG  "ERROR_TAG"
9 
10 #define MBI mb_instance()
11 
12 enum MCNPError { MCNP_SUCCESS, MCNP_FAILURE, DONE };
13 enum { NOSYS, CARTESIAN, CYLINDRICAL, SPHERICAL };
14 
15 class McnpData {
16 
17       public:
18             // Constructor and Destructor
19             McnpData ();
20             ~McnpData ();
21 
22             // Coordinate system and rotation matrix
23             int coord_system;
24             double rotation_matrix[16];
25 
26             // Vertices and elements
27             std::vector<moab::EntityHandle> MCNP_vertices;
28             std::vector<moab::EntityHandle> MCNP_elems;
29             moab::Range                 vert_handles;
30             moab::Range                 elem_handles;
31 
32             // Tally data
33             moab::Tag box_min_tag, box_max_tag;
34             moab::Tag tally_tag;
35             moab::Tag relerr_tag;
36 
37             // MCNP Meshtal file name
38             std::string MCNP_filename;
39 
40             // Setting and retrieving coordinate sysem
41             MCNPError set_coord_system(int);
42             int get_coord_system();
43 
44             // Setting and retrieving roation matrix
45             MCNPError set_rotation_matrix(double[16]);
46             double* get_rotation_matrix();
47 
48             // Set the filename
49             MCNPError set_filename(std::string);
50             std::string get_filename();
51 
52             // MCNP reading routines
53             MCNPError read_mcnpfile(bool);
54             MCNPError read_coord_system(std::string);
55             MCNPError read_rotation_matrix(std::string, int);
56             MCNPError make_elements(std::vector<double> [3], int*);
57             MCNPError make_adjacencies(int*);
58             MCNPError initialize_tags();
59             MCNPError extract_tally_data(std::string, moab::EntityHandle);
60 
61             // Transformation routine
62             MCNPError transform_point(double*, double*, int, double*);
63 };
64