Reading output file

46 views
Skip to first unread message

Martin Spillum Grønli

unread,
Nov 28, 2022, 9:18:42 AM11/28/22
to claw-users
Hi!

I want restart my simulation at frame number 10 by typing claw.solution = pyclaw.Solution(10, file_format='ascii'). However, this gives 

 num_ghost = read_data_line(f, data_type=int)
  File "/usr/local/lib/python3.10/dist-packages/clawpack/pyclaw/util.py", line 574, in read_data_line
    raise IOError('*** Reached EOF in file %s' % inputfile.name)
OSError: *** Reached EOF in file ./_output/fort.t0010
Exception ignored in: <function SharpClawSolver.__del__ at 0x7fbc77c68280>
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/clawpack/pyclaw/sharpclaw/solver.py", line 276, in __del__
    self.fmod.clawparams.dealloc_clawparams()
AttributeError: 'NoneType' object has no attribute 'clawparams'

Adding a line with "3      num_ghost" in fort.t0010 gives "Initial solution is not valid".

How can i avoid this problem?

David Ketcheson

unread,
Dec 9, 2022, 4:17:16 AM12/9/22
to claw-users
Thanks for catching this!  It seems that this bug has been in place for a very long time.  I just submitted a PR with a fix here: https://github.com/clawpack/pyclaw/pull/697

It should get merged within a day or so.  It's a one-line fix, so you can just make the change in your local copy of pyclaw if you prefer.

The issue with num_ghost missing from the output file was fixed in another recent patch, so if you first update your copy of pyclaw (to the master branch from Github) that will be resolved.  Let me know if you still run into trouble.

David Ketcheson

Reply all
Reply to author
Forward
0 new messages