[Dune] alucubegrid's readGrid method

Dedner, Andreas A.S.Dedner at warwick.ac.uk
Mon Apr 15 21:16:10 CEST 2013


Hi.
I think you should not add the rank to the filename - alu will do that.
But I'm not quite sure if that will solve the problem...
Andreas
________________________________________
From: dune-bounces+a.s.dedner=warwick.ac.uk at dune-project.org [dune-bounces+a.s.dedner=warwick.ac.uk at dune-project.org] on behalf of Marco Cisternino [marco.cisternino at optimad.it]
Sent: 15 April 2013 19:24
To: dune at dune-project.org
Subject: [Dune] alucubegrid's readGrid method

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
------------------------------------


_______________________________________________
Dune mailing list
Dune at dune-project.org
http://lists.dune-project.org/mailman/listinfo/dune






More information about the Dune mailing list