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

Method buildMetrics

Source/driver/Castro.cpp:790–865  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

788}
789
790void
791Castro::buildMetrics ()
792{
793 BL_PROFILE("Castro::buildMetrics()");
794
795 const int ngrd = static_cast<int>(grids.size());
796
797 radius.resize(ngrd);
798
799 const Real* dx = geom.CellSize();
800
801 for (int i = 0; i < ngrd; i++)
802 {
803 const Box& b = grids[i];
804 int ilo = b.smallEnd(0)-radius_grow;
805 int ihi = b.bigEnd(0)+radius_grow;
806 int len = ihi - ilo + 1;
807
808 radius[i].resize(len);
809
810 Real* rad = radius[i].dataPtr();
811
812 if (Geom().IsCartesian())
813 {
814 for (int j = 0; j < len; j++)
815 {
816 rad[j] = 1.0;
817 }
818 }
819 else
820 {
821 RealBox gridloc = RealBox(grids[i],geom.CellSize(),geom.ProbLo());
822
823 const Real xlo = gridloc.lo(0) + (0.5 - radius_grow)*dx[0];
824
825 for (int j = 0; j < len; j++)
826 {
827 rad[j] = xlo + j*dx[0];
828 }
829 }
830 }
831
832 volume.clear();
833 volume.define(grids,dmap,1,NUM_GROW);
834 geom.GetVolume(volume);
835
836 for (int dir = 0; dir < AMREX_SPACEDIM; dir++)
837 {
838 area[dir].clear();
839 area[dir].define(getEdgeBoxArray(dir),dmap,1,NUM_GROW);
840 geom.GetFaceArea(area[dir],dir);
841 }
842 for (int dir = AMREX_SPACEDIM; dir < 3; dir++)
843 {
844 area[dir].clear();
845 area[dir].define(grids, dmap, 1, 0);
846 area[dir].setVal(0.0);
847 }

Callers

nothing calls this directly

Calls 3

sizeMethod · 0.80
clearMethod · 0.80
defineMethod · 0.80

Tested by

no test coverage detected