On Thu, Nov 15, 2012 at 1:17 PM, dely <[email protected]> wrote:
> FiPy,
>
> I am unable to read pickled dump files from simulations with a 
> PeriodicGrid2DLeftRight mesh using FiPy version '3.0-dev5303'. I use the 
> fipy.dump function to save the mesh and variables for postprocessing, but I 
> receive the following output when I try to unpickle the mesh using 
> fipy.dump.read:

Hi Dave,

This is defintely a bug. Thanks for finding it. I filed a ticket for
this (see http://matforge.org/fipy/ticket/482) and fixed it. If you
want these changes, you can clone the FiPy repository from

  git://code.matforge.org/nist/fipy.git

The commit you'll need is 6e475ec2bf01aae44bc. You could also just
patch the class that is broken for you with the following simple
changes.

  diff --git a/fipy/meshes/periodicGrid2D.py b/fipy/meshes/periodicGrid2D.py
  index bcdbea0..95f8945 100755
  --- a/fipy/meshes/periodicGrid2D.py
  +++ b/fipy/meshes/periodicGrid2D.py
  @@ -44,8 +44,8 @@ from fipy.meshes.grid2D import Grid2D
   __all__ = ["PeriodicGrid2D", "PeriodicGrid2DLeftRight",
"PeriodicGrid2DTopBottom"]

   class _BasePeriodicGrid2D(Grid2D):
  -    def __init__(self, dx = 1., dy = 1., nx = None, ny = None,
overlap=2, communicator=parallel):
  -        super(_BasePeriodicGrid2D, self).__init__(dx = dx, dy = dy,
nx = nx, ny = ny, overlap=overlap, communicator=communicator)
  +    def __init__(self, dx = 1., dy = 1., nx = None, ny = None,
overlap=2, communicator=parallel, *args, **kwargs):
  +        super(_BasePeriodicGrid2D, self).__init__(dx = dx, dy = dy,
nx = nx, ny = ny, overlap=overlap, communicator=communicator, *args,
**kwargs)
           self._nonPeriodicCellVertexIDs = super(_BasePeriodicGrid2D,
self)._cellVertexIDs
           self._orderedCellVertexIDs_data =
super(_BasePeriodicGrid2D, self)._orderedCellVertexIDs
           self._nonPeriodicCellFaceIDs =
numerix.array(super(_BasePeriodicGrid2D, self).cellFaceIDs)

Good luck!

--
Daniel Wheeler

_______________________________________________
fipy mailing list
[email protected]
http://www.ctcms.nist.gov/fipy
  [ NIST internal ONLY: https://email.nist.gov/mailman/listinfo/fipy ]

Reply via email to