-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlangevin.hpp
89 lines (72 loc) · 2.01 KB
/
langevin.hpp
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
85
86
87
88
89
/*
Langevin.hpp
Langevin dynamics class.
@author Rory Mills-Williams
@version 1.0 20/01/2022
*/
#ifndef BVPSDEHEADERDEF
#define BVPSDEHEADERDEF
#include <math.h>
#include <string>
#include <vector>
#include "ou.hpp"
#include "langevin_sde.hpp"
#include "mckean_vlasov.hpp"
#include "sde.hpp"
#include "solver.hpp"
#include "euler_maruyama.hpp"
#include "boundary_conditions.hpp"
class Langevin
{
private:
// Only allow instance to be created from a SDE, boundary
// conditions, and number of particles(the
// copy constructor is private)
Langevin(const Langevin& otherLangevin){}
// Number of particles in in domain
int mNumParticles;
// Pointer to instance of an SDE
SDE* mpSDE;
// Initial data function pointer
void (*mpInitialFun)(double* pInitData, double* yInit, int& numParticles);
double* mpInitData;
// // Pointer to an instance of boundary conditions
// BoundaryConditions* mpBconds;
std::string mBConds;
// Pointer to instance of a solver
Solver* mpSolver;
// Pointer for solution to particle trajectories and time
double** mpParticles;
double* mpTime;
// Allow user to specify the output file or
// use a default name
std::string mOutputData;
std::string mNumList;
std::string mPhysList;
// // Methods for setting up langevin system and solving it
void SetSDE();
void SetConstants();
void SetInitialData();
public:
// Sole constructor
Langevin(opts_num* opts1,
SDE* pSde,
void (*pInitialData)(double*,double*, int&),
std::string BC);
// As memory is dynamically allocated the destructor
// is overridden
~Langevin();
opts_num optsNum;
opts_phys optsPhys;
void SetFilename(const std::string& dataName,
const std::string& numName,
const std::string& physName)
{
mOutputData = dataName;
mNumList = numName;
mPhysList = physName;
}
void DoStochastics();
void WriteSolutionFile();
};
#endif