-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathread_seaSurfaceTemp_data.edp
77 lines (50 loc) · 1.5 KB
/
read_seaSurfaceTemp_data.edp
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
//
string meshType = "golfo/";
string foldername = "data/emanuele/" + meshType;
mesh Th = readmesh(foldername + "mesh.mesh");
plot(Th, WindowIndex=1);
// number of locations
int nLocs = 30;
real[int, int] locations(nLocs, 2);
real[int] observations(nLocs);
// read files
ifstream inputLocs(foldername + "locations.txt");
ifstream inputObs(foldername + "observations.txt");
// Read the file and fill the matrix
for (int i = 0; i < nLocs; ++i) {
for (int j = 0; j < 2; ++j) {
inputLocs >> locations(i, j);
}
inputObs >> observations(i);
}
// Print the matrix to verify the content
cout << "Locations content:\n";
for (int i = 0; i < nLocs; ++i) {
for (int j = 0; j < 2; ++j) {
cout << locations(i, j) << " ";
}
cout << endl;
}
cout << "Observations content:\n";
for (int i = 0; i < nLocs; ++i) {
cout << observations(i) << " " << endl;
}
// read transport field
ifstream inputBetaX(foldername + "Beta_X.txt");
real[int] vecBetaX(Th.nv);
ifstream inputBetaY(foldername + "Beta_Y.txt");
real[int] vecBetaY(Th.nv);
for(int i = 0; i < Th.nv; i++){
inputBetaX >> vecBetaX(i);
inputBetaY >> vecBetaY(i);
}
cout << "Beta content:\n";
for (int i = 0; i < Th.nv; ++i){
cout << vecBetaX(i) << " " << vecBetaY(i) << endl;
}
fespace Vh(Th, P1);
Vh betaX, betaY; //
betaX[] = vecBetaX;
betaY[] = vecBetaY;
plot([betaX], value = 1, fill = 1, wait = 0, cmm = "Beta_X", WindowIndex = 2);
plot([betaY], value = 1, fill = 1, wait = 0, cmm = "Beta_Y", WindowIndex = 3);