rheolef  6.5
hack_array_seq_tst.cc
Go to the documentation of this file.
1 // alloues dynamiquement => la memoire n'est pas contigue globalement
2 #include "rheolef/hack_array.h"
3 #include "rheolef/geo_element.h"
4 using namespace rheolef;
5 using namespace std;
6 
7 int main(int argc, char**argv)
8 {
9  environment distributed (argc, argv);
10 
11  distributor ownership (distributor::decide, communicator(), 1); // n=1
12  geo_element::parameter_type param (reference_element::e, 1); // edge, order 1
13  hack_array<geo_element_hack, sequential> ge_e (ownership,param);
14  geo_element& E = ge_e [0];
15 
16  E [0] = 18;
17  E [1] = 12;
18  cout << "E = " << E << endl;
19 
20  geo_element_auto<> E2 = E;
21  E2[0] = 5;
22  cout << "E2 = " << E2 << endl;
23  cout << "E = " << E << endl;
24 
25  E = E2;
26  cout << "E = " << E << endl;
27 
28  E [0] = 3;
29  cout << "E = " << E << endl;
30  E2 = E;
31  cout << "E2 = " << E2 << endl;
32 
33  cout << "array " << ge_e.size() << endl;
34  ge_e.put_values(dout);
35 }
36