-
Notifications
You must be signed in to change notification settings - Fork 0
/
gpdeprogram.h
165 lines (160 loc) · 4.32 KB
/
gpdeprogram.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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
# ifndef __GPDEPROGRAM__H
# include <gprogram.h>
# include <fparser.hh>
# include <isinf.h>
# include <QLibrary>
/* GBOUNDF: The definition
* */
typedef double(*GBOUNDF)(double);
typedef double(*GFBOUNDF)(double*);
typedef double(*GPDE)(double,double,double,double, double, double ,double);
typedef double(*GFPDE)(double*,double *, double *, double *, double *,double *,double *);
/**
* @brief The GPdeProgram class implements programs, that
* try to solve PDE's in R^2 with Dirichlet
* boundary conditions.
*/
class GPdeProgram :public GProgram
{
private:
/**
* @brief x0,x1,y0,y1 The boundaries of the pde.
*/
double x0,x1,y0,y1;
/**
* @brief npoints The number of training points of the pde.
*/
int npoints;
/**
* @brief bpoints The number of training points of the pde,
* across each boundary.
*/
int bpoints;
/**
* @brief f0 The boundary condition at x=x0.
*/
GBOUNDF f0;
/**
* @brief f1 The boundary condition at x=x1.
*/
GBOUNDF f1;
/**
* @brief g0 The boundary condition at y=y0.
*/
GBOUNDF g0;
/**
* @brief g1 The boundary condition at y=y1.
*/
GBOUNDF g1;
/**
* @brief ff0 The same as f0, but for the Fortran
* programming language.
*/
GFBOUNDF ff0;
/**
* @brief ff1 The same as f1, but for the Fortran
* programming language.
*/
GFBOUNDF ff1;
/**
* @brief fg0 The same as g0, but for the Fortran
* programming language.
*/
GFBOUNDF fg0;
/**
* @brief fg1 The same as g1, but for the Fortran
* programming language.
*/
GFBOUNDF fg1;
/**
* @brief pde The PDE to be solved.
*/
GPDE pde;
/**
* @brief fpde The same as pde but for the Fortran
* programming language.
*/
GFPDE fpde;
/**
* @brief parser An auxilary object of FunctionParser, for parsing and
* evaluating functions and derivatives.
*/
FunctionParser parser;
/**
* @brief ptr pointer the dll containing the DE equation.
*/
QLibrary *ptr;
public:
/**
* @brief GPdeProgram The first constructor of the class. It sets
* the boundaries of the pde and the number of
* training points and boundary points.
* @param X0
* @param X1
* @param Y0
* @param Y1
* @param n
* @param b
*/
GPdeProgram(double X0,double X1,double Y0,double Y1,int n,int b);
/**
* @brief GPdeProgram The second constructor of the class. It loads
* all the parameters of the pde from the dll
* named filename.
* @param filename
*/
GPdeProgram(QString filename);
/**
* @brief getX0
* @return the left boundary on xx'.
*/
double getX0() const;
/**
* @brief getX1
* @return the right boundary on xx'.
*/
double getX1() const;
/**
* @brief getY0
* @return the left boundary on yy'.
*/
double getY0() const;
/**
* @brief getY1
* @return the right boundary on yy'.
*/
double getY1() const;
/**
* @brief getNpoints the number of training points.
* @return
*/
double getNpoints() const;
/**
* @brief getBoundaryPoints
* @return the number of boundary points.
*/
double getBoundaryPoints() const;
/**
* @brief setBoundaries It sets the boundary conditions.
* @param F0
* @param F1
* @param G0
* @param G1
*/
void setBoundaries(GBOUNDF F0,GBOUNDF F1,GBOUNDF G0,GBOUNDF G1);
/**
* @brief setPde It sets the PDE.
* @param p
*/
void setPde(GPDE p);
/**
* @brief fitness
* @param genome
* @return the fitness value for the integer
* array genome.
*/
virtual double fitness(vector<int> &genome);
~GPdeProgram();
};
# define __GPDEPROGRAM__H
# endif