[Dune] alucubegrid's readGrid method

Marco Cisternino marco.cisternino at optimad.it
Mon Apr 15 20:24:40 CEST 2013


Hi to all,
I'm trying to use ALUCubeGrid writeGrid and readGrid methods in order to 
backup my grid and restore the simulation using that grid.
I'm able, I think, to write the grid in xdr format simply using
     std::string backup = "backupGrid_";
     std::stringstream backupString;
     backupString << backup << helper.rank();
     grid.writeGrid<Dune::xdr>(backupString.str(),0.0);
and getting 6 files with 2 processes (2 files without extension and 2 
files .extra and 2 files .macro)
Unfortunately, I'm not able to read the grid. I use (with GridType = 
ALUCubeGrid<3,3>):
     std::string restoreFilename = "backupGrid_";
     std::stringstream restoreString;
     restoreString << restoreFilename << helper.rank();
     double time = 0.0;
     GridType grid;
     grid.readGrid<Dune::xdr>(restoreString.str(),time);
I launch the restore code with the same number of processes (2), but 
only process 0 gets the right portion of grid, while process 1 gets nothing.
I looked inside the code and I saw that process 1 is not able to compute 
the maxLevel. It never enters the loop at line 340 in grid_imp.cc (dune 
2.2.1).
I don't know if the sketched procedure to write/read a backup grid file 
is correct. That's what I've understood.
I hope that someone can give me some hints to get rid of the 
backup/restore system.
Thanks for any help.

Bests,

Marco


-- 
------------------------------------
Marco Cisternino, Ph.D.
OPTIMAD Engineering s.r.l.
Via Giacinto Collegno 18
10143 Torino - Italy
www.optimad.it
marco.cisternino at optimad.it
+39 011 19719782
------------------------------------





More information about the Dune mailing list