12 #ifndef CD_EBAMRParticleMeshImplem_H
13 #define CD_EBAMRParticleMeshImplem_H
18 #include <LevelData.H>
19 #include <EBCellFactory.H>
25 #include <CD_NamespaceHeader.H>
27 template <
class P, const Real& (P::*particleScalarField)() const>
33 const bool a_forceIrregNGP)
35 CH_TIME(
"EBAMRParticleMesh::deposit(scalar)");
37 CH_assert(a_meshData[0]->nComp() == 1);
39 switch (a_coarseFineDeposition) {
40 case CoarseFineDeposition::Interp: {
41 this->depositInterp<P, particleScalarField>(a_meshData, a_particles, a_depositionType, a_forceIrregNGP);
45 case CoarseFineDeposition::Halo: {
46 this->depositHalo<P, particleScalarField>(a_meshData, a_particles, a_depositionType, a_forceIrregNGP);
50 case CoarseFineDeposition::HaloNGP: {
51 this->depositHaloNGP<P, particleScalarField>(a_meshData, a_particles, a_depositionType, a_forceIrregNGP);
56 MayDay::Error(
"EBAMRParticleMesh::deposit(scalar) - logic bust");
63 template <
class P, Real (P::*particleScalarField)() const>
69 const bool a_forceIrregNGP)
71 CH_TIME(
"EBAMRParticleMesh::deposit(scalar)");
75 CH_assert(a_meshData[0]->nComp() == 1);
77 switch (a_coarseFineDeposition) {
78 case CoarseFineDeposition::Interp: {
79 this->depositInterp<P, particleScalarField>(a_meshData, a_particles, a_depositionType, a_forceIrregNGP);
83 case CoarseFineDeposition::Halo: {
84 this->depositHalo<P, particleScalarField>(a_meshData, a_particles, a_depositionType, a_forceIrregNGP);
88 case CoarseFineDeposition::HaloNGP: {
89 this->depositHaloNGP<P, particleScalarField>(a_meshData, a_particles, a_depositionType, a_forceIrregNGP);
94 MayDay::Error(
"EBAMRParticleMesh::deposit(scalar) - logic bust");
101 template <
class P, const RealVect& (P::*particleVectorField)() const>
107 const bool a_forceIrregNGP)
110 CH_TIME(
"EBAMRParticleMesh::deposit(vector)");
112 CH_assert(a_meshData[0]->nComp() == SpaceDim);
114 switch (a_coarseFineDeposition) {
115 case CoarseFineDeposition::Interp: {
116 this->depositInterp<P, particleVectorField>(a_meshData, a_particles, a_depositionType, a_forceIrregNGP);
120 case CoarseFineDeposition::Halo: {
121 this->depositHalo<P, particleVectorField>(a_meshData, a_particles, a_depositionType, a_forceIrregNGP);
125 case CoarseFineDeposition::HaloNGP: {
126 this->depositHaloNGP<P, particleVectorField>(a_meshData, a_particles, a_depositionType, a_forceIrregNGP);
131 MayDay::Error(
"EBAMRParticleMesh::deposit(RealVect) - logic bust");
138 template <
class P, RealVect (P::*particleVectorField)() const>
144 const bool a_forceIrregNGP)
146 CH_TIME(
"EBAMRParticleMesh::deposit(vector)");
148 CH_assert(a_meshData[0]->nComp() == SpaceDim);
150 switch (a_coarseFineDeposition) {
151 case CoarseFineDeposition::Interp: {
152 this->depositInterp<P, particleVectorField>(a_meshData, a_particles, a_depositionType, a_forceIrregNGP);
156 case CoarseFineDeposition::Halo: {
157 this->depositHalo<P, particleVectorField>(a_meshData, a_particles, a_depositionType, a_forceIrregNGP);
161 case CoarseFineDeposition::HaloNGP: {
162 this->depositHaloNGP<P, particleVectorField>(a_meshData, a_particles, a_depositionType, a_forceIrregNGP);
167 MayDay::Error(
"EBAMRParticleMesh::deposit(RealVect) - logic bust");
174 template <
class P, const Real& (P::*particleScalarField)() const>
179 const bool a_forceIrregNGP)
181 CH_TIME(
"EBAMRParticleMesh::depositInterp");
183 CH_assert(a_meshData[0]->nComp() == 1);
193 const Interval interv(0, 0);
196 const DisjointBoxLayout& dbl =
m_eblgs[lvl]->getDBL();
197 const bool hasCoar = lvl > 0;
198 const DataIterator& dit = dbl.dataIterator();
199 const int nbox = dit.size();
202 #pragma omp parallel for schedule(runtime)
203 for (
int mybox = 0; mybox < nbox; mybox++) {
204 const DataIndex& din = dit[mybox];
206 EBCellFAB& meshData = (*a_meshData[lvl])[din];
207 const ListBox<P>& boxParticles = a_particles[lvl][din];
211 interp.
deposit<P, particleScalarField>(boxParticles.listItems(), meshData, a_depositionType, a_forceIrregNGP);
219 m_coarseFinePM[lvl]->addFineGhostsToCoarse(*a_meshData[lvl - 1], *a_meshData[lvl]);
225 m_coarseFinePM[lvl]->addInvalidCoarseToFine(*a_meshData[lvl], *a_meshData[lvl - 1]);
230 template <
class P, Real (P::*particleScalarField)() const>
235 const bool a_forceIrregNGP)
237 CH_TIME(
"EBAMRParticleMesh::depositInterp");
239 CH_assert(a_meshData[0]->nComp() == 1);
249 const Interval interv(0, 0);
252 const DisjointBoxLayout& dbl =
m_eblgs[lvl]->getDBL();
253 const EBISLayout& ebisl =
m_eblgs[lvl]->getEBISL();
254 const DataIterator& dit = dbl.dataIterator();
255 const bool hasCoar = lvl > 0;
258 const int nbox = dit.size();
259 #pragma omp parallel for schedule(runtime)
260 for (
int mybox = 0; mybox < nbox; mybox++) {
261 const DataIndex& din = dit[mybox];
263 EBCellFAB& meshData = (*a_meshData[lvl])[din];
264 const ListBox<P>& boxParticles = a_particles[lvl][din];
268 interp.
deposit<P, particleScalarField>(boxParticles.listItems(), meshData, a_depositionType, a_forceIrregNGP);
276 m_coarseFinePM[lvl]->addFineGhostsToCoarse(*a_meshData[lvl - 1], *a_meshData[lvl]);
282 m_coarseFinePM[lvl]->addInvalidCoarseToFine(*a_meshData[lvl], *a_meshData[lvl - 1]);
287 template <
class P, const Real& (P::*particleScalarField)() const>
292 const bool a_forceIrregNGP)
294 CH_TIME(
"EBAMRParticleMesh::depositHalo");
296 CH_assert(a_meshData[0]->nComp() == 1);
307 const Interval interv(0, 0);
310 const DisjointBoxLayout& dbl =
m_eblgs[lvl]->getDBL();
311 const EBISLayout& ebisl =
m_eblgs[lvl]->getEBISL();
312 const DataIterator& dit = dbl.dataIterator();
313 const bool hasCoar = (lvl > 0);
316 const int nbox = dit.size();
317 #pragma omp parallel for schedule(runtime)
318 for (
int mybox = 0; mybox < nbox; mybox++) {
319 const DataIndex& din = dit[mybox];
321 EBCellFAB& meshData = (*a_meshData[lvl])[din];
322 const ListBox<P>& boxParticles = a_particles[lvl][din];
327 interp.
deposit<P, particleScalarField>(boxParticles.listItems(), meshData, a_depositionType, a_forceIrregNGP);
335 m_coarseFinePM[lvl]->addFineGhostsToCoarse(*a_meshData[lvl - 1], *a_meshData[lvl]);
342 const ParticleData<P>& coarHaloParticles = *a_particles.
getMaskParticles()[lvl - 1];
345 const int refRat =
m_refRat[lvl - 1];
347 const DisjointBoxLayout& dblFiCo = eblgFiCo.getDBL();
348 const EBISLayout& ebislFiCo = eblgFiCo.getEBISL();
349 const DataIterator& ditFiCo = dblFiCo.dataIterator();
352 LevelData<EBCellFAB> bufferFiCo(dblFiCo, 1,
m_ghost, EBCellFactory(ebislFiCo));
354 const int nboxFiCo = ditFiCo.size();
355 #pragma omp parallel for schedule(runtime)
356 for (
int mybox = 0; mybox < nboxFiCo; mybox++) {
357 const DataIndex& din = ditFiCo[mybox];
359 EBCellFAB& dataFiCo = bufferFiCo[din];
360 const ListBox<P>& haloParticles = coarHaloParticles[din];
362 dataFiCo.setVal(0.0);
368 interp.
deposit2<P, particleScalarField>(haloParticles.listItems(),
376 interp.
deposit4<P, particleScalarField>(haloParticles.listItems(),
384 MayDay::Error(
"CD_EBAMRParticleMeshImplem.H - logic bust in EBAMRParticleMesh::depositHalo(Real)");
392 m_coarseFinePM[lvl]->addFiCoDataToFine(*a_meshData[lvl], bufferFiCo);
397 template <
class P, Real (P::*particleScalarField)() const>
402 const bool a_forceIrregNGP)
404 CH_TIME(
"EBAMRParticleMesh::depositHalo");
406 CH_assert(a_meshData[0]->nComp() == 1);
417 const Interval interv(0, 0);
420 const DisjointBoxLayout& dbl =
m_eblgs[lvl]->getDBL();
421 const EBISLayout& ebisl =
m_eblgs[lvl]->getEBISL();
422 const DataIterator& dit = dbl.dataIterator();
423 const bool hasCoar = (lvl > 0);
426 const int nbox = dit.size();
427 #pragma omp parallel for schedule(runtime)
428 for (
int mybox = 0; mybox < nbox; mybox++) {
429 const DataIndex& din = dit[mybox];
431 EBCellFAB& meshData = (*a_meshData[lvl])[din];
432 const ListBox<P>& boxParticles = a_particles[lvl][din];
436 interp.
deposit<P, particleScalarField>(boxParticles.listItems(), meshData, a_depositionType, a_forceIrregNGP);
444 m_coarseFinePM[lvl]->addFineGhostsToCoarse(*a_meshData[lvl - 1], *a_meshData[lvl]);
451 const ParticleData<P>& coarHaloParticles = *a_particles.
getMaskParticles()[lvl - 1];
454 const int refRat =
m_refRat[lvl - 1];
456 const DisjointBoxLayout& dblFiCo = eblgFiCo.getDBL();
457 const EBISLayout& ebislFiCo = eblgFiCo.getEBISL();
458 const DataIterator& ditFiCo = dblFiCo.dataIterator();
461 LevelData<EBCellFAB> bufferFiCo(dblFiCo, 1,
m_ghost, EBCellFactory(ebislFiCo));
463 const int nboxFiCo = ditFiCo.size();
464 #pragma omp parallel for schedule(runtime)
465 for (
int mybox = 0; mybox < nboxFiCo; mybox++) {
466 const DataIndex& din = ditFiCo[mybox];
468 EBCellFAB& dataFiCo = bufferFiCo[din];
469 const ListBox<P>& haloParticles = coarHaloParticles[din];
471 dataFiCo.setVal(0.0);
477 interp.
deposit2<P, particleScalarField>(haloParticles.listItems(),
485 interp.
deposit4<P, particleScalarField>(haloParticles.listItems(),
493 MayDay::Error(
"CD_EBAMRParticleMeshImplem.H - logic bust in EBAMRParticleMesh::depositHalo(Real)");
501 m_coarseFinePM[lvl]->addFiCoDataToFine(*a_meshData[lvl], bufferFiCo);
506 template <
class P, const Real& (P::*particleScalarField)() const>
511 const bool a_forceIrregNGP)
513 CH_TIME(
"EBAMRParticleMesh::depositHaloNGP");
515 CH_assert(a_meshData[0]->nComp() == 1);
519 const Interval interv(0, 0);
526 const DisjointBoxLayout& dbl =
m_eblgs[lvl]->getDBL();
527 const EBISLayout& ebisl =
m_eblgs[lvl]->getEBISL();
528 const DataIterator& dit = dbl.dataIterator();
530 const bool hasCoar = (lvl > 0);
533 const int nbox = dit.size();
534 #pragma omp parallel for schedule(runtime)
535 for (
int mybox = 0; mybox < nbox; mybox++) {
536 const DataIndex& din = dit[mybox];
538 EBCellFAB& meshData = (*a_meshData[lvl])[din];
539 const ListBox<P>& particlesCloud = (*nonHaloParticles[lvl])[din];
540 const ListBox<P>& particlesNGP = (*haloParticles[lvl])[din];
544 interp.
deposit<P, particleScalarField>(particlesCloud.listItems(), meshData, a_depositionType, a_forceIrregNGP);
545 interp.
deposit<P, particleScalarField>(particlesNGP.listItems(), meshData, DepositionType::NGP, a_forceIrregNGP);
553 m_coarseFinePM[lvl]->addFineGhostsToCoarse(*a_meshData[lvl - 1], *a_meshData[lvl]);
558 template <
class P, Real (P::*particleScalarField)() const>
563 const bool a_forceIrregNGP)
565 CH_TIME(
"EBAMRParticleMesh::depositHaloNGP");
567 CH_assert(a_meshData[0]->nComp() == 1);
571 const Interval interv(0, 0);
578 const DisjointBoxLayout& dbl =
m_eblgs[lvl]->getDBL();
579 const EBISLayout& ebisl =
m_eblgs[lvl]->getEBISL();
580 const DataIterator& dit = dbl.dataIterator();
582 const bool hasCoar = (lvl > 0);
585 const int nbox = dit.size();
586 #pragma omp parallel for schedule(runtime)
587 for (
int mybox = 0; mybox < nbox; mybox++) {
588 const DataIndex& din = dit[mybox];
590 EBCellFAB& meshData = (*a_meshData[lvl])[din];
591 const ListBox<P>& particlesCloud = (*nonHaloParticles[lvl])[din];
592 const ListBox<P>& particlesNGP = (*haloParticles[lvl])[din];
596 interp.
deposit<P, particleScalarField>(particlesCloud.listItems(), meshData, a_depositionType, a_forceIrregNGP);
597 interp.
deposit<P, particleScalarField>(particlesNGP.listItems(), meshData, DepositionType::NGP, a_forceIrregNGP);
605 m_coarseFinePM[lvl]->addFineGhostsToCoarse(*a_meshData[lvl - 1], *a_meshData[lvl]);
610 template <
class P, Real& (P::*particleScalarField)()>
615 const bool a_forceIrregNGP)
const
617 CH_TIME(
"EBAMRParticleMesh::interpolate(scalar)");
624 const EBLevelGrid& eblg = *
m_eblgs[lvl];
625 const DisjointBoxLayout& dbl = eblg.getDBL();
626 const EBISLayout& ebisl = eblg.getEBISL();
627 const DataIterator& dit = dbl.dataIterator();
629 CH_assert(a_meshScalarField[lvl]->nComp() == 1);
631 const int nbox = dit.size();
632 #pragma omp parallel for schedule(runtime)
633 for (
int mybox = 0; mybox < nbox; mybox++) {
634 const DataIndex& din = dit[mybox];
636 List<P>& particles = a_particles[lvl][din].listItems();
638 const EBCellFAB& data = (*a_meshScalarField[lvl])[din];
641 interp.
interpolate<P, particleScalarField>(particles, data, a_interpType, a_forceIrregNGP);
646 template <
class P, RealVect& (P::*particleVectorField)()>
651 const bool a_forceIrregNGP)
const
653 CH_TIME(
"EBAMRParticleMesh::interpolate(vector)");
660 const EBLevelGrid& eblg = *
m_eblgs[lvl];
661 const DisjointBoxLayout& dbl = eblg.getDBL();
662 const ProblemDomain& domain = eblg.getDomain();
663 const EBISLayout& ebisl = eblg.getEBISL();
664 const Real& dx =
m_dx[lvl];
665 const DataIterator& dit = dbl.dataIterator();
667 CH_assert(a_meshVectorField[lvl]->nComp() == SpaceDim);
669 const int nbox = dit.size();
670 #pragma omp parallel for schedule(runtime)
671 for (
int mybox = 0; mybox < nbox; mybox++) {
672 const DataIndex& din = dit[mybox];
674 List<P>& particles = a_particles[lvl][din].listItems();
677 const EBCellFAB& data = (*a_meshVectorField[lvl])[din];
679 interp.
interpolate<P, particleVectorField>(particles, data, a_interpType, a_forceIrregNGP);
684 template <
class P, const RealVect& (P::*particleVectorField)() const>
689 const bool a_forceIrregNGP)
691 CH_TIME(
"EBAMRParticleMesh::depositInterp");
693 CH_assert(a_meshData[0]->nComp() == SpaceDim);
697 const Interval interv(0, 0);
700 const DisjointBoxLayout& dbl =
m_eblgs[lvl]->getDBL();
701 const DataIterator& dit = dbl.dataIterator();
702 const bool hasCoar = lvl > 0;
705 const int nbox = dit.size();
706 #pragma omp parallel for schedule(runtime)
707 for (
int mybox = 0; mybox < nbox; mybox++) {
708 const DataIndex& din = dit[mybox];
710 EBCellFAB& meshData = (*a_meshData[lvl])[din];
711 const ListBox<P>& boxParticles = a_particles[lvl][din];
715 interp.
deposit<P, particleVectorField>(boxParticles.listItems(), meshData, a_depositionType, a_forceIrregNGP);
724 for (
int dir = 0; dir < SpaceDim; dir++) {
725 LevelData<EBCellFAB> coarAlias;
726 LevelData<EBCellFAB> fineAlias;
730 aliasLevelData<EBCellFAB>(coarAlias, &(*a_meshData[lvl - 1]), Interval(dir, dir));
731 aliasLevelData<EBCellFAB>(fineAlias, &(*a_meshData[lvl]), Interval(dir, dir));
738 m_coarseFinePM[lvl]->addInvalidCoarseToFine(fineAlias, coarAlias);
744 template <
class P, RealVect (P::*particleVectorField)() const>
749 const bool a_forceIrregNGP)
751 CH_TIME(
"EBAMRParticleMesh::depositInterp");
753 CH_assert(a_meshData[0]->nComp() == SpaceDim);
757 const Interval interv(0, 0);
760 const DisjointBoxLayout& dbl =
m_eblgs[lvl]->getDBL();
761 const DataIterator& dit = dbl.dataIterator();
762 const bool hasCoar = lvl > 0;
765 const int nbox = dit.size();
766 #pragma omp parallel for schedule(runtime)
767 for (
int mybox = 0; mybox < nbox; mybox++) {
768 const DataIndex& din = dit[mybox];
770 EBCellFAB& meshData = (*a_meshData[lvl])[din];
771 const ListBox<P>& boxParticles = a_particles[lvl][din];
774 interp.
deposit<P, particleVectorField>(boxParticles.listItems(), meshData, a_depositionType, a_forceIrregNGP);
783 for (
int dir = 0; dir < SpaceDim; dir++) {
784 LevelData<EBCellFAB> coarAlias;
785 LevelData<EBCellFAB> fineAlias;
789 aliasLevelData<EBCellFAB>(coarAlias, &(*a_meshData[lvl - 1]), Interval(dir, dir));
790 aliasLevelData<EBCellFAB>(fineAlias, &(*a_meshData[lvl]), Interval(dir, dir));
797 m_coarseFinePM[lvl]->addInvalidCoarseToFine(fineAlias, coarAlias);
803 template <
class P, const RealVect& (P::*particleVectorField)() const>
808 const bool a_forceIrregNGP)
810 CH_TIME(
"EBAMRParticleMesh::depositHalo(RealVect)");
812 CH_assert(a_meshData[0]->nComp() == SpaceDim);
816 const Interval interv(0, 0);
819 const DisjointBoxLayout& dbl =
m_eblgs[lvl]->getDBL();
820 const EBISLayout& ebisl =
m_eblgs[lvl]->getEBISL();
821 const DataIterator& dit = dbl.dataIterator();
823 const bool hasCoar = (lvl > 0);
826 const int nbox = dit.size();
827 #pragma omp parallel for schedule(runtime)
828 for (
int mybox = 0; mybox < nbox; mybox++) {
829 const DataIndex& din = dit[mybox];
831 EBCellFAB& meshData = (*a_meshData[lvl])[din];
832 const ListBox<P>& boxParticles = a_particles[lvl][din];
837 interp.
deposit<P, particleVectorField>(boxParticles.listItems(), meshData, a_depositionType, a_forceIrregNGP);
845 m_coarseFinePM[lvl]->addFineGhostsToCoarse(*a_meshData[lvl - 1], *a_meshData[lvl]);
852 const ParticleData<P>& coarHaloParticles = *a_particles.
getMaskParticles()[lvl - 1];
855 const int refRat =
m_refRat[lvl - 1];
857 const DisjointBoxLayout& dblFiCo = eblgFiCo.getDBL();
858 const EBISLayout& ebislFiCo = eblgFiCo.getEBISL();
859 const DataIterator& ditFiCo = dblFiCo.dataIterator();
862 LevelData<EBCellFAB> bufferFiCo(dblFiCo, SpaceDim,
m_ghost, EBCellFactory(ebislFiCo));
864 const int nboxFiCo = ditFiCo.size();
865 #pragma omp parallel for schedule(runtime)
866 for (
int mybox = 0; mybox < nboxFiCo; mybox++) {
867 const DataIndex& din = ditFiCo[mybox];
869 EBCellFAB& dataFiCo = bufferFiCo[din];
870 const ListBox<P>& haloParticles = coarHaloParticles[din];
872 dataFiCo.setVal(0.0);
878 interp.
deposit2<P, particleVectorField>(haloParticles.listItems(),
886 interp.
deposit4<P, particleVectorField>(haloParticles.listItems(),
894 MayDay::Error(
"CD_EBAMRParticleMeshImplem.H - logic bust in EBAMRParticleMesh::depositHalo(RealVect)");
903 for (
int dir = 0; dir < SpaceDim; dir++) {
904 LevelData<EBCellFAB> meshDataAlias;
905 LevelData<EBCellFAB> bufferFiCoAlias;
907 aliasLevelData<EBCellFAB>(meshDataAlias, &(*a_meshData[lvl]), Interval(dir, dir));
908 aliasLevelData<EBCellFAB>(bufferFiCoAlias, &bufferFiCo, Interval(dir, dir));
910 m_coarseFinePM[lvl]->addFiCoDataToFine(meshDataAlias, bufferFiCoAlias);
916 template <
class P, RealVect (P::*particleVectorField)() const>
921 const bool a_forceIrregNGP)
923 CH_TIME(
"EBAMRParticleMesh::depositHalo(RealVect)");
925 CH_assert(a_meshData[0]->nComp() == SpaceDim);
929 const Interval interv(0, 0);
932 const DisjointBoxLayout& dbl =
m_eblgs[lvl]->getDBL();
933 const EBISLayout& ebisl =
m_eblgs[lvl]->getEBISL();
934 const DataIterator& dit = dbl.dataIterator();
936 const bool hasCoar = (lvl > 0);
939 const int nbox = dit.size();
940 #pragma omp parallel for schedule(runtime)
941 for (
int mybox = 0; mybox < nbox; mybox++) {
942 const DataIndex& din = dit[mybox];
944 EBCellFAB& meshData = (*a_meshData[lvl])[din];
945 const ListBox<P>& boxParticles = a_particles[lvl][din];
950 interp.
deposit<P, particleVectorField>(boxParticles.listItems(), meshData, a_depositionType, a_forceIrregNGP);
958 m_coarseFinePM[lvl]->addFineGhostsToCoarse(*a_meshData[lvl - 1], *a_meshData[lvl]);
965 const ParticleData<P>& coarHaloParticles = *a_particles.
getMaskParticles()[lvl - 1];
968 const int refRat =
m_refRat[lvl - 1];
970 const DisjointBoxLayout& dblFiCo = eblgFiCo.getDBL();
971 const EBISLayout& ebislFiCo = eblgFiCo.getEBISL();
972 const DataIterator& ditFiCo = dblFiCo.dataIterator();
975 LevelData<EBCellFAB> bufferFiCo(dblFiCo, SpaceDim,
m_ghost, EBCellFactory(ebislFiCo));
977 const int nboxFiCo = ditFiCo.size();
978 #pragma omp parallel for schedule(runtime)
979 for (
int mybox = 0; mybox < nboxFiCo; mybox++) {
980 const DataIndex& din = ditFiCo[mybox];
982 EBCellFAB& dataFiCo = bufferFiCo[din];
983 const ListBox<P>& haloParticles = coarHaloParticles[din];
985 dataFiCo.setVal(0.0);
991 interp.
deposit2<P, particleVectorField>(haloParticles.listItems(),
999 interp.
deposit4<P, particleVectorField>(haloParticles.listItems(),
1007 MayDay::Error(
"CD_EBAMRParticleMeshImplem.H - logic bust in EBAMRParticleMesh::depositHalo(RealVect)");
1016 for (
int dir = 0; dir < SpaceDim; dir++) {
1017 LevelData<EBCellFAB> meshDataAlias;
1018 LevelData<EBCellFAB> bufferFiCoAlias;
1020 aliasLevelData<EBCellFAB>(meshDataAlias, &(*a_meshData[lvl]), Interval(dir, dir));
1021 aliasLevelData<EBCellFAB>(bufferFiCoAlias, &bufferFiCo, Interval(dir, dir));
1023 m_coarseFinePM[lvl]->addFiCoDataToFine(meshDataAlias, bufferFiCoAlias);
1029 template <
class P, const RealVect& (P::*particleVectorField)() const>
1034 const bool a_forceIrregNGP)
1036 CH_TIME(
"EBAMRParticleMesh::depositHaloNGP");
1038 CH_assert(a_meshData[0]->nComp() == SpaceDim);
1049 const Interval interv(0, 0);
1056 const DisjointBoxLayout& dbl =
m_eblgs[lvl]->getDBL();
1057 const EBISLayout& ebisl =
m_eblgs[lvl]->getEBISL();
1058 const DataIterator& dit = dbl.dataIterator();
1060 const bool hasCoar = (lvl > 0);
1063 const int nbox = dit.size();
1064 #pragma omp parallel for schedule(runtime)
1065 for (
int mybox = 0; mybox < nbox; mybox++) {
1066 const DataIndex& din = dit[mybox];
1068 EBCellFAB& meshData = (*a_meshData[lvl])[din];
1069 const ListBox<P>& particlesCloud = (*nonHaloParticles[lvl])[din];
1070 const ListBox<P>& particlesNGP = (*haloParticles[lvl])[din];
1074 interp.
deposit<P, particleVectorField>(particlesCloud.listItems(), meshData, a_depositionType, a_forceIrregNGP);
1075 interp.
deposit<P, particleVectorField>(particlesNGP.listItems(), meshData, DepositionType::NGP, a_forceIrregNGP);
1085 for (
int dir = 0; dir < SpaceDim; dir++) {
1086 LevelData<EBCellFAB> coarAlias;
1087 LevelData<EBCellFAB> fineAlias;
1091 aliasLevelData<EBCellFAB>(coarAlias, &(*a_meshData[lvl - 1]), Interval(dir, dir));
1092 aliasLevelData<EBCellFAB>(fineAlias, &(*a_meshData[lvl]), Interval(dir, dir));
1095 m_coarseFinePM[lvl]->addFineGhostsToCoarse(coarAlias, fineAlias);
1101 template <
class P, RealVect (P::*particleVectorField)() const>
1106 const bool a_forceIrregNGP)
1108 CH_TIME(
"EBAMRParticleMesh::depositHaloNGP");
1110 CH_assert(a_meshData[0]->nComp() == SpaceDim);
1121 const Interval interv(0, 0);
1128 const DisjointBoxLayout& dbl =
m_eblgs[lvl]->getDBL();
1129 const EBISLayout& ebisl =
m_eblgs[lvl]->getEBISL();
1130 const DataIterator& dit = dbl.dataIterator();
1132 const bool hasCoar = (lvl > 0);
1135 const int nbox = dit.size();
1136 #pragma omp parallel for schedule(runtime)
1137 for (
int mybox = 0; mybox < nbox; mybox++) {
1138 const DataIndex& din = dit[mybox];
1140 EBCellFAB& meshData = (*a_meshData[lvl])[din];
1141 const ListBox<P>& particlesCloud = (*nonHaloParticles[lvl])[din];
1142 const ListBox<P>& particlesNGP = (*haloParticles[lvl])[din];
1146 interp.
deposit<P, particleVectorField>(particlesCloud.listItems(), meshData, a_depositionType, a_forceIrregNGP);
1147 interp.
deposit<P, particleVectorField>(particlesNGP.listItems(), meshData, DepositionType::NGP, a_forceIrregNGP);
1157 for (
int dir = 0; dir < SpaceDim; dir++) {
1158 LevelData<EBCellFAB> coarAlias;
1159 LevelData<EBCellFAB> fineAlias;
1163 aliasLevelData<EBCellFAB>(coarAlias, &(*a_meshData[lvl - 1]), Interval(dir, dir));
1164 aliasLevelData<EBCellFAB>(fineAlias, &(*a_meshData[lvl]), Interval(dir, dir));
1167 m_coarseFinePM[lvl]->addFineGhostsToCoarse(coarAlias, fineAlias);
1173 #include <CD_NamespaceFooter.H>
CoarseFineDeposition
Coarse-fine deposition types (see CD_EBAMRParticleMesh for how these are handled).
Definition: CD_CoarseFineDeposition.H:26
Agglomeration of useful data operations.
DepositionType
Deposition types.
Definition: CD_DepositionType.H:23
Declaration of a class for handling particle-mesh operations with AMR.
Declaration of a Copier class for making incrementation between LevelData<EBCellFAB> easier.
Vector< RefCountedPtr< ParticleData< P > >> AMRParticles
Alias for ParticleData on each AMR level.
Definition: CD_ParticleContainer.H:34
static void setValue(LevelData< MFInterfaceFAB< T >> &a_lhs, const T &a_value)
Set value in an MFInterfaceFAB data holder.
Definition: CD_DataOpsImplem.H:23
void exchange() noexcept
Exchange on all AMR levels.
Definition: CD_EBAMRDataImplem.H:105
IntVect m_ghost
Number of ghost cells.
Definition: CD_EBAMRParticleMesh.H:262
Vector< RefCountedPtr< EBCoarseFineParticleMesh > > m_coarseFinePM
Buffers for handling arithmetic for mass moving from coarse to fine level and vice versa.
Definition: CD_EBAMRParticleMesh.H:305
Vector< Real > m_dx
Grid resolutions.
Definition: CD_EBAMRParticleMesh.H:287
void depositHaloNGP(EBAMRCellData &a_meshData, const ParticleContainer< P > &a_particles, const DepositionType a_depositionType, const bool a_forceIrregNGP=false)
Just like the deposit function, but forced to use the "HaloNGP" algorithm for handling refinement bou...
Definition: CD_EBAMRParticleMeshImplem.H:508
int m_finestLevel
Finest AMR level.
Definition: CD_EBAMRParticleMesh.H:272
void interpolate(ParticleContainer< P > &a_particles, const EBAMRCellData &a_meshVectorField, const DepositionType a_interpType, const bool a_forceIrregNGP=false) const
Interpolate a scalar field onto the particle position.
Definition: CD_EBAMRParticleMeshImplem.H:612
bool m_isDefined
Is defined or not.
Definition: CD_EBAMRParticleMesh.H:252
Vector< RefCountedPtr< LayoutData< EBParticleMesh > > > m_ebParticleMesh
Regular particle-mesh object on each grid level.
Definition: CD_EBAMRParticleMesh.H:292
Vector< RefCountedPtr< EBLevelGrid > > m_eblgs
Grids on each level.
Definition: CD_EBAMRParticleMesh.H:277
Vector< Copier > m_levelCopiers
Copier for moving data from valid+ghost to valid on each AMR level.
Definition: CD_EBAMRParticleMesh.H:311
void deposit(EBAMRCellData &a_meshData, const ParticleContainer< P > &a_particles, const DepositionType a_depositionType, const CoarseFineDeposition a_coarseFineDeposition, const bool a_forceIrregNGP=false)
Class for deposition of particles of a type P to the mesh. This does scalar quantities.
Definition: CD_EBAMRParticleMeshImplem.H:29
void depositInterp(EBAMRCellData &a_meshData, const ParticleContainer< P > &a_particles, const DepositionType a_depositionType, const bool a_forceIrregNGP=false)
Just like the deposit function, but forced to use the "PVR" algorithm for handling refinement boundar...
Definition: CD_EBAMRParticleMeshImplem.H:176
void depositHalo(EBAMRCellData &a_meshData, const ParticleContainer< P > &a_particles, const DepositionType a_depositionType, const bool a_forceIrregNGP=false)
Just like the deposit function, but forced to use the "Halo" algorithm for handling refinement bounda...
Definition: CD_EBAMRParticleMeshImplem.H:289
Vector< RefCountedPtr< LayoutData< EBParticleMesh > > > m_ebParticleMeshFiCo
Special particle-mesh objects for depositing on the coarsened fine grid.
Definition: CD_EBAMRParticleMesh.H:299
Vector< int > m_refRat
Refinement ratios between levels.
Definition: CD_EBAMRParticleMesh.H:282
A Copier class for making copying between BoxLayoutData<EBCellFAB> easier. This increments EBCellFABs...
Definition: CD_EBAddOp.H:26
A class for depositing and interpolating particles. Contains various useful routines for interpolatio...
Definition: CD_EBParticleMesh.H:34
void interpolate(List< P > &a_particleList, const EBCellFAB &a_meshScalarField, const DepositionType a_interpType, const bool a_forceIrregNGP=false) const
Interpolate a scalar field onto the particle position.
Definition: CD_EBParticleMeshImplem.H:340
void deposit2(const List< P > &a_particleList, EBCellFAB &a_rho, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) const
Deposit particle onto the mesh using twice the standard cloud width.
Definition: CD_EBParticleMeshImplem.H:67
void deposit4(const List< P > &a_particleList, EBCellFAB &a_rho, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) const
Deposit particle onto the mesh using 4x the standard cloud width.
Definition: CD_EBParticleMeshImplem.H:121
void deposit(const List< P > &a_particleList, EBCellFAB &a_rho, const DepositionType a_depositionType, const bool a_forceIrregNGP=false) const
Deposit particle onto the mesh using a standard cloud width.
Definition: CD_EBParticleMeshImplem.H:25
Templated class for holding particles on an AMR hierarchy with particle remapping.
Definition: CD_ParticleContainer.H:50
AMRParticles< P > & getMaskParticles()
Get the mask particles.
Definition: CD_ParticleContainerImplem.H:314
AMRParticles< P > & getParticles()
Get all particles on all levels.
Definition: CD_ParticleContainerImplem.H:270