Commit 6ea5c6b0 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

All gpart now find all of their interactions following correct boundary...

All gpart now find all of their interactions following correct boundary condition check in runner_do_grav_long_range()
parent c94fd6d6
......@@ -113,6 +113,7 @@
#define SOURCETERMS_NONE
//#define SOURCETERMS_SN_FEEDBACK
#define ICHECK 5726454604296ll
//#define ICHECK 5726454604296ll
#define ICHECK 5268994168350ll
#endif /* SWIFT_CONST_H */
......@@ -1977,6 +1977,10 @@ void engine_make_self_gravity_tasks_mapper(void *map_data, int num_elements,
const int cjd = cell_getid(cdim, iii, jjj, kkk);
struct cell *cj = &cells[cjd];
if(i==11 && j==0 && k==10)
message("Found direct neighbour: (i,j,k)=(%d,%d,%d) (iii,jjj,kkk)=(%d,%d,%d) nodeID=%d", i,j,k, iii,jjj,kkk, cj->nodeID);
/* Avoid duplicates of local pairs*/
if(cid <= cjd && cj->nodeID == nodeID) continue;
......@@ -2003,10 +2007,6 @@ void engine_make_self_gravity_tasks_mapper(void *map_data, int num_elements,
if (1 || !gravity_M2L_accept(multi_i->r_max_rebuild,
multi_j->r_max_rebuild, theta_crit2, r2)) {
if(i==11 && j==11 && k==10)
message("Found direct neighbour: (i,j,k)=(%d,%d,%d) (iii,jjj,kkk)=(%d,%d,%d) nodeID=%d", i,j,k, iii,jjj,kkk, cj->nodeID);
/* Ok, we need to add a direct pair calculation */
scheduler_addtask(sched, task_type_pair, task_subtype_grav, 0, 0,
ci, cj);
......
......@@ -1484,7 +1484,7 @@ void runner_do_end_force(struct runner *r, struct cell *c, int timer) {
/* Check that this gpart has interacted with all the other
* particles (via direct or multipoles) in the box */
if (gp->num_interacted != e->total_nr_gparts && gp->id_or_neg_offset == ICHECK)
if (gp->num_interacted != e->total_nr_gparts /*&& gp->id_or_neg_offset == ICHECK*/)
error(
"g-particle (id=%lld, type=%s) did not interact "
"gravitationally "
......
......@@ -1233,9 +1233,9 @@ void runner_do_grav_long_range(struct runner *r, struct cell *ci, int timer) {
/* Are we in charge of this cell pair? MATTHIEU*/
/* if (gravity_M2L_accept(multi_i->r_max_rebuild, multi_j->r_max_rebuild, */
/* theta_crit2, r2_rebuild)) { */
if((abs(i-ii) <= 1 || abs(i-ii - cdim[0]) <= 1) &&
(abs(j-jj) <= 1 || abs(j-jj - cdim[1]) <= 1) &&
(abs(k-kk) <= 1)|| abs(k-kk - cdim[2]) <= 1) {
if((abs(i-ii) <= 1 || abs(i-ii - cdim[0]) <= 1 || abs(i-ii + cdim[0]) <= 1) &&
(abs(j-jj) <= 1 || abs(j-jj - cdim[1]) <= 1 || abs(j-jj + cdim[1]) <= 1) &&
(abs(k-kk) <= 1 || abs(k-kk - cdim[2]) <= 1 || abs(k-kk + cdim[2]) <= 1)) {
#if (ICHECK != 0)
if(check) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment