-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNeutron.h
75 lines (61 loc) · 1.68 KB
/
Neutron.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
@file Neutron.h
@brief contains Neutron class
@author Luke Eure
@date January 8 2016
*/
#ifndef NEUTRON_H
#define NEUTRON_H
#include <vector>
#include <cmath>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>
#include "Surface.h"
class Neutron {
public:
Neutron(int neutron_num);
virtual ~Neutron();
void changeCell(int axis, min_max side);
void kill();
void move(double distance);
void reflect(int axis);
void setCell(std::vector <int> &cell_number);
void setGroup(int new_group);
void setPosition(int axis, double value);
void setPositionVector(std::vector <double> &position);
void sampleDirection();
double arand();
double getDirection(int axis);
double getDistance(std::vector <double> &coord);
double getPosition(int axis);
double x();
double y();
double z();
bool alive();
int getGroup();
int rand();
int sampleNeutronEnergyGroup(std::vector <double> chi);
int sampleScatteredGroup(std::vector <double> &scattering_matrix,
int group);
std::vector <int> getCell();
std::vector <double> getPositionVector();
std::vector <double> getDirectionVector();
private:
/** tells if the neutron is alive */
bool _neutron_alive;
/** energy group of the neutron */
int _neutron_group;
/** position of the neutron */
std::vector <double> _xyz;
/** direction of travel of the neutron */
std::vector <double> _neutron_direction;
/** cell of the neutron */
std::vector <int> _neutron_cell;
/** identification number */
int _id;
/** to be used in calling rand_r() */
unsigned int _seed;
};
#endif