diff --git a/src/data/simparticles.h b/src/data/simparticles.h index 5fcf5546c524cc03f22d3be06446c8f7bdf7dfab..dbf89705d5b5c2b33b0e387c63c779ccb7e09a65 100644 --- a/src/data/simparticles.h +++ b/src/data/simparticles.h @@ -413,7 +413,6 @@ class simparticles : public intposconvert, public setcomm int test_if_grav_timestep_is_too_large(int p, int bin); int get_timestep_bin(integertime ti_step); - private: #ifdef ADAPTIVE_HYDRO_SOFTENING int get_softeningtype_for_hydro_particle(int i) { diff --git a/src/sph/density.cc b/src/sph/density.cc index 35859a3a23c1a3389bf8bd91a112b66101d9a571..25b8ee3c18425bf7dd1a0b3bbe9327b50a1895d3 100644 --- a/src/sph/density.cc +++ b/src/sph/density.cc @@ -556,6 +556,9 @@ void sph::density(int *list, int ntarget) All.Timebase_interval; double dtime = All.cf_atime * dt / All.cf_atime_hubble_a; SphP[target].set_viscosity_coefficient(dtime); +#endif +#ifdef ADAPTIVE_HYDRO_SOFTENING + Tp->P[target].setSofteningClass(Tp->get_softeningtype_for_hydro_particle(target)); #endif /* now check whether we had enough neighbours */ double desnumngb = All.DesNumNgb; @@ -890,9 +893,9 @@ void sph::density_evaluate_kernel(pinfo &pdat) } if(All.ComovingIntegrationOn) - vdotr2 += All.cf_atime2_hubble_a * r2; + vdotr2 += All.cf_atime2_hubble_a * r2; - Vec4d mu_ij = vdotr2 /(All.cf_afac3 * All.Time * r); + Vec4d mu_ij = vdotr2 / (All.cf_afac3 * All.Time * r); Vec4d cs_j(ngb0->Csnd, ngb1->Csnd, ngb2->Csnd, ngb3->Csnd); Vec4d cs_sum = cs_i + cs_j; @@ -903,10 +906,9 @@ void sph::density_evaluate_kernel(pinfo &pdat) Vec4d decay_vel = select(decision, cs_sum, decay_vel_2); + Vec4d fac_decay_vel = select(decision_r_gt_0, 1, 0); - Vec4d fac_decay_vel = select(decision_r_gt_0, 1, 0); - - decay_vel = decay_vel * fac_decay_vel; + decay_vel = decay_vel * fac_decay_vel; decayVel_loc = max(decayVel_loc, decay_vel); @@ -914,10 +916,11 @@ void sph::density_evaluate_kernel(pinfo &pdat) } #ifdef TIMEDEP_ART_VISC - for(int i = 0; i < vector_length; i++) { - if(decayVel_loc[i] > targetSphP->decayVel) - targetSphP->decayVel = decayVel_loc[i]; - } + for(int i = 0; i < vector_length; i++) + { + if(decayVel_loc[i] > targetSphP->decayVel) + targetSphP->decayVel = decayVel_loc[i]; + } #endif } @@ -1025,7 +1028,7 @@ void sph::density_evaluate_kernel(pinfo &pdat) } if(All.ComovingIntegrationOn) - vdotr2 += All.cf_atime2_hubble_a * r2; + vdotr2 += All.cf_atime2_hubble_a * r2; double mu_ij = vdotr2 / (All.cf_afac3 * All.Time * kernel.r); double decay_vel;