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++){
40 vector<double> oct_data(nocts, 0.0), ghost_data(nghosts, 0.0);
43 for (
int i=0; i<nocts; i++){
45 vector<vector<double> > nodes = pablo15.
getNodes(i);
47 vector<double> center = pablo15.
getCenter(i);
48 for (
int j=0; j<global2D.
nnodes; j++){
49 double x = nodes[j][0];
50 double y = nodes[j][1];
51 if ((pow((x-xc),2.0)+pow((y-yc),2.0) <= pow(radius,2.0))){
52 oct_data[i] = (pow((center[0]-xc),2.0)+pow((center[1]-yc),2.0));
60 pablo15.
writeTest(
"Pablo15_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data);
65 vector<double> weight(nocts, 1.0),weightGhost;
66 for (iter=start; iter<start+2; iter++){
67 for (
int i=0; i<nocts; i++){
69 vector<vector<double> > nodes = pablo15.
getNodes(i);
71 vector<double> center = pablo15.
getCenter(i);
72 for (
int j=0; j<global2D.
nnodes; j++){
74 double x = nodes[j][0];
75 double y = nodes[j][1];
76 if ((pow((x-xc),2.0)+pow((y-yc),2.0) <= pow(radius,2.0))){
94 vector<double> oct_data_new;
95 vector<double> weight_new;
96 vector<uint32_t> mapper;
100 oct_data_new.resize(nocts, 0.0);
101 weight_new.resize(nocts,0.0);
106 for (uint32_t i=0; i<nocts; i++){
109 for (
int j=0; j<global2D.
nchildren; j++){
110 oct_data_new[i] += oct_data[mapper[j]]/global2D.
nchildren;
111 weight_new[i] += weight[mapper[j]];
115 oct_data_new[i] += oct_data[mapper[0]];
116 weight_new[i] += weight[mapper[0]];
119 oct_data_new[i] += oct_data[mapper[0]];
120 weight_new[i] += weight[mapper[0]];
126 pablo15.
writeTest(
"Pablo15_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data_new);
128 oct_data = oct_data_new;
140 for (
int i=0; i<weight.size(); i++){
143 cout << pablo15.
rank <<
" weight : " << tot << endl;
144 cout << pablo15.
rank <<
" size : " << weight.size() << endl;
149 pablo15.
writeTest(
"Pablo15_iter"+to_string(static_cast<unsigned long long>(iter)), weight);
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()
bool getIsNewR(Class_Octant< 2 > *oct)
void setBalance(Class_Octant< 2 > *oct, bool balance)
void getCenter(Class_Octant< 2 > *oct, vector< double > ¢er)