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"
19 int main(
int argc,
char *argv[]) {
22 MPI::Init(argc, argv);
37 for (iter=1; iter<7; iter++){
50 time_t Time = time(NULL);
53 cout <<
"the seed = " << Time << endl;
66 for (
int i=0; i<nb; i++){
68 randc[0] = 0.8 * (double) (rand()) / RAND_MAX + 0.1;
69 randc[1] = (double) (rand()) / RAND_MAX - 0.5;
70 double randr = 0.05 * (double) (rand()) / RAND_MAX + 0.02;
71 double dy = 0.005 + 0.05 * (double) (rand()) / RAND_MAX;
72 double omega = 0.5 * (double) (rand()) / RAND_MAX;
73 double aa = 0.15 * (double) (rand()) / RAND_MAX;
97 for (iter=itstart; iter<itend; iter++){
98 if(pabloBB.
rank==0) cout <<
"iter " << iter << endl;
102 for (
int i=0; i<nb; i++){
103 BB[i].c[0] = BB0[i].c[0] + AA[i]*cos(OM[i]*t);
104 BB[i].c[1] = BB[i].c[1]+ Dt*DY[i];
108 for (
int iref=0; iref<nrefperiter; iref++){
110 for (
int i=0; i<nocts; i++){
113 vector<vector<double> > nodes = pabloBB.
getNodes(i);
115 vector<double> center = pabloBB.
getCenter(i);
117 while (!inside && ib<nb){
118 double xc = BB[ib].c[0];
119 double yc = BB[ib].c[1];
120 double radius = BB[ib].r;
122 for (
int j=0; j<global2D.
nnodes; j++){
123 double x = nodes[j][0];
124 double y = nodes[j][1];
126 (pow((x-xc),2.0)+pow((y-yc),2.0) <= 1.15*pow(radius,2.0) &&
127 pow((x-xc),2.0)+pow((y-yc),2.0) >= 0.85*pow(radius,2.0)))
128 || ((!inside) && (pow((center[0]-xc),2.0)+pow((center[1]-yc),2.0) <= 1.15*pow(radius,2.0) &&
129 pow((center[0]-xc),2.0)+pow((center[1]-yc),2.0) >= 0.85*pow(radius,2.0)))){
142 if (pabloBB.
getLevel(i) > 6 && !inside){
149 bool adapt = pabloBB.
adapt();
163 pabloBB.
write(
"PabloBubble_iter"+to_string(static_cast<unsigned long long>(iter)));
uint8_t getLevel(Class_Octant< 2 > *oct)
Parallel Octree Manager Class - 2D specialization.
void setMarker(Class_Octant< 2 > *oct, int8_t marker)
void getNodes(Class_Octant< 2 > *oct, dvector2D &nodes)
uint32_t getNumOctants() const
void setBalanceCodimension(uint8_t b21codim)
void updateConnectivity()
void write(string filename)
void setBalance(Class_Octant< 2 > *oct, bool balance)
void getCenter(Class_Octant< 2 > *oct, vector< double > ¢er)