CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Tecplot

mat2tecplot

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree15Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   June 4, 2014, 09:50
Default
  #21
New Member
 
wen long
Join Date: May 2012
Posts: 27
Rep Power: 5
wenlong is on a distinguished road
Open mat2tecplot.m in a text editor, search for "magic number"
which is the version number, change to earlier version

Wen
wenlong is offline   Reply With Quote

Old   June 4, 2014, 11:26
Default mat2tecplot.m
  #22
New Member
 
nacera
Join Date: Feb 2014
Posts: 4
Rep Power: 4
chernac2000 is on a distinguished road
Hi wen,
I have a tecplot version 10, what is the earlier version of TDV that I will add it.
Thanks
chernac2000 is offline   Reply With Quote

Old   June 4, 2014, 12:32
Default
  #23
New Member
 
wen long
Join Date: May 2012
Posts: 27
Rep Power: 5
wenlong is on a distinguished road
Try TDV010 or TDV100
wenlong is offline   Reply With Quote

Old   June 4, 2014, 13:04
Default
  #24
New Member
 
nacera
Join Date: Feb 2014
Posts: 4
Rep Power: 4
chernac2000 is on a distinguished road
I have another problem when I put TDV100 and TDV010. The TDV100 give error as : "out of space while allocating var names" and /invalid header in binary datafile" and "unable to read binary datafile header.

The TDV010 give error as: unexpected end of file in datafile header
chernac2000 is offline   Reply With Quote

Old   June 4, 2014, 13:28
Default
  #25
New Member
 
wen long
Join Date: May 2012
Posts: 27
Rep Power: 5
wenlong is on a distinguished road
Oops, that means you would have to experiment a bit, the binary file format may have been changed from 10.0 to 11.0.
not sure what exactly your line of the magic number looks like unless you post it

also try "#!TDV101" which means 10.1 or "!TDV75 " for version 7.5 notice there is a space after 75
wenlong is offline   Reply With Quote

Old   June 4, 2014, 14:29
Default
  #26
New Member
 
nacera
Join Date: Feb 2014
Posts: 4
Rep Power: 4
chernac2000 is on a distinguished road
I've tested (TDV101 and TDV75 ), but they give the same error as TDV100. all older versions TDV105 give the same error
chernac2000 is offline   Reply With Quote

Old   June 5, 2014, 11:53
Default
  #27
Senior Member
 
Scott Rumage
Join Date: May 2009
Location: Seattle, WA
Posts: 147
Rep Power: 8
scott_rumage is on a distinguished road
I do believe you will need to upgrade your Tecplot license to the new version, as the option to use “Preplot” does not apply to the mat2tecplot.m application.

Preplot is used to convert Tecplot ASCII formatted data to Tecplot binary formatted data – which is not the situation for the use of mat2tecplot.m

Here is a link to the product page on Preplot (and TecIO) if you want to learn more about this application: http://www.tecplot.com/downloads/tecio-library/ . BTW – Preplot is already installed on your computer in the Tecplot 360 “bin” folder.

Contact Tecplot via the email -- sales at Tecplot dot com -- to get your license upgraded.

Scott
scott_rumage is offline   Reply With Quote

Old   July 30, 2014, 17:43
Default
  #28
Senior Member
 
Scott Rumage
Join Date: May 2009
Location: Seattle, WA
Posts: 147
Rep Power: 8
scott_rumage is on a distinguished road
Tecplot intern Devon Simpson has written a blog that provides a script and data showing how to use Wen Long’s Mat2Tecplot.m converter. The blog is located here: http://www.tecplot.com/blog/2014/07/28/create-tecplot-format-files-matlab-data/ .


Regards,
Scott
scott_rumage is offline   Reply With Quote

Old   December 12, 2014, 11:38
Default
  #29
Member
 
amine
Join Date: Jun 2012
Posts: 61
Rep Power: 5
lbmagis is on a distinguished road
Hello Sarah,
i have data which is updating (iterating method) as isotherms computing in matlab(its updating until we reach the convergence creteria)
my question is : how to get the last image in tecplot file (.plt)???
Thank you so much
lbmagis is offline   Reply With Quote

Old   December 12, 2014, 17:05
Default What version of Tecplot are you using
  #30
Member
 
Durrell Rittenberg
Join Date: May 2011
Location: Bellevue WA
Posts: 38
Rep Power: 6
Durrell4 is on a distinguished road
Send a message via MSN to Durrell4 Send a message via Yahoo to Durrell4 Send a message via Skype™ to Durrell4
Hi nacera,

