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++){
41 vector<double> oct_data(nocts, 0.0);
42 vector<double> ghost_data(nghosts, 0.0);
45 for (
int i=0; i<nocts; i++){
47 vector<double> center = pablo17a.
getCenter(i);
48 oct_data[i] = (pow((center[0]-xc),2.0)+pow((center[1]-yc),2.0));
50 vector<vector<double> > nodes = pablo17a.
getNodes(i);
51 for (
int j=0; j<global2D.
nnodes; j++){
52 double x = nodes[j][0];
53 double y = nodes[j][1];
54 if ((pow((x-xc),2.0)+pow((y-yc),2.0) <= pow(radius,2.0))){
73 pablo17a.
write(
"Pablo17a_iter"+to_string(static_cast<unsigned long long>(iter)));
78 for (iter=start; iter<start+2; iter++){
79 for (
int i=0; i<nocts; i++){
81 vector<double> center = pablo17a.
getCenter(i);
83 vector<vector<double> > nodes = pablo17a.
getNodes(i);
84 for (
int j=0; j<global2D.
nnodes; j++){
85 double x = nodes[j][0];
86 double y = nodes[j][1];
87 if ((pow((x-xc),2.0)+pow((y-yc),2.0) <= pow(radius,2.0))){
103 vector<double> oct_data_new;
104 vector<uint32_t> mapper;
105 vector<bool> isghost;
106 pablo17a.
adapt(
true);
108 oct_data_new.resize(nocts, 0.0);
113 for (uint32_t i=0; i<nocts; i++){
116 for (
int j=0; j<global2D.
nchildren; j++){
118 oct_data_new[i] += ghost_data[mapper[j]]/global3D.
nchildren;
121 oct_data_new[i] += oct_data[mapper[j]]/global3D.
nchildren;
126 oct_data_new[i] += oct_data[mapper[0]];
129 oct_data_new[i] += oct_data[mapper[0]];
132 oct_data = oct_data_new;
133 oct_data_new.clear();
137 pablo17a.
writeTest(
"Pablo17a_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data);
150 pablo17a.
writeTest(
"Pablo17a_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data);
156 vector<pair<pair<uint32_t,uint32_t>, pair<int, int> > > mapPablo;
159 vector<double> oct_data_b(nocts);
165 for (
int i=0; i<nocts; i++){
166 oct_data_b[i] = mapPablo[i].first.first;
171 pablo17b.
writeTest(
"Pablo17b_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
uint32_t getNumGhosts() 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)