-
Notifications
You must be signed in to change notification settings - Fork 0
/
poissonSOR.h
64 lines (59 loc) · 1.49 KB
/
poissonSOR.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
#include <cmath>
#include <cstdio>
#include <vector>
#include <string>
#define MAX_SIZE 10000
#define STD_MAX_ITER 1000
typedef struct Dominio dominio;
enum type {
NIL,
VALIDACAO,
CAPACITORES
};
class poissonSOR {
private:
dominio* dom;
int a, b, c, d, e;
int nx, ny;
double w;
double fp[MAX_SIZE] = {};
double vp[MAX_SIZE] = {};
double ground[MAX_SIZE] = {};
double ground_ep[MAX_SIZE] = {};
double ep[MAX_SIZE] = {};
double hx, hy;
double (*aproxFunc)(double, double);
double (*grndFunc) (double, double);
std::vector<double (*) (double, double)> contornos;
type t;
int vecSize;
double erro_vp;
double erro_ele;
int maxIter;
public:
poissonSOR(int x0, int x1, int y0, int y1, double hx, double hy);
~poissonSOR();
void setType(type t);
void addContorno(double (*f) (double, double));
void setFXY(double (*fxy) (double, double));
void setValFunc(double (*f) (double, double));
void debug();
void process();
void resize(double hx, double hy);
void writeOutputData();
double getErro() { return this->erro_vp; };
double getErroEle() { return this->erro_ele; };
void setMaxIter(int it) {this->maxIter = it; };
int getMaxIter() { return this->maxIter; };
void reset();
private:
void calcFp();
void checkContornos();
void calcExact();
void doSOR();
void calcErr();
void calcCampElet();
void calcCampElet_e();
void calcErrEle();
void gaussSeidel();
};