What version of Tecplot are you using?

Durrell
Durrell4 is offline   Reply With Quote

Old   December 30, 2014, 13:36
Default how can i visualize isotherms and streamlines using this way?
  #31
Member
 
amine
Join Date: Jun 2012
Posts: 61
Rep Power: 5
lbmagis is on a distinguished road
Hello,
Could any one tell us how to use this way to visualize isotherms and streamlines in 2Dimensions.
Thank you
lbmagis is offline   Reply With Quote

Old   December 30, 2014, 13:51
Default Check out the videos at the link below
  #32
Member
 
Durrell Rittenberg
Join Date: May 2011
Location: Bellevue WA
Posts: 38
Rep Power: 6
Durrell4 is on a distinguished road
Send a message via MSN to Durrell4 Send a message via Yahoo to Durrell4 Send a message via Skype™ to Durrell4
Quote:
Originally Posted by lbmagis View Post
Hello,
Could any one tell us how to use this way to visualize isotherms and streamlines in 2Dimensions.
Thank you
One can add streamlines interactively via the streamtrace placement tool on the sidebar.


Isotherms can be produced via our contour groups and using a surface contour.

Check out some the videos on using Tecplot here http://www.tecplot.com/products/tecp...deo-tutorials/

Best

Durrell
Durrell4 is offline   Reply With Quote

Old   February 2, 2015, 09:38
Default Superpose two matlab figures or more in one figure like these
  #33
Member
 
amine
Join Date: Jun 2012
Posts: 61
Rep Power: 5
lbmagis is on a distinguished road
Hello and thank you so much for your quick reply

what i am intresting in is how to put many contours on the same matlab's figure? like these below: look to one of these figures ,please let's choose the first one on the left, did you observe that on the first contour (dashed lines), there's another one but with (solid lines).

how can i make the same thing???
NB: no way to imagesc them at the same time on the matlab code, we obtain these contours one by one .... so i thinking about export them (2 contours or more) together to tecplot wishing make the necessary post-processing treatment
in order to get the same result
Thanks
Attached Images
File Type: jpg matlab.jpg (82.0 KB, 9 views)
lbmagis is offline   Reply With Quote

Old   February 27, 2015, 22:39
Default
  #34
New Member
 
Join Date: Feb 2010
Posts: 4
Rep Power: 8
shhe is on a distinguished road
Quote:
Originally Posted by sarah440 View Post
Hi,

I have a DNS database which includes the coordinate matrices x, y, z as well as the velocity fields u, v and w. All matrices have the same size of nl*nc*ns. Then I use Matlab to compute some new parameters like swirling rate. At the end of my own script I use mat2tecplot.m to convert mat files to PLT format. Here is what I put at the end of my script:

PLTout = strcat(outputAddress,PLTout_name); %The output name and address
tdata=[];
tdata.Nvar=7; %number of variables
tdata.vformat = 2*ones(1,tdata.Nvar); %Double precision for each variable (optional)
tdata.varnames={'x','y','z','u','v','w','Lambda'};
tdata.cubes(1).zonename=eval('PLTout_name'); %any name
tdata.cubes(1).x=x(nl*nc*ns);
tdata.cubes(1).y=y(nl*nc*ns);
tdata.cubes(1).z=z(nl*nc*ns);
tdata.cubes(1).v(1,:,:,: )=u(nl*nc*ns);
tdata.cubes(1).v(2,:,:,: )=v(nl*nc*ns);
tdata.cubes(1).v(3,:,:,: )=w(nl*nc*ns);
tdata.cubes(1).v(4,:,:,: )=lambda(nl*nc*ns);
mat2tecplot(tdata,eval('PLTout'))

I can easily visulize this PLT file in Tecplot
Hope this helps
Hi,
I have tried to do as you but unfortunately, it failed to generate the tecplot file. My code as following:

tdata=[];
tdata.Nvar=5; %number of variables
tdata.vformat = 2*ones(1,tdata.Nvar); %Double precision for each variable (optional)
tdata.varnames={'X','Y','Z','TEMP','TEMP_GRADIENT_ NON_UNITY'};
tdata.cubes(1).zonename='TEMP_GRADIENT_NON_UNITY'; %any name
%tdata.cubes(1).zonename=eval('TEMP_GRADIENT_NON_U NITY'); %any name
tdata.cubes(1).x=X;
tdata.cubes(1).y=Y;
tdata.cubes(1).z=Z;
tdata.cubes(1).v(1,:,:,: )=TEMP;
tdata.cubes(1).v(2,:,:,: )=TEMP_GRADIENT_NON_UNITY;
mat2tecplot(tdata,'TEMP_GRADIENT_NON_UNITY.plt')


