-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathudist.h
60 lines (48 loc) · 1.68 KB
/
udist.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
#ifndef UDIST_H_
#define UDIST_H_
#include "zpic.h"
#include <iostream>
#include "particles.h"
namespace UDistribution {
class Type {
public:
virtual Type * clone() const = 0;
virtual void set( Particles & part, unsigned int seed ) const = 0;
virtual ~Type() = default;
};
class None : public Type {
public:
None * clone() const override { return new None(); };
void set( Particles & part, unsigned int seed ) const override ;
};
class Cold : public Type {
public:
const float3 ufl;
Cold( float3 const ufl ) : ufl(ufl) {};
Cold * clone() const override { return new Cold(ufl); };
void set( Particles & part, unsigned int seed ) const override ;
};
class Thermal : public Type {
public:
const float3 uth;
const float3 ufl;
Thermal( float3 const uth, float3 const ufl ) : uth(uth), ufl(ufl) {};
Thermal * clone() const override { return new Thermal(uth, ufl); };
void set( Particles & part, unsigned int seed ) const override ;
};
class ThermalCorr : public Type {
public:
const float3 uth;
const float3 ufl;
const int npmin;
ThermalCorr( float3 const uth, float3 const ufl, int const npmin = 2 ) : uth(uth), ufl(ufl), npmin(npmin) {
if ( npmin <= 1 ) {
std::cout << "(*error*) invalid npmin parameter, must be > 1\n";
exit(1);
}
};
ThermalCorr * clone() const override { return new ThermalCorr(uth, ufl,npmin); };
void set( Particles & part, unsigned int seed ) const override ;
};
}
#endif