Hi Andreas,
I appreciate the hint, and will look into this.
What puzzles me is that in my case, tEnd=8000, which should be long enough to
produce restart files. I have about 125 vtk files written, each about 700MB,
taking a total of 3 weeks to compute. This renders restart capability faiely
important. I did not modify any default values on file output frequency.
Also, by setting 1p2c test problem dtInitial=1, tEnd = 10000, I finally got a
restart file, "outflow_time=245.573_rank=0.drs". After checking the *.pvd file,
this time corresponds to result file "outflow-00011.vtk".
So how does the time used in default "every-10" corresponds to the simulation
time "tEnd"?
Thanks!
Best,
-Shawn
From: Andreas Lauser <[email protected]>
To: Shawn Zhang <[email protected]>; DuMuX User Forum
<[email protected]>
Sent: Saturday, July 28, 2012 12:59 PM
Subject: Re: [DuMuX] How to enable restart capability in DumuX
Hi Shawn,
On Friday 27 July 2012 07:51:14 Shawn Zhang wrote:
> On 07/25/2012 11:14 PM, Shawn Zhang wrote:
>> Sorry if this is a naive question, but I can't seem to get the restart
>> function working. Sample init files have a parameter,
>> restart =
>> But it appears to me that the value should to be an existing restart file.
>> How do I enable restart the first time?
Writing restart files is enabled by default, but the default is that only one
restart file gets written for every ten successfully completed time steps.
IIRC you're using very large grids, so that might be a bit too sparse for your
purposes. To write a restart file after every time step, just add the
following method to your problem class:
bool shouldWriteRestartFile() const
{ return true; }
if you would like to implement more sophisticated schemes, you may want to use
the time manager. Inside the problem you can access the time manager object by
using
this->timeManager()
e.g. if you want to write a restart file after each half hour of computation,
you can use the following
bool shouldWriteRestartFile() const
{
// index of the last restart file written
static int lastRestartIdx = 0;
// calculate index of the restart file if we would write one now.
int restartIdx = int(this->timeManager().wallTime() / (30 * 60));
// advice to write a restart file if the index current index is larger
// than the one of the last restart file. also, increment the last
// index to avoid writing henceforth after every time
// step
if (restartIdx > lastRestartIdx) {
lastRestartIdx = restartIdx;
return true;
}
// do not write a restart file if the 30 minutes are not yet over
return false;
}
(I hope it compiles, I have not checked.)
have fun
Andreas
--
Andreas Lauser
Department of Hydromechanics and Modelling of Hydrosystems
University of Stuttgart
Pfaffenwaldring 61
D-70569 Stuttgart
Phone: (+49) 711 685-64719
Fax: (+49) 711 685-60430
www.hydrosys.uni-stuttgart.de
_______________________________________________
Dumux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux_______________________________________________
Dumux mailing list
[email protected]
https://listserv.uni-stuttgart.de/mailman/listinfo/dumux