-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_test2.cc
49 lines (38 loc) · 1.13 KB
/
main_test2.cc
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
#include "mesh.hh"
#include <string>
#include <iostream>
#include <vector>
long long Point :: globalId;
long long Point :: globalDdl;
double f(double x, double y) {
return 2 * M_PI * M_PI * sin(M_PI * x) * cos(M_PI * y);
}
double realSolutionSquare(double x, double y) {
return sin(M_PI * x) * cos(M_PI * y);
}
int main() {
Point :: resetGlobals();
Mesh mesh("simple_mesh.msh");
mesh.test();
mesh.assemble();
mesh.solve();
std :: cout << "Error: " << mesh.computeError() << std :: endl;
mesh.GNUPlotExport("test.dat");
mesh.ParaviewExport("final.txt");
Point :: resetGlobals();
Mesh halfMesh("half_second.msh");
halfMesh.test();
halfMesh.assemble();
halfMesh.solve();
std :: cout << "Error: " << halfMesh.computeError() << std :: endl;
halfMesh.GNUPlotExport("test.dat.dat");
halfMesh.ParaviewExport("final.txt.txt");
Point :: resetGlobals();
Mesh quarterMesh("quarter_second.msh");
quarterMesh.test();
quarterMesh.assemble();
quarterMesh.solve();
std :: cout << "Error: " << quarterMesh.computeError() << std :: endl;
quarterMesh.GNUPlotExport("test.dat.dat.dat");
quarterMesh.ParaviewExport("final.txt.txt.txt");
}