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 = pablo16.
getNodes(i);
47 vector<double> center = pablo16.
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 pablo16.
writeTest(
"Pablo16_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data);
64 for (iter=start; iter<start+2; iter++){
65 for (
int i=0; i<nocts; i++){
67 vector<vector<double> > nodes = pablo16.
getNodes(i);
69 vector<double> center = pablo16.
getCenter(i);
70 for (
int j=0; j<global2D.
nnodes; j++){
71 double x = nodes[j][0];
72 double y = nodes[j][1];
73 if ((pow((x-xc),2.0)+pow((y-yc),2.0) <= pow(radius,2.0))){
89 vector<double> oct_data_new;
90 vector<uint32_t> mapper;
94 oct_data_new.resize(nocts, 0.0);
99 for (uint32_t i=0; i<nocts; i++){
102 for (
int j=0; j<global2D.
nchildren; j++){
104 oct_data_new[i] += ghost_data[mapper[j]]/global3D.
nchildren;
107 oct_data_new[i] += oct_data[mapper[j]]/global3D.
nchildren;
112 oct_data_new[i] += oct_data[mapper[0]];
118 pablo16.
writeTest(
"Pablo16_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data_new);
120 oct_data = oct_data_new;
133 pablo16.
writeTest(
"Pablo16_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 setBalance(Class_Octant< 2 > *oct, bool balance)
void getCenter(Class_Octant< 2 > *oct, vector< double > ¢er)