Пример #1
0
sys.path.append(HOME+'/lib/python')
sys.path.append(HOME+'/pylib')
sys.path.append(BOUT_TOP+'/tools/pylib')
sys.path.append(BOUT_TOP+'/tools/pylib/boutdata')
sys.path.append(BOUT_TOP+'/tools/pylib/boututils')
sys.path.append(BOUT_TOP+'/tools/pylib/post_bout')


import matplotlib 
#matplotlib.use('pdf')
from boutdata import collect
from boututils import *
from post_bout import read_inp,parse_inp,read_cxx
import numpy as np

inp = read_inp(path='./',boutinp='BOUT_turb.inp')
inp = parse_inp(inp)

nx = np.int(inp['[mesh]']['nx'])
nz = np.int(inp['[main]']['MZ'])

path='/tmp/SOLblob/data_Ra1e4_turb'
dukatpath = '/media/dukat'+path

path = dukatpath

n = np.squeeze(collect('n',path=path,tind=[0,299]))
#phi =  np.squeeze(collect('phi',path=path,tind=[0,299]))
# u =  np.squeeze(collect('u',path=path,tind=[0,299],zind=[nz/2,nz/2]))

#nt,nx,ny = n.shape
Пример #2
0
    meta={}
    
    for elem in IC.variables:
        print elem
        meta[elem] = np.array(IC.variables[elem][:])
  
    return meta
################
#get metadata from  inp, grid file, output nc as well as the source code

#grid
IC_rmp = get_IC() #grid file, refered to as IC here, contains dx,dy and 
# and unnormalized B field component

#BOUT.inp
inp = read_inp(path='./',boutinp='BOUT_3D.inp')
inp = parse_inp(inp)

#some data from a single .dmp.xx.nc
outinfo = file_import(data_dir+'/BOUT.dmp.0.nc') #output data
availkeys = np.array([str(x) for x in outinfo])

#grab some info that is computed at runtime info
metric = ['g11','g22','g33','b0xcvx','b0xcvy','b0xcvz']
for elem in metric:
    IC_rmp[elem] = collect(elem,path=data_dir)
try:
    print path
    cxxinfo = no_comment_cxx(path=data_dir,boutcxx='physics_code.cxx.ref')
       #evolved = get_evolved_cxx(cxxinfo)
    fieldkeys = get_evolved_cxx(cxxinfo)