Skip to content

Commit 29bdbdd

Browse files
committed
Modification of SinkPArticleUpdate
1 parent 0b8c7ad commit 29bdbdd

1 file changed

Lines changed: 30 additions & 26 deletions

File tree

src/shammodels/sph/src/modules/SinkParticlesUpdate.cpp

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -416,33 +416,37 @@ void shammodels::sph::modules::SinkParticlesUpdate<Tvec, SPHKernel>::compute_ext
416416
bool SS = true; // true pour ajouter le terme Spin-Spin (précession des spins), odre 2PN
417417
bool RR = true; // true pour ajouter le terme Radiation Reaction (perte d'énergie par rayonnement gravitationnel), ordre 2.5PN
418418

419-
std::cout << "===== CONFIG PHYSIQUE =====" << std::endl;
419+
static bool config_printed = false;
420+
421+
if (!config_printed) {
422+
config_printed = true;
423+
424+
std::cout << "===== CONFIG PHYSIQUE =====" << std::endl;
420425

421-
if (true) {
422426
std::cout << "Newton : ACTIVÉ" << std::endl;
423-
}
424427

425-
if (OP)
426-
std::cout << "1PN : ACTIVÉ" << std::endl;
427-
else
428-
std::cout << "1PN : DÉSACTIVÉ" << std::endl;
428+
if (OP)
429+
std::cout << "1PN : ACTIVÉ" << std::endl;
430+
else
431+
std::cout << "1PN : DÉSACTIVÉ" << std::endl;
429432

430-
if (SO)
431-
std::cout << "Spin-Orbit (1.5PN) : ACTIVÉ" << std::endl;
432-
else
433-
std::cout << "Spin-Orbit (1.5PN) : DÉSACTIVÉ" << std::endl;
433+
if (SO)
434+
std::cout << "Spin-Orbit (1.5PN) : ACTIVÉ" << std::endl;
435+
else
436+
std::cout << "Spin-Orbit (1.5PN) : DÉSACTIVÉ" << std::endl;
434437

435-
if (SS)
436-
std::cout << "Spin-Spin (2PN) : ACTIVÉ" << std::endl;
437-
else
438-
std::cout << "Spin-Spin (2PN) : DÉSACTIVÉ" << std::endl;
438+
if (SS)
439+
std::cout << "Spin-Spin (2PN) : ACTIVÉ" << std::endl;
440+
else
441+
std::cout << "Spin-Spin (2PN) : DÉSACTIVÉ" << std::endl;
439442

440-
if (RR)
441-
std::cout << "Radiation Reaction (2.5PN) : ACTIVÉ" << std::endl;
442-
else
443-
std::cout << "Radiation Reaction (2.5PN) : DÉSACTIVÉ" << std::endl;
443+
if (RR)
444+
std::cout << "Radiation Reaction (2.5PN) : ACTIVÉ" << std::endl;
445+
else
446+
std::cout << "Radiation Reaction (2.5PN) : DÉSACTIVÉ" << std::endl;
444447

445-
std::cout << "===========================" << std::endl;
448+
std::cout << "===========================" << std::endl;
449+
}
446450

447451

448452

@@ -495,7 +499,7 @@ void shammodels::sph::modules::SinkParticlesUpdate<Tvec, SPHKernel>::compute_ext
495499

496500
term0 = -G * M * rij
497501
/ (rij_scal * rij_scal * rij_scal + epsilon_grav_sink);
498-
sum+=term0;
502+
sum+= s2.mass/M*term0;
499503

500504
if(OP==true){
501505
term1 =
@@ -506,7 +510,7 @@ void shammodels::sph::modules::SinkParticlesUpdate<Tvec, SPHKernel>::compute_ext
506510
- 1.5 * eta * vij_nij * vij_nij* nij
507511
- 2 * (2 - eta) * vij_nij * vij
508512
);
509-
sum += 1/(c*c)*term1;
513+
sum += 1/(c*c)*s2.mass/M*term1;
510514
}
511515

512516
if(SO){
@@ -517,7 +521,7 @@ void shammodels::sph::modules::SinkParticlesUpdate<Tvec, SPHKernel>::compute_ext
517521
+3*sycl::cross(vij_nij*nij, 3*S + dm/M*Delta)
518522
);
519523

520-
sum += term2;
524+
sum += s2.mass/M*term2;
521525
}
522526

523527
if(SS){
@@ -526,7 +530,7 @@ void shammodels::sph::modules::SinkParticlesUpdate<Tvec, SPHKernel>::compute_ext
526530
nij*sycl::dot(S1,S2) + S1*sycl::dot(nij,S2) + S2*sycl::dot(nij,S1) - 5*nij*sycl::dot(nij,S1)*sycl::dot(nij,S2)
527531
);
528532

529-
sum += term3;
533+
sum += s2.mass/M*term3;
530534
}
531535
if(RR){
532536
term4 = 8/5*G*G*eta* M *M/(c*c*c*c*c*(rij_scal*rij_scal*rij_scal+epsilon_grav_sink))
@@ -535,9 +539,9 @@ void shammodels::sph::modules::SinkParticlesUpdate<Tvec, SPHKernel>::compute_ext
535539
- (6*v2 - 2*G*M/(rij_scal + epsilon_grav_sink)-15*vij_nij*vij_nij)*vij
536540
);
537541

538-
sum += term4;
542+
sum += s2.mass/M*term4;
539543
}
540-
sum = s2.mass/M * sum;
544+
541545
}
542546
s1.ext_acceleration += sum;
543547
}

0 commit comments

Comments
 (0)