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++){
37 vector<double> oct_data(nocts, 0.0);
40 for (
int i=0; i<nocts; i++){
42 vector<vector<double> > nodes = pablo5.
getNodes(i);
43 vector<double> center = pablo5.
getCenter(i);
44 for (
int j=0; j<global2D.
nnodes; j++){
45 double x = nodes[j][0];
46 double y = nodes[j][1];
47 if ((pow((x-xc),2.0)+pow((y-yc),2.0) <= pow(radius,2.0))){
48 oct_data[i] = (pow((center[0]-xc),2.0)+pow((center[1]-yc),2.0));
56 pablo5.
writeTest(
"Pablo5_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data);
60 for (iter=start; iter<start+2; iter++){
61 for (
int i=0; i<nocts; i++){
63 vector<vector<double> > nodes = pablo5.
getNodes(i);
64 vector<double> center = pablo5.
getCenter(i);
65 for (
int j=0; j<global2D.
nnodes; j++){
66 double x = nodes[j][0];
67 double y = nodes[j][1];
68 if ((pow((x-xc),2.0)+pow((y-yc),2.0) <= pow(radius,2.0))){
84 vector<double> oct_data_new;
85 vector<uint32_t> mapper;
89 oct_data_new.resize(nocts, 0.0);
94 for (uint32_t i=0; i<nocts; i++){
98 oct_data_new[i] += oct_data[mapper[j]]/global2D.
nchildren;
102 oct_data_new[i] += oct_data[mapper[0]];
105 oct_data_new[i] += oct_data[mapper[0]];
111 pablo5.
writeTest(
"Pablo5_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data_new);
113 oct_data = oct_data_new;
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)