#include #include #include #include #include #include "cctk.h" #include "cctk_Parameters.h" #include "gh.hh" #include "carpet.hh" #include "regrid.hh" extern "C" { static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/CarpetRegrid/src/manualcoordinatelist.cc,v 1.12 2004/08/14 07:42:00 schnetter Exp $"; CCTK_FILEVERSION(Carpet_CarpetRegrid_manualcoordinatelist_cc); } namespace CarpetRegrid { using namespace std; using namespace Carpet; int ManualCoordinateList (cGH const * const cctkGH, gh const & hh, gh::rexts & bbsss, gh::rbnds & obss, gh::rprocs & pss) { DECLARE_CCTK_PARAMETERS; int ierr; assert (refinement_levels >= 1); // do nothing if the levels already exist if (reflevel == refinement_levels) return 0; assert (bbsss.size() >= 1); jjvect nboundaryzones, is_internal, is_staggered, shiftout; ierr = GetBoundarySpecification (2*dim, &nboundaryzones[0][0], &is_internal[0][0], &is_staggered[0][0], &shiftout[0][0]); assert (!ierr); rvect physical_min, physical_max; rvect interior_min, interior_max; rvect exterior_min, exterior_max; rvect base_spacing; ierr = GetDomainSpecification (dim, &physical_min[0], &physical_max[0], &interior_min[0], &interior_max[0], &exterior_min[0], &exterior_max[0], &base_spacing[0]); assert (!ierr); bbsss.resize (refinement_levels); obss.resize (refinement_levels); pss.resize (refinement_levels); vector > newbbss; if (strcmp(coordinates, "") != 0) { istringstream gp_str(coordinates); try { gp_str >> newbbss; } catch (input_error) { CCTK_WARN (0, "Could not parse parameter \"coordinates\""); } } vector > newobss; if (smart_outer_boundaries) { // TODO: // assert (domain_from_coordbase); newobss.resize(newbbss.size()); for (size_t rl=0; rl> newobss; } catch (input_error) { CCTK_WARN (0, "Could not parse parameter \"outerbounds\""); } bool good = newobss.size() == newbbss.size(); if (good) { for (size_t rl=0; rl bbs; gh::cbnds obs; bbs.reserve (newbbss.at(rl-1).size()); obs.reserve (newbbss.at(rl-1).size()); for (size_t c=0; c::cprocs ps; SplitRegions (cctkGH, bbs, obs, ps); // make multigrid aware vector > bbss; MakeMultigridBoxes (cctkGH, bbs, obs, bbss); bbsss.at(rl) = bbss; obss.at(rl) = obs; pss.at(rl) = ps; } // for rl return 1; } } // namespace CarpetRegrid