1 #include "preprocessor_defines.dat"
2 #include "Class_Global.hpp"
3 #include "Class_Para_Tree.hpp"
4 #include "User_Data_Comm.hpp"
5 #include "User_Data_LB.hpp"
11 int main(
int argc,
char *argv[]) {
14 MPI::Init(argc, argv);
28 for (iter=1; iter<6; iter++){
47 vector<double> oct_data(nocts, 0.0), ghost_data(nghosts, 0.0);
50 for (
int i=0; i<nocts; i++){
52 vector<vector<double> > nodes = pablo.
getNodes(i);
54 vector<double> center = pablo.
getCenter(i);
55 for (
int j=0; j<global2D.
nnodes; j++){
56 double x = nodes[j][0];
57 double y = nodes[j][1];
58 if ((pow((x-xc),2.0)+pow((y-yc),2.0) <= pow(radius,2.0))){
59 oct_data[i] = (pow((center[0]-xc),2.0)+pow((center[1]-yc),2.0));
75 pablo.
writeTest(
"Pablo_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data);
79 for (iter=start; iter<start+2; iter++){
80 for (
int i=0; i<nocts; i++){
82 vector<vector<double> > nodes = pablo.
getNodes(i);
84 vector<double> center = pablo.
getCenter(i);
85 for (
int j=0; j<global2D.
nnodes; j++){
86 double x = nodes[j][0];
87 double y = nodes[j][1];
88 if ((pow((x-xc),2.0)+pow((y-yc),2.0) <= pow(radius,2.0))){
104 vector<double> oct_data_new, ghost_data_new;
105 vector<uint32_t> mapper;
106 vector<bool> isghost;
110 oct_data_new.resize(nocts, 0.0);
111 ghost_data_new.resize(nghosts, 0.0);
116 cout <<
"iter " << iter << endl;
117 for (uint32_t i=0; i<nocts; i++){
120 for (
int j=0; j<global2D.
nchildren; j++){
122 cout << pablo.
rank <<
" using ghost for idx " << i << endl;
123 oct_data_new[i] += ghost_data[mapper[j]]/global2D.
nchildren;
126 oct_data_new[i] += oct_data[mapper[j]]/global2D.
nchildren;
131 oct_data_new[i] += oct_data[mapper[0]];
134 oct_data_new[i] += oct_data[mapper[0]];
138 oct_data = oct_data_new;
139 ghost_data = ghost_data_new;
149 ghost_data_new.resize(nghosts, 0.0);
150 ghost_data = ghost_data_new;
159 cout <<
" Out comm " << endl;
163 pablo.
writeTest(
"Pablo_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data);
170 pablo.
writeTest(
"Pablo_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data);
void writeTest(string filename, vector< double > data)
Parallel Octree Manager Class - 2D specialization.
void setMarker(Class_Octant< 2 > *oct, int8_t marker)
bool getIsNewC(Class_Octant< 2 > *oct)
void getNodes(Class_Octant< 2 > *oct, dvector2D &nodes)
uint32_t getNumOctants() const
uint32_t getNumGhosts() const
void getMapping(uint32_t &idx, u32vector &mapper, vector< bool > &isghost)
void updateConnectivity()
void communicate(Class_Data_Comm_Interface< Impl > &userData)
bool getIsNewR(Class_Octant< 2 > *oct)
void setBalance(Class_Octant< 2 > *oct, bool balance)
void getCenter(Class_Octant< 2 > *oct, vector< double > ¢er)