diff options
author | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-01-12 22:37:00 +0000 |
---|---|---|
committer | Erik Schnetter <schnetter@cct.lsu.edu> | 2007-01-12 22:37:00 +0000 |
commit | 497130b3093b7d58c59b4d5a761ea795d1d6310d (patch) | |
tree | 6e14760f8f3af0696155dd7272d6f029c425868d /Carpet | |
parent | f6574b1d790e41cf80dac26064221d48eb33f63f (diff) |
CarpetIOHDF5: Adapt to region_t changes
Adapt to region_t changes. Use the type region_t instead of
gridstructure_t. This is an incompatible change to the format of HDF5
files.
darcs-hash:20070112223732-dae7b-9f2527492cffa6f929a9dd32604713267621d7fb.gz
Diffstat (limited to 'Carpet')
-rw-r--r-- | Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc | 5 | ||||
-rw-r--r-- | Carpet/CarpetIOHDF5/src/Input.cc | 28 |
2 files changed, 13 insertions, 20 deletions
diff --git a/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc b/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc index 5378a5f23..edd2a4604 100644 --- a/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc +++ b/Carpet/CarpetIOHDF5/src/CarpetIOHDF5.cc @@ -977,10 +977,9 @@ static int WriteMetadata (const cGH *cctkGH, int nioprocs, // Save grid structure if (called_from_checkpoint or not CCTK_Equals (out_save_parameters, "no")) { - vector <grid_structure_t> grid_structure (maps); + vector <vector <vector <region_t> > > grid_structure (maps); for (int m = 0; m < maps; ++ m) { - grid_structure.at(m).bbss = Carpet::vhh.at(m)->extents().at(0); - grid_structure.at(m).obss = Carpet::vhh.at(m)->outer_boundaries(); + grid_structure.at(m) = vhh.at(m)->regions().at(0); } ostringstream gs_buf; gs_buf << grid_structure; diff --git a/Carpet/CarpetIOHDF5/src/Input.cc b/Carpet/CarpetIOHDF5/src/Input.cc index 34701590c..649d2ee55 100644 --- a/Carpet/CarpetIOHDF5/src/Input.cc +++ b/Carpet/CarpetIOHDF5/src/Input.cc @@ -58,7 +58,7 @@ typedef struct { CCTK_REAL delta_time; vector<CCTK_REAL> mgleveltimes; // [num_mglevels*num_reflevels] - vector<grid_structure_t> grid_structure; // [maps] + vector<vector<vector<region_t> > > grid_structure; // [map][reflevel][component] } fileset_t; // list of checkpoint/filereader files @@ -103,32 +103,26 @@ void CarpetIOHDF5_RecoverGridStructure (CCTK_ARGUMENTS) assert ((int)fileset.grid_structure.size() == maps); for (int m = 0; m < maps; ++ m) { - grid_structure_t const & grid_structure = fileset.grid_structure.at(m); + vector <vector <region_t> > regss = + fileset.grid_structure.at(m); - int const rls = grid_structure.bbss.size(); - assert ((int)grid_structure.obss.size() == rls); - - vector <vector <ibbox> > bbss = grid_structure.bbss; - vector <vector <bbvect> > obss = grid_structure.obss; - vector <vector <int> > pss (rls); + int const rls = int(regss.size()); for (int rl = 0; rl < rls; ++ rl) { - vector <ibbox> & bbs = bbss.at(rl); - vector <bbvect> & obs = obss.at(rl); - vector <int> & ps = pss.at(rl); + vector <region_t> & regs = regss.at(rl); // Make multiprocessor aware - Carpet::SplitRegions (cctkGH, bbs, obs, ps); + Carpet::SplitRegions (cctkGH, regs); } // for rl // Make multigrid aware - vector <vector <vector <ibbox> > > bbsss; - Carpet::MakeMultigridBoxes (cctkGH, bbss, obss, bbsss); + vector <vector <vector <region_t> > > regsss; + Carpet::MakeMultigridBoxes (cctkGH, regss, regsss); // Regrid - RegridMap (cctkGH, m, bbsss, obss, pss); + RegridMap (cctkGH, m, regsss); } // for m @@ -877,10 +871,10 @@ static int ReadVar (const cGH* const cctkGH, assert (group.grouptype==CCTK_SCALAR or group.grouptype==CCTK_ARRAY); const int newlower = lower[patch->rank-1] + (upper[patch->rank-1]-lower[patch->rank-1]+1)* - (data.hh->processors().at(reflevel).at(component)); + (data.hh->processor(reflevel,component)); const int newupper = upper[patch->rank-1] + (upper[patch->rank-1]-lower[patch->rank-1]+1)* - (data.hh->processors().at(reflevel).at(component)); + (data.hh->processor(reflevel,component)); lower[patch->rank-1] = newlower; upper[patch->rank-1] = newupper; } |