def vortexCylinder(): #VERTICAL STACK OF 2D FIELDS....3D FIELD
    """
    """
    from vortexCore import vortexCore2
    from lambda2 import lambda2_3d
    
    gamma = 1 #strength of the vortex.
    Rcore = 18 #radious of the vortex core.
    s = 20 #size parameter of the field x*y points.
    h = 3 #min is 1
    q = N.array([[0,0,0]]) #point where the vortex will be located
    
    [z,y,x] = N.mgrid[0:1,-s:s+1, -s:s+1]
    [Z,Y,X] = N.mgrid[-h:h+1,-s:s+1, -s:s+1]
    [W,V,U] = N.zeros_like([Z,Y,X],dtype=float)
    for i in range(len(Z)):
        #vortexCore2(X,Y,C,Rcore,gamma):
        [U_temp,V_temp] = vortexCore2(x[0],y[0],q,Rcore,gamma)
        
        U[i]=U_temp
        V[i]=V_temp
    
    L2 = lambda2_3d(X,Y,Z,U,V,W)
    #print L2[3]
    #vF=mlab.quiver3d(Z,Y,X,W,V,U)
    Lamda2 = mlab.contour3d(Z,Y,X,L2,transparent=True)
    mlab.show()
    return
def vortexCylinder():  #VERTICAL STACK OF 2D FIELDS....3D FIELD
    """
    """
    from vortexCore import vortexCore2
    from lambda2 import lambda2_3d

    gamma = 1  #strength of the vortex.
    Rcore = 18  #radious of the vortex core.
    s = 20  #size parameter of the field x*y points.
    h = 3  #min is 1
    q = N.array([[0, 0, 0]])  #point where the vortex will be located

    [z, y, x] = N.mgrid[0:1, -s:s + 1, -s:s + 1]
    [Z, Y, X] = N.mgrid[-h:h + 1, -s:s + 1, -s:s + 1]
    [W, V, U] = N.zeros_like([Z, Y, X], dtype=float)
    for i in range(len(Z)):
        #vortexCore2(X,Y,C,Rcore,gamma):
        [U_temp, V_temp] = vortexCore2(x[0], y[0], q, Rcore, gamma)

        U[i] = U_temp
        V[i] = V_temp

    L2 = lambda2_3d(X, Y, Z, U, V, W)
    #print L2[3]
    #vF=mlab.quiver3d(Z,Y,X,W,V,U)
    Lamda2 = mlab.contour3d(Z, Y, X, L2, transparent=True)
    mlab.show()
    return
from geometricVortex import geoVortex


##filename of, and format of, VTK file where the velocity field is contained.
velocityfile = 'single vortex.vtu'
    #'single vortex.vtu'
    #'vortex wake.vtu'
vtkformat = 'vtu'


###---read VTK---###
data = VTK_ReadVf3d(velocityfile,vtkformat)
[X,Y,Z,U,V,W] = data
PosF = [X,Y,Z]
VelF = [U,V,W]

print('=> Data read from '+velocityfile)


###---Calcs---###

#Lambda 2 definition of a vortex core.
###lambda2_3d(X,Y,Z,U,V,W):
L2 = lambda2_3d(X,Y,Z,U,V,W)
print('=> Lambda_2 field calculated')

#Geometric and vortex property calculations.
#geoVortex(L2,PosF,VelF):
CircF = geoVortex(L2,PosF,VelF)
print '=> Visualisation ended'