I have gotten the following error:
Error : cube 1 v 2nd, 3rd, 4th dimension
must be of the same size as x, y, z

To your knwledge, my domain is 201*201*201
shhe is offline   Reply With Quote

Old   February 28, 2015, 15:45
Default
  #35
New Member
 
Join Date: Feb 2013
Posts: 4
Rep Power: 5
sarah440 is on a distinguished road
Quote:
Originally Posted by shhe View Post
Hi,
I have tried to do as you but unfortunately, it failed to generate the tecplot file. My code as following:

tdata=[];
tdata.Nvar=5; %number of variables
tdata.vformat = 2*ones(1,tdata.Nvar); %Double precision for each variable (optional)
tdata.varnames={'X','Y','Z','TEMP','TEMP_GRADIENT_ NON_UNITY'};
tdata.cubes(1).zonename='TEMP_GRADIENT_NON_UNITY'; %any name
%tdata.cubes(1).zonename=eval('TEMP_GRADIENT_NON_U NITY'); %any name
tdata.cubes(1).x=X;
tdata.cubes(1).y=Y;
tdata.cubes(1).z=Z;
tdata.cubes(1).v(1,:,:,: )=TEMP;
tdata.cubes(1).v(2,:,:,: )=TEMP_GRADIENT_NON_UNITY;
mat2tecplot(tdata,'TEMP_GRADIENT_NON_UNITY.plt')


I have gotten the following error:
Error : cube 1 v 2nd, 3rd, 4th dimension
must be of the same size as x, y, z

To your knwledge, my domain is 201*201*201
Hi,

It seems that the sizes of your arrays are not the same. Here is the error display lines in the script:

if(Imax_v~=Imax || Jmax_v~=Jmax || Kmax_v ~= Kmax)
s=-1;
display(['Error : cube ' int2str(icube) ' v 2nd, 3rd, 4th dimension']);
display([' must be of the same size as x, y, z']);

Are you sure that your arrays (including x, y, z) are all 3D with the same size?
sarah440 is offline   Reply With Quote

Old   March 1, 2015, 03:47
Default
  #36
New Member
 
Join Date: Feb 2010
Posts: 4
Rep Power: 8
shhe is on a distinguished road
Quote:
Originally Posted by sarah440 View Post
Hi,

It seems that the sizes of your arrays are not the same. Here is the error display lines in the script:

if(Imax_v~=Imax || Jmax_v~=Jmax || Kmax_v ~= Kmax)
s=-1;
display(['Error : cube ' int2str(icube) ' v 2nd, 3rd, 4th dimension']);
display([' must be of the same size as x, y, z']);

