[petsc-users] binary writing to tecplot

Benjamin Sanderse B.Sanderse at cwi.nl
Mon Nov 28 11:29:30 CST 2011


Hi Tay,

Thanks for your help! Currently I am trying something else: I write my data (simply a Vec) to HDF5 files with PetscViewerHDF5Open() and then I load the data with the HDF5 data loader in Tecplot. This works, but Tecplot does not recognize the fact that my data is 2D, because the HDF5 file does not contain the header information like the PLT files do. I don't know yet how to get the header information in the HDF5 file. If somebody knows a solution for this, that would be great.

Benjamin

Op 28 nov 2011, om 14:54 heeft TAY wee-beng het volgende geschreven:

> Hi Benjamin,
> 
> I am also outputting tecplot files from my Fortran CFD code.
> 
> I am using mtd 1 and 2. For mtd 1, I copied data from other procs to the root, and the root write the full data output using tecdat112. As you mentioned, it takes more time.
> 
> For mtd 2, I write the data from each procs as a separate file. Then in tecplot, load multiple files together to get the full view and data. Or you can combine the files 1st using in command prompt or linux:
> 
> tec360 -b "1.plt" "2.plt" -p cat_datasets.mcr
> 
> where cat_datasets.mcr is:
> 
> !#!MC 1200
> !$!WRITEDATASET  "final.plt"
> 
> The above is obtained from http://www.tecplottalk.com/
> 
> This mtd is supposed to be much better than the 1st. However, during visualization, you'll see the edges of each data file. In 2D, you can just turn off the "edges" option but in 3D, due to the arrangement of the data, it's much more difficult.
> 
> Supposed your data is i=1,10, j=1,10 and it's separated in 2 procs:
> 
> 1. i=1,10, j=1,5
> 2. i=1,10, j=6,10.
> 
> If mtd 2 is used, both regions 'll be represented as i=1,10, j=1,5 in tecplot, which explains the problem earlier.
> 
> If someone knows how to change both regions to j=1,5 and j=6,10, it'll be much better.
> 
> Hope that helps.
> 
> Yours sincerely,
> 
> TAY wee-beng
> 
> 
> On 22/11/2011 11:40 AM, Benjamin Sanderse wrote:
>> Hello all,
>> 
>> I am trying to output parallel data in binary format that can be read by Tecplot. For this I use the TecIO library from Tecplot, which provide a set of Fortran/C subroutines. With these subroutines it is easy to write binary files that can be read by Tecplot, but, as far as I can see, they can not be directly used with parallel Petsc vectors. On a single processor everything works fine, but on more processors it fails.
>> I am thinking now of different workarounds:
>> 
>> 1. Create a sequential vector from the parallel vector, and call the TecIO subroutines with this sequential vector. For large problems this will probably be too slow, and actually I don't know how to copy the content of a parallel vector into a sequential one.
>> 2. Write a tecplot file from each processor, with the data from that processor. The problem is that this requires combining the files afterwards, and this is probably not easy (certainly not in binary format?).
>> 3. Change the tecplot subroutines or write own binary output with VecView(). It might not be easy to get the output right so that Tecplot understands it.
>> 
>> Do you have suggestions? Are there other possibilities?
>> 
>> Thanks,
>> 
>> Benjamin
>> 
>> 




More information about the petsc-users mailing list