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++){
45 vector<double> oct_data(nocts, 0.0), ghost_data(nghosts, 0.0);
48 for (
int i=0; i<nocts; i++){
50 vector<vector<double> > nodes = pablo116.
getNodes(i);
52 vector<double> center = pablo116.
getCenter(i);
53 for (
int j=0; j<global3D.
nnodes; j++){
54 double x = nodes[j][0];
55 double y = nodes[j][1];
56 if ((pow((x-xc),2.0)+pow((y-yc),2.0) <= pow(radius,2.0))){
57 oct_data[i] = (pow((center[0]-xc),2.0)+pow((center[1]-yc),2.0));
65 pablo116.
writeTest(
"Pablo116_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data);
69 for (iter=start; iter<start+2; iter++){
70 for (
int i=0; i<nocts; i++){
72 vector<vector<double> > nodes = pablo116.
getNodes(i);
74 vector<double> center = pablo116.
getCenter(i);
75 for (
int j=0; j<global3D.
nnodes; j++){
76 double x = nodes[j][0];
77 double y = nodes[j][1];
78 if ((pow((x-xc),2.0)+pow((y-yc),2.0) <= pow(radius,2.0))){
94 vector<double> oct_data_new;
95 vector<uint32_t> mapper;
99 oct_data_new.resize(nocts, 0.0);
104 for (uint32_t i=0; i<nocts; i++){
107 for (
int j=0; j<global3D.
nchildren; j++){
109 oct_data_new[i] += ghost_data[mapper[j]]/global3D.
nchildren;
112 oct_data_new[i] += oct_data[mapper[j]]/global3D.
nchildren;
117 oct_data_new[i] += oct_data[mapper[0]];
120 oct_data_new[i] += oct_data[mapper[0]];
126 pablo116.
writeTest(
"Pablo116_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data_new);
128 oct_data = oct_data_new;
141 pablo116.
writeTest(
"Pablo116_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data);
Parallel Octree Manager Class - 3D specialization.
void getCenter(Class_Octant< 3 > *oct, dvector ¢er)
bool getIsNewC(Class_Octant< 3 > *oct)
void getNodes(Class_Octant< 3 > *oct, dvector2D &nodes)
uint32_t getNumOctants() const
void setMarker(Class_Octant< 3 > *oct, int8_t marker)
void getMapping(uint32_t &idx, u32vector &mapper, vector< bool > &isghost)
void writeTest(string filename, vector< double > data)
void updateConnectivity()
bool getIsNewR(Class_Octant< 3 > *oct)
void setBalance(Class_Octant< 3 > *oct, bool balance)
uint32_t getNumGhosts() const