Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gmsh CellVariables can't be unpickled #217

Closed
guyer opened this issue Sep 19, 2014 · 3 comments
Closed

Gmsh CellVariables can't be unpickled #217

guyer opened this issue Sep 19, 2014 · 3 comments

Comments

@guyer
Copy link
Member

guyer commented Sep 19, 2014

>>> from fipy import *
>>> circle = Gmsh2D(*
... cellSize = 0.05;
... radius = 1;
... Point(1) = {0, 0, 0, cellSize};
... Point(2) = {-radius, 0, 0, cellSize};
... Point(3) = {0, radius, 0, cellSize};
... Point(4) = {radius, 0, 0, cellSize};
... Point(5) = {0, -radius, 0, cellSize};
... Circle(6) = {2, 1, 3};
... Circle(7) = {3, 1, 4};
... Circle(8) = {4, 1, 5};
... Circle(9) = {5, 1, 2};
... Line Loop(10) = {6, 7, 8, 9};
... Plane Surface(11) = {10};
... Recombine Surface{11};
... *)
>>> x, y = circle.getCellCenters()
>>> phi = CellVariable(mesh=circle, value=x*y)
>>> dump.write(phi, "circle.dmp.gz")
>>> phi2 = dump.read("circle.dmp.gz")
------------------------------------------------------------
Traceback (most recent call last):
  ...
  File ".../fipy/meshes/numMesh/gmshImport.py", line 545, in _getGlobalOverlappingCellIDs
return nx.array(self.cellGlobalIDs + self.gCellGlobalIDs)
AttributeError: Gmsh2D instance has no attribute 'cellGlobalIDs'

This arises because __getstate__ bypasses __init__ and so Gmsh2D.mshFile.buildMeshData() never gets called (and couldn't be because we don't know what the original Gmsh script was.

self.cellGlobalIDs and self.gCellGlobalIDs need to be set to something sensible.

Imported from trac ticket #313, created by guyer on 11-29-2010 at 15:35, last modified: 01-28-2011 at 15:59

@guyer
Copy link
Member Author

guyer commented Sep 19, 2014

Fixed in r4018

Trac comment by guyer on 11-29-2010 at 16:06

@guyer
Copy link
Member Author

guyer commented Sep 19, 2014

Fix r4018 clobbered by r4080.

Trac comment by guyer on 01-28-2011 at 13:50

@guyer
Copy link
Member Author

guyer commented Sep 19, 2014

Re-fixed (with tests) in r4191.

Trac comment by guyer on 01-28-2011 at 15:59

@guyer guyer closed this as completed Sep 19, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants