import math
import os

# User defined 
viscosity = 0.01E8
rho0      = 1.0
length    = 0.1


#-----------------------------------------------------------------------
plot  = []
show_plot = True

files = ['*probe*.res']
resultFolder = 'prod/'
folders = []
# Set up the list of simulation folders in the results directory
for dirname, dirnames, filenames in os.walk(resultFolder):
  isSimDir = False
  # if I find tracking as subdirectory, mark as a simulation directory
  if 'tracking' in dirnames:
    isSimDir = True
  # if it was marked as a simulation directory, append it to the folder list
  if isSimDir:
    folders.append(dirname)

print 'Found simulation folders:'
print folders

# directory loop
fileList = []
for iFolder in range(len(folders)):
  fileList.append (folders[iFolder]+'/tracking/'+files[0] )

## xy plot 
plot.append(dict(kind = 'namedVals',
            data=fileList,
           row=[0,-1],col=[1,2], endplot = True, ls = 'b', lw = 2,
           label = 'ok', labels = folders ))


