-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathReaction.h
84 lines (64 loc) · 1.97 KB
/
Reaction.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
76
77
78
79
80
81
82
83
84
/*
Author: ESGonzalez
Date: 2/20/18
*/
#ifndef __REACTION_H__
#define __REACTION_H__
#include <vector>
#include <iostream>
#include <string>
#include <memory>
#include <stack>
#include <utility>
#include "Particle.h"
#include "Source.h"
typedef std::shared_ptr< Particle > Part_ptr;
typedef std::shared_ptr< Source > Source_ptr;
class Reaction
// Need to add safety features
{
protected:
std::string rxnName;
int nGroups;
public:
Reaction( int ng ) : nGroups( ng ) {};
~Reaction() {};
virtual std::string name() final { return rxnName; };
virtual double getXS ( Part_ptr p ) = 0;
virtual void sample ( Part_ptr p, std::stack< Part_ptr > & bank ) = 0;
};
class Capture : public Reaction
{
private:
std::vector< double > captureXS; // size g
public:
Capture( int ng, std::vector< double > captureXSi ) : Reaction( ng ), captureXS( captureXSi ) { rxnName = "Capture"; };
~Capture() {};
double getXS( Part_ptr p );
void sample( Part_ptr p, std::stack< Part_ptr > &bank );
};
class Scatter : public Reaction
{
private:
std::vector< std::vector< double > > scatterXS; // size g^2
std::vector< double > scatterTotalXS; // size g-> the total for each group (s11+s12+s13...+s1g)
public:
Scatter( int ng, std::vector< std::vector< double > > scatterXSi );
~Scatter() {};
double getXS( Part_ptr p );
void sample( Part_ptr p, std::stack< Part_ptr > &bank );
};
class Fission : public Reaction
{
private:
std::vector< double > fissionXS; // size g
std::vector< double > nu; // size g
std::vector< double > chi; // size g
public:
Fission( int ng, std::vector< double > fissionXSi, std::vector< double > nui, std::vector< double > chii )
: Reaction( ng ), fissionXS( fissionXSi ), nu( nui ), chi( chii ) { rxnName = "Fission"; };
~Fission() {};
double getXS ( Part_ptr p );
void sample( Part_ptr p, std::stack< Part_ptr > &bank );
};
#endif