[Nek5000-users] fld output
nek5000-users at lists.mcs.anl.gov
nek5000-users at lists.mcs.anl.gov
Fri Dec 13 07:19:48 CST 2013
Hi JP,
The answer to your questions depends on the mesh and the
number of processors.
Let's assume that you have the simplest possible mesh,
i.e., one generated with genbox.
Let's further assume you have only one processor.
Then the following loops are equivalent:
n=nx1*ny1*nz1*nelt
do i=1,n
write(6,*) xm1(i,1,1,1)
enddo
integer e
do e=1,nelt
do k=1,nz1
do j=1,ny1
do i=1,nx1
write(6,*) xm1(i,j,k,e)
enddo
enddo
enddo
enddo
In other words, the two loops write out the data as it
is stored in memory --- with unit stride. (Loop 1 is
preferred, because it has better potential for compiler
optimization.)
In the two processor case, the loops are also equivalent.
However, here, the "e" variable points to the local element
number, and one does not know until runtime which elements
are assigned to which processor----so the mapping of "e"
in your mesh (which we typically refer to as eg, for global
element number) is an unknown. The array lglel(e) returns
eg for each e=1,...,nelt.
Regarding the spatial order, if the mesh was generated with
genbox, then the elements are lexicographically ordered.
Specifically, if you have (in the one processor case):
nelt = nelx x nely x nelz, then you would have
eg ex ey ez
1 1 1 1
2 2 1 1
3 3 1 1
4 4 1 1
: : 1 1
nelx nelx 1 1
nelx+1 1 2 1
: : : :
nelt nelx nely nelz
In the multiprocessor case, your custom file format will
require communication.
Paul
On Fri, 13 Dec 2013, nek5000-users at lists.mcs.anl.gov wrote:
> Hi Paul, Katie and all,
>
> Sorry for the very late reply but I had to interrupt what I was working on.
>
> Going back to the problem, I basically would like to understand better how
> to extract the simulation results from xm1, ym1, zm1, vx, etc.
>
> I have been trying to do so in userchk() in the .usr file through
> postprocessing.. I have been able to extract all the data and print into a
> custom file format but I am having difficulties in understanding how the
> data is sorted in xm1, ym1, etc. For instance, I have noticed that the
> y1/z1 values are sorted in chunks depending on the spectral order/square of
> the spectral order respectively but are sorted in some strange way..
>
> My aim is to output the data into a custom file format, with for example,
> all the zm1 values in order, and then subsequently all the ym1 values in
> order.. without having to go through a sorting algorithm.. i.e. to output
> directly through some loops by knowing the sorting of the arrays xm1, ym1
> etc
>
> (Note that I output to f0000* files (binary) and will use MPI I/O too..)
>
> Thank you,
> JP
>
More information about the Nek5000-users
mailing list