1 #include "preprocessor_defines.dat"
2 #include "Class_Global.hpp"
3 #include "Class_Para_Tree.hpp"
4 #include "User_Data_Comm.hpp"
10 int main(
int argc,
char *argv[]) {
13 MPI::Init(argc, argv);
24 for (iter=1; iter<5; iter++){
41 vector<double> oct_data(nocts, 0.0), ghost_data(nghosts, 0.0);
44 for (
int i=0; i<nocts; i++){
45 vector<vector<double> > nodes = pablo14.
getNodes(i);
46 for (
int j=0; j<global2D.
nnodes; j++){
47 double x = nodes[j][0];
48 double y = nodes[j][1];
49 if ((pow((x-xc),2.0)+pow((y-yc),2.0) <= pow(radius,2.0))){
56 for (
int i=0; i<nghosts; i++){
59 vector<vector<double> > nodes = pablo14.
getNodes(oct);
60 for (
int j=0; j<global2D.
nnodes; j++){
61 double x = nodes[j][0];
62 double y = nodes[j][1];
63 if ((pow((x-xc),2.0)+pow((y-yc),2.0) <= pow(radius,2.0))){
72 pablo14.
writeTest(
"Pablo14_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data);
76 for (iter=start; iter<start+25; iter++){
77 vector<double> oct_data_smooth(nocts, 0.0);
78 vector<uint32_t> neigh, neigh_t;
79 vector<bool> isghost, isghost_t;
80 uint8_t iface, nfaces, codim;
81 for (
int i=0; i<nocts; i++){
86 for (codim=1; codim<dim+1; codim++){
93 for (iface=0; iface<nfaces; iface++){
95 neigh.insert(neigh.end(), neigh_t.begin(), neigh_t.end());
96 isghost.insert(isghost.end(), isghost_t.begin(), isghost_t.end());
101 oct_data_smooth[i] = oct_data[i]/(neigh.size()+1);
102 for (
int j=0; j<neigh.size(); j++){
104 oct_data_smooth[i] += ghost_data[neigh[j]]/(neigh.size()+1);
107 oct_data_smooth[i] += oct_data[neigh[j]]/(neigh.size()+1);
114 pablo14.
writeTest(
"Pablo14_iter"+to_string(static_cast<unsigned long long>(iter)), oct_data_smooth);
122 oct_data = oct_data_smooth;
void writeTest(string filename, vector< double > data)
Parallel Octree Manager Class - 2D specialization.
Octant class definition - 2D specialization.
void findNeighbours(uint32_t idx, uint8_t iface, uint8_t codim, u32vector &neighbours, vector< bool > &isghost)
void getNodes(Class_Octant< 2 > *oct, dvector2D &nodes)
uint32_t getNumOctants() const
uint32_t getNumGhosts() const
void updateConnectivity()
void communicate(Class_Data_Comm_Interface< Impl > &userData)
Class_Octant< 2 > * getGhostOctant(uint32_t idx)