MCPcopy Create free account
hub / github.com/AMReX-Astro/Castro / ConvertData

Function ConvertData

Util/ConvertCheckpoint/Embiggen.cpp:700–984  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

698// ---------------------------------------------------------------
699
700static void ConvertData() {
701
702 int max_level(fakeAmr.finest_level);
703
704 // Modify the "grids" boxarray *only* at level 0
705 // NOTE: must do this before re-defining domain below.
706
707 FakeAmrLevel &falRef0 = fakeAmr.fakeAmrLevels[0];
708 Box domain(fakeAmr.geom[0].Domain());
709 BoxList(newgrid_list);
710
711 int dlenx = domain.size()[0];
712#if (AMREX_SPACEDIM >= 2)
713 int dleny = domain.size()[1];
714#if (AMREX_SPACEDIM == 3)
715 int dlenz = domain.size()[1];
716#endif
717#endif
718
719 // We treat the r-z case with the star in the middle specially
720#if (AMREX_SPACEDIM == 2)
721 if (coord == 1 && star_at_center == 1)
722 {
723 for (int jy = 0; jy < grown_factor; jy++)
724 for (int jx = 0; jx < grown_factor; jx++)
725 for (int n = 0; n < falRef0.grids.size(); n++)
726 {
727 int shiftx(jx*dlenx);
728 int shifty(jy*dleny);
729 IntVect shift_box(AMREX_D_DECL(shiftx,shifty,shiftz));
730
731 Box bx(falRef0.grids[n]);
732 bx.shift(shift_box);
733 newgrid_list.push_back(bx);
734 }
735
736 Box new_domain(fakeAmr.geom[0].Domain());
737 new_domain.refine(grown_factor);
738 newgrid_list.intersect(new_domain);
739
740 newgrid_list.maxSize(dlenx);
741
742 } else {
743#endif
744
745 if (star_at_center == 1 && grown_factor == 2)
746 {
747 // Here we tile the domain with tiles smaller than the original domain --
748 // we first tile with domain-sized pieces, then intersect with the new domain
749
750#if (AMREX_SPACEDIM == 3)
751 for (int jz = 0; jz < 3; jz++)
752#endif
753#if (AMREX_SPACEDIM >= 2)
754 for (int jy = 0; jy < 3; jy++)
755#endif
756 for (int jx = 0; jx < 3; jx++)
757 for (int n = 0; n < falRef0.grids.size(); n++) {

Callers 1

mainFunction · 0.85

Calls 1

sizeMethod · 0.80

Tested by

no test coverage detected