1 #include "preprocessor_defines.dat"
2 #include "Class_Global.hpp"
3 #include "Class_Para_Tree.hpp"
9 int main(
int argc,
char *argv[]) {
12 MPI::Init(argc, argv);
25 for (iter=1; iter<6; iter++){
39 vector<double> oct_data(nocts, 0.0);
42 for (
int i=0; i<nocts; i++){
44 vector<double> center = pablo7a.
getCenter(i);
45 oct_data[i] = (pow((center[0]-xc),2.0)+pow((center[1]-yc),2.0));
47 vector<vector<double> > nodes = pablo7a.
getNodes(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))){
70 pablo7a.
write(
"Pablo7a_iter"+to_string(static_cast<unsigned long long>(iter)));
75 for (iter=start; iter<start+2; iter++){
76 for (
int i=0; i<nocts; i++){
78 vector<double> center = pablo7a.
getCenter(i);
80 vector<vector<double> > nodes = pablo7a.
getNodes(i);
81 for (
int j=0; j<global2D.
nnodes; j++){
82 double x = nodes[j][0];
83 double y = nodes[j][1];
84 if ((pow((x-xc),2.0)+pow((y-yc),2.0) <= pow(radius,2.0))){
100 vector<double> oct_data_new;
101 vector<uint32_t> mapper;
102 vector<bool> isghost;
105 oct_data_new.resize(nocts, 0.0);
110 for (uint32_t i=0; i<nocts; i++){
113 for (
int j=0; j<global2D.
nchildren; j++){
114 oct_data_new[i] += oct_data[mapper[j]]/global2D.
nchildren;
118 oct_data_new[i] += oct_data[mapper[0]];
121 oct_data_new[i] += oct_data[mapper[0]];
124 oct_data = oct_data_new;
125 oct_data_new.clear();
129 pablo7a.
writeTest(
"Pablo7a_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data);
135 vector<pair<pair<uint32_t,uint32_t>, pair<int, int> > > mapPablo;
138 vector<double> oct_data_b(nocts);
140 for (
int i=0; i<nocts; i++){
141 oct_data_b[i] = oct_data[mapPablo[i].first.second];
146 pablo7b.
writeTest(
"Pablo7b_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data_b);
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
void getMapping(uint32_t &idx, u32vector &mapper, vector< bool > &isghost)
void updateConnectivity()
vector< pair< pair< uint32_t, uint32_t >, pair< int, int > > > mapPablos(Class_Para_Tree< 2 > &ptree)
bool getIsNewR(Class_Octant< 2 > *oct)
void write(string filename)
void setBalance(Class_Octant< 2 > *oct, bool balance)
void getCenter(Class_Octant< 2 > *oct, vector< double > ¢er)