Re: Problem in dump.write for vector variables

2020-01-14 Thread Guyer, Jonathan E. Dr. (Fed) via fipy
I filed https://github.com/usnistgov/fipy/issues/691 to address this > On Jan 9, 2020, at 8:34 AM, Guyer, Jonathan E. Dr. (Fed) via fipy > wrote: > > Thank you for the feedback. I'm inclined to agree. > > - Jon > >> On Jan 9, 2020, at 3:47 AM, Marcel UJI (IMAP) wrote: >> >> Hi Jonathan >>

Re: Problem in dump.write for vector variables

2020-01-09 Thread Guyer, Jonathan E. Dr. (Fed) via fipy
Thank you for the feedback. I'm inclined to agree. - Jon > On Jan 9, 2020, at 3:47 AM, Marcel UJI (IMAP) wrote: > > Hi Jonathan > > Sorry by my late reply > > I think that the second one would be enough as I only need to read this data > later for further processing. Actually this is not

Re: Problem in dump.write for vector variables

2020-01-09 Thread Marcel UJI (IMAP)
Hi Jonathan Sorry by my late reply I think that the second one would be enough as I only need to read this data later for further processing. Actually this is not much an issue, as I can simply save phi and later recompute phi.faceGrad, which is also much more economic in terms of storage.

Re: Problem in dump.write for vector variables

2019-12-20 Thread Guyer, Jonathan E. Dr. (Fed) via fipy
Glad you found a solution, Marcel. The issue is that a FaceGradVariable doesn't pickle itself properly. It stores the state for a generic FaceVariable, but then it doesn't know how to rebuild itself from that. It either should - pickle the correct information, which would also involve

Re: Problem in dump.write for vector variables

2019-12-19 Thread Marcel UJI (IMAP)
Thank you Trevor, This works, but it saves the array values only. I found an alternative solution with: dump.write({'E' : FaceVariable(mesh=mesh,value=phi.faceGrad,rank=1)},filename='prova.gz',extension='.gz') which preserves the FaceVariable character. Merry Christmas! Marcel El

Re: Problem in dump.write for vector variables

2019-12-19 Thread Keller, Trevor (Fed) via fipy
The error message indicates that `dump.read` got something unexpected -- namely, a `value` field -- and threw. Naïvely, dumping `phi.faceGrad.value` instea dof `phi.faceGrad` appears to do the trick. -- Trevor Keller, Ph.D. Materials Science and Engineering Division National Institute of

Problem in dump.write for vector variables

2019-12-19 Thread Marcel UJI
I'm getting errors dumping *vector* variables in fipy. This minimal code shows the problem: from fipy import * mesh=Grid3D(nx=10,ny=10,nz=10) phi=CellVariable(mesh=mesh,value=(mesh.x*mesh.y)) dump.write({'E' : (phi.faceGrad)},filename='prova.gz',extension='.gz') fitxer=dump.read('prova.gz')