-
Notifications
You must be signed in to change notification settings - Fork 69
Expand file tree
/
Copy path08_save_data.py
More file actions
28 lines (22 loc) · 1.02 KB
/
08_save_data.py
File metadata and controls
28 lines (22 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from os import path
import tecplot
# Run this script with "-c" to connect to Tecplot 360 on port 7600
# To enable connections in Tecplot 360, click on:
# "Scripting" -> "PyTecplot Connections..." -> "Accept connections"
import sys
if '-c' in sys.argv:
tecplot.session.connect()
examples_directory = tecplot.session.tecplot_examples_directory()
infile = path.join(examples_directory, 'OneraM6wing', 'OneraM6_SU2_RANS.plt')
dataset = tecplot.data.load_tecplot(infile)
variables_to_save = [dataset.variable(V)
for V in ('x', 'y', 'z', 'Pressure_Coefficient')]
zone_to_save = [dataset.zone('WingSurface')]
# write data out to a binary PLT file
tecplot.data.save_tecplot_plt('wing.plt', dataset=dataset,
variables=variables_to_save,
zones=zone_to_save)
# write data out to an ascii file
tecplot.data.save_tecplot_ascii('wing.dat', dataset=dataset,
variables=variables_to_save,
zones=zone_to_save)