12 #ifndef CD_McPhotoImplem_H
13 #define CD_McPhotoImplem_H
17 #include <CD_NamespaceHeader.H>
19 template <
class P, const Real& (P::*particleScalarField)() const>
25 CH_TIME(
"McPhoto::depositPhotons(ParticleContainer)");
26 if (m_verbosity > 5) {
27 pout() << m_name +
"::depositPhotons(ParticleContainer)" << endl;
31 this->depositKappaConservative<P, particleScalarField>(a_phi, a_photons, a_deposition, m_coarseFineDeposition);
34 this->depositNonConservative(m_depositionNC, a_phi);
37 this->depositHybrid(a_phi, m_massDiff, m_depositionNC);
40 if (m_blendConservation) {
41 Vector<RefCountedPtr<EBFluxRedistribution>>& redistOps = m_amr->getRedistributionOp(m_realm, m_phase);
42 for (
int lvl = 0; lvl <= m_amr->getFinestLevel(); lvl++) {
43 const Real scale = 1.0;
44 const Interval variables = Interval(0, 0);
45 const bool hasCoar = lvl > 0;
46 const bool hasFine = lvl < m_amr->getFinestLevel();
49 redistOps[lvl]->redistributeCoar(*a_phi[lvl - 1], *m_massDiff[lvl], scale, variables);
52 redistOps[lvl]->redistributeLevel(*a_phi[lvl], *m_massDiff[lvl], scale, variables);
55 redistOps[lvl]->redistributeFine(*a_phi[lvl + 1], *m_massDiff[lvl], scale, variables);
61 m_amr->conservativeAverage(a_phi, m_realm, m_phase);
62 m_amr->interpGhost(a_phi, m_realm, m_phase);
65 template <
class P, const Real& (P::*particleScalarField)() const>
72 CH_TIME(
"McPhoto::depositKappaConservative");
73 if (m_verbosity > 5) {
74 pout() << m_name +
"::depositKappaConservative" << endl;
77 CH_assert(a_phi[0]->nComp() == 1);
79 switch (a_coarseFineDeposition) {
80 case CoarseFineDeposition::Interp: {
81 m_amr->depositParticles<P, particleScalarField>(a_phi,
86 CoarseFineDeposition::Interp,
91 case CoarseFineDeposition::Halo: {
94 const AMRMask& mask = m_amr->getMask(s_particle_halo, m_haloBuffer, m_realm);
95 a_particles.copyMaskParticles(mask);
97 m_amr->depositParticles<P, particleScalarField>(a_phi,
102 CoarseFineDeposition::Halo,
106 a_particles.clearMaskParticles();
110 case CoarseFineDeposition::HaloNGP: {
111 const AMRMask& mask = m_amr->getMask(s_particle_halo, m_haloBuffer, m_realm);
114 a_particles.transferMaskParticles(mask);
116 m_amr->depositParticles<P, particleScalarField>(a_phi,
121 CoarseFineDeposition::HaloNGP,
125 a_particles.transferParticles(a_particles.getMaskParticles());
130 MayDay::Error(
"McPhoto::depositKappaConservative -- logic bust due to unsupported coarse-fine deposition");
135 #include <CD_NamespaceFooter.H>
CoarseFineDeposition
Coarse-fine deposition types (see CD_EBAMRParticleMesh for how these are handled).
Definition: CD_CoarseFineDeposition.H:26
DepositionType
Deposition types.
Definition: CD_DepositionType.H:23
Declaration of a radiative transfer solver which uses Monte Carlo sampling of computational or real p...
Vector< RefCountedPtr< LevelData< BaseFab< bool > >> > AMRMask
Alias for cutting down on the typic of booleans defined over AMR grids.
Definition: CD_Realm.H:36
void depositKappaConservative(EBAMRCellData &a_phi, ParticleContainer< P > &a_particles, const DepositionType a_deposition, const CoarseFineDeposition a_coarseFineDeposition) const noexcept
This computes the "conservative" deposition, multiplied by kappa.
Definition: CD_McPhotoImplem.H:67
virtual void depositPhotons()
Deposit photons on the mesh.
Definition: CD_McPhoto.cpp:1286
Templated class for holding particles on an AMR hierarchy with particle remapping.
Definition: CD_ParticleContainer.H:50