Are you sure that your arrays (including x, y, z) are all 3D with the same size?
Yes, I am sure that the dimensions in 3d (201*201*201). Just look on the attached snapshot for print screen. You will see in workspaces the dimension of each variables after loading the file and then execute input_to_matlab script which has the following lines:
%TEMP_GRADIENT_NON_UNITY = strcat(outputAddress,TEMP_GRADIENT_NON_UNITY_name) ; %The output name and address
tdata=[];
tdata.Nvar=5; %number of variables
tdata.vformat = 2*ones(1,tdata.Nvar); %Double precision for each variable (optional)
tdata.varnames={'X','Y','Z','TEMP','TEMP_GRADIENT_ NON_UNITY'};
tdata.cubes(1).zonename='TEMP_GRADIENT_NON_UNITY'; %any name
%tdata.cubes(1).zonename=eval('TEMP_GRADIENT_NON_U NITY'); %any name
tdata.cubes(1).x=X;
tdata.cubes(1).y=Y;
tdata.cubes(1).z=Z;
tdata.cubes(1).v(1,:,:,=TEMP;
tdata.cubes(1).v(2,:,:,=TEMP_GRADIENT_NON_UNITY;
mat2tecplot(tdata,'TEMP_GRADIENT_NON_UNITY.plt')
Attached Images
File Type: jpg Screen Shot 2015-03-01 at 07.41.29.jpg (65.2 KB, 12 views)
shhe is offline   Reply With Quote

Old   March 1, 2015, 11:14
Default
  #37
New Member
 
Join Date: Feb 2013
Posts: 4
Rep Power: 5
sarah440 is on a distinguished road
What I see here is that X, Y, Z are 201*1, you need them to be 201*201*201 like TEMP. First, use "meshgrid" function to convert X, Y, Z to rectangular grid. It should work then.
sarah440 is offline   Reply With Quote

Old   March 1, 2015, 15:52
Default
  #38
New Member
 
Join Date: Feb 2010
Posts: 4
Rep Power: 8
shhe is on a distinguished road
Quote:
Originally Posted by sarah440 View Post
What I see here is that X, Y, Z are 201*1, you need them to be 201*201*201 like TEMP. First, use "meshgrid" function to convert X, Y, Z to rectangular grid. It should work then.
Thank you very much, meshgrid was the solution. It works well now.
shhe is offline   Reply With Quote

Old   March 24, 2015, 17:21
Default error in this line: function name(inputs)
  #39
Member
 
amine
Join Date: Jun 2012
Posts: 61
Rep Power: 5
lbmagis is on a distinguished road
Hello,
Thank you for the good explanation!
i tried this but did'nt work!!!

function name(inputs) ------> error in this
could you show us a program as an example, where did you write this part of program in your code???
Thank you again.

Quote:
Originally Posted by Hoggs17 View Post
After reading through the mat2tecplot.m documentation, this is what I did in order to export my matlab data into a readable Tecplot file. Hope this will help any other users out there that aren't quite using it right. This is just my interpretation of Wen Long's code; all credit must be given to him for writing it.

1. You must keep the mat2tecplot.m in the same directory as your other files as your main program will call mat2tecplot.m (should be self-explanatory but you know never know).

2. In your program, you must call mat2tecplot.m and specify what data you are transferring.

3. Following the examples given in the documentation (I followed example 3 I believe), you can change a few lines of code to reflect which data you want to export. My code is as follows.

function name(inputs)

tdata=[];
tdata.Nvar=6;
tdata.varnames={'x','y','z','u','v','p_new'};
tdata.surfaces(1).zonename='mysurface zone';
tdata.surfaces(1).x=x;
tdata.surfaces(1).y=y;
tdata.surfaces(1).v(1,:,: )=u;
tdata.surfaces(1).v(2,:,: )=v;
tdata.surfaces(1).v(3,:,: )=p_new;
mat2tecplot(tdata,'SIMPLE Results.plt')

end

You have to make sure that the value specified in tdata.Nvar is equal to the number of variables you place in tdata.varnames. I specified 6 variables and then had 6 names given. I have 2-D flow (x,y,z=0) and want my data for u and v momentum and pressure exported. "tdata.surfaces(1).x= " is used to specify your domain. In the example, coordinates are given for x,y,z; in my code; i simply set the .x value equal to my x-values on my defined mesh. The same was done for the y-values. if you specify nothing (as with z), it is assumed 0.

The "tdata.surfaces(1).v(1,:,: )= " code specifies which data you want displayed as a result. i set it equal to my u momentum. To add multiple data to the same file, you change the .v(1,:,: ) to .v(2,:,: ) etc... for as many different data sets as you like. I had 3 data sets (u,v,pressure) so I have 3 lines.

Finally, the last line in the code calls mat2tecplot using the values you have specified and outputs an easily readable tecplot input file (called 'SIMPLE Results'). My contour plots for momentum and pressure look much better than they did on matlab plus you now have the flexibility of using tecplot to manipulate your visualization axis, contour # etc...

You just have to add a few lines of code to your matlab program and the mat2tecplot.m does all the work for you.

Now if I could just figure out how to transfer my streamline data I'd be all set - anyone have any tips?
lbmagis is offline   Reply With Quote

Old   April 9, 2015, 16:14
Default
  #40
New Member
 
wen long
Join Date: May 2012
Posts: 27
Rep Power: 5
wenlong is on a distinguished road
lbmagis

You seem to not understanding that: tecplot data file does not contain information about "contours", it is designed to have the data that the contours should be based on.

So instead of trying to put "contours" into the data file, just put in the original data. Contours are viewable once you have the data file in .plt format and open it in tecplot software.

Plus: post your code directly so that we can help

Wen
wenlong is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 07:27.