[Nek5000-users] Reading binary data

nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
Tue Aug 17 11:40:06 CDT 2010


Paul,

That info did the trick -- Thanks!!

--Mike

On Aug 13, 2010, at 3:28 PM, <nek5000-users at lists.mcs.anl.gov> <nek5000-users at lists.mcs.anl.gov> wrote:

> 
> Hi Mike,
> 
> I was able to track this down by
> 
> cd nek5_svn/trunk/nek
> 
> edit prepost.f
> 
> search for ifxyo
> 
> Near one of these I find:
> 
>     call mfo_outv(xm1,ym1,zm1,nout,nxo,nyo,nzo)
> 
> 
> and looking at the mfo_outv() [ multifile-output,
> output a vector ] routine, I find:
> 
> 
>          j = 0
>          if (wdsizo.eq.4) then             ! 32-bit output
>              do iel = 1,nel
>                 call copyx4   (u4(j+1),u(1,iel),nxyz)
>                 j = j + nxyz
>                 call copyx4   (u4(j+1),v(1,iel),nxyz)
>                 j = j + nxyz
>                 if(if3d) then
>                   call copyx4 (u4(j+1),w(1,iel),nxyz)
>                   j = j + nxyz
> 
> 
> which indicates that the vector fields are output a
> 
>    vx(:,:,:,1)   nxyz points  (32 bits/pt)
>    vy(:,:,:,1)   nxyz points
>    vz(:,:,:,1)   nxyz points
>    vx(:,:,:,2)   nxyz points
>    vy(:,:,:,2)   nxyz points
>    vz(:,:,:,2)   nxyz points
>         :
>    vx(:,:,:,nel)   nxyz points
>    vy(:,:,:,nel)   nxyz points
>    vz(:,:,:,nel)   nxyz points
> 
> etc.
> 
> So, you would likely see,
> 
>    xyz  (interleaved, as above)
>    uvw  (interleaved, as above)
>    p    (entire field)
>    T    (entire field)
>    PS1  (entire field)
>    PS2  (entire field)
> 
> etc.
> 
> Note that the order of the elements will likely not be
> sequential unless you are running on one processor.  It
> will instead be ordered according to the header info.
> 
> Paul
> 
> 
> 
> 
> 
> 
> On Fri, 13 Aug 2010, nek5000-users at lists.mcs.anl.gov wrote:
> 
>> Stefan,
>> 
>> I'm still having some problems reading the field data properly.   So, please consider a field file that has BOTH mesh data and field data, and assume there are three fields stored (u,v,w,p).
>> 
>> After the initial file data (header: 132 bytes, endian 4 bytes, mapping: nel* 4 bytes), does the mesh data come in single chunk before field data (as discussed in your message below):
>> 
>> LOOP over all elements
>> 	LOOP i = {x,y,z}
>> 		 i for all GLL points (internal element points)
>> 	ENDLOOP
>> ENDLOOP
>> 
>> If that is indeed all before the field data, is the field data then organized as
>> 
>> LOOP over all elements
>> LOOP i = three fields
>> 	 i for all GLL points (internal element points)
>> ENDLOOP
>> ENDLOOP
>> 
>> or, is it
>> 
>> LOOP over all elements
>> LOOP i = GLL points
>> 	 i for all fields
>> ENDLOOP
>> ENDLOOP
>> 
>> ??
>> 
>> Is there by chance a detailed description for the format of the field file somewhere that I am missing?
>> 
>> --Mike
>> 
>> On Aug 11, 2010, at 3:50 PM, <nek5000-users at lists.mcs.anl.gov> <nek5000-users at lists.mcs.anl.gov> wrote:
>> 
>>> Hi Mike,
>>> 
>>> vector fields (e.g. mesh coordinates) are stored in the following way:
>>> 
>>> LOOP over all elements
>>> 	LOOP i = {x,y,z}
>>> 		 i for all GLL points (internal element points)
>>> 	ENDLOOP
>>> ENDLOOP
>>> 
>>> 2D example with (E=2,N=2):
>>> x1_1 x2_1 x3_1 y1_1 y2_1 y3_1 x1_1 x2_2 x3_2 y1_2 y2_2 y3_2
>>> 
>>> where x2_1 means the x-coordinate of the 2nd GLL point of element 1.
>>> 
>>> hth,
>>> Stefan
>>> 
>>> On Aug 11, 2010, at 11:34 PM, <nek5000-users at lists.mcs.anl.gov> wrote:
>>> 
>>>> 
>>>> Hello All.  I found this helpful message from Stefan regarding the structure of a binary field file.   Could someone please tell me what the structure is when the geometry info is also contained?
>>>> 
>>>> Thanks!
>>>> --Mike
>>>> 
>>>> nek5000-users at lists.mcs.anl.gov nek5000-users at lists.mcs.anl.gov
>>>>> Thu May 6 07:18:03 CDT 2010
>>>>> 	• Previous message: [Nek5000-users] Reading binary data
>>>>> 	• Next message: [Nek5000-users] History points
>>>>> 	• Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>>>>> Hi Fred,
>>>>> 
>>>>> header: 132 bytes
>>>>> endian test tag: 4 bytes
>>>>> element mapping: nel* 4 bytes
>>>>> data: nfields*nxyz*nel* wdsizo (where wdsizo is 4 or 8 bytes)
>>>>> metadata (min/max values): nfields*2*nel * 4 bytes
>>>>> 
>>>>> Stefan
>>>>> 
>>>> 
>>>> _______________________________________________
>>>> Nek5000-users mailing list
>>>> Nek5000-users at lists.mcs.anl.gov
>>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
>>> 
>>> _______________________________________________
>>> Nek5000-users mailing list
>>> Nek5000-users at lists.mcs.anl.gov
>>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
>> 
>> _______________________________________________
>> Nek5000-users mailing list
>> Nek5000-users at lists.mcs.anl.gov
>> https://lists.mcs.anl.gov/mailman/listinfo/nek5000-users
> <ATT00001..txt>




More information about the Nek5000-users mailing list