GPUE  v1.0
GPU Gross-Pitaevskii Equation numerical solver for Bose-Einstein condensates
stats Namespace Reference

Functions

def lsFit (start, end, incr)
 

Variables

 c = ConfigParser.ConfigParser()
 
 incr = int(c.getfloat('Params','printSteps'))
 
 xDim = int(c.getfloat('Params','xDim'))
 
 yDim = int(c.getfloat('Params','yDim'))
 
 st = int(sys.argv[1])
 
 en = int(sys.argv[2])
 

Detailed Description

stats.py - GPUE: Split Operator based GPU solver for Nonlinear 
Schrodinger Equation, Copyright (C) 2011-2015, Lee J. O'Riordan 
<loriordan@gmail.com>, Tadhg Morgan, Neil Crowley. All rights reserved.

Redistribution and use in source and binary forms, with or without 
modification, are permitted provided that the following conditions are 
met:

1. Redistributions of source code must retain the above copyright 
notice, this list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright 
notice, this list of conditions and the following disclaimer in the 
documentation and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its 
contributors may be used to endorse or promote products derived from 
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Function Documentation

◆ lsFit()

def stats.lsFit (   start,
  end,
  incr 
)

Definition at line 60 of file stats.py.

60 def lsFit(start,end,incr):
61  warnings.warn("deprecated", DeprecationWarning)
62  L = np.matrix([
63  [0,0,1],
64  [1,0,1],
65  [0,1,1],
66  [1,1,1]
67  ])
68 
69  LSQ = np.linalg.inv(np.transpose(L)*L)*np.transpose(L)
70  for i in range(start,end,incr):
71  v_arr=genfromtxt('vort_arr_' + str(i),delimiter=',' )
72  real=open('wfc_ev_' + str(i)).read().splitlines()
73  img=open('wfc_evi_' + str(i)).read().splitlines()
74  a_r = np.asanyarray(real,dtype='f8') #64-bit double
75  a_i = np.asanyarray(img,dtype='f8') #64-bit double
76  a = a_r[:] + 1j*a_i[:]
77  wfc = (np.reshape(a,(xDim,yDim)))
78 
79  indX = [row[0] for row in v_arr]
80  indY = [row[2] for row in v_arr]
81  sign = [row[4] for row in v_arr]
82  data=[]
83  for ii in range(0,len(indX)):
84  p=np.matrix([[0],[0],[0],[0]],dtype=np.complex)
85  p[0]=(wfc[indX[ii], indY[ii]])
86  p[1]=(wfc[indX[ii]+1, indY[ii]])
87  p[2]=(wfc[indX[ii], indY[ii]+1])
88  p[3]=(wfc[indX[ii]+1, indY[ii]+1])
89  rc = LSQ * np.real(p)
90  ic = LSQ * np.imag(p)
91 
92  A=np.squeeze([row[0:2] for row in [rc,ic]])
93  B=-np.squeeze([row[2] for row in [rc,ic]])
94  r=np.linalg.lstsq(A,B)[0]
95  data.append([indX[ii]+r[0],indY[ii]+r[1],sign[ii]])
96 
97 
98  np.savetxt('vort_lsq_'+str(i)+'.csv',data,delimiter=',')
99 
def lsFit(start, end, incr)
Definition: stats.py:60

Variable Documentation

◆ c

stats.c = ConfigParser.ConfigParser()

Definition at line 46 of file stats.py.

◆ en

stats.en = int(sys.argv[2])

Definition at line 104 of file stats.py.

◆ incr

int stats.incr = int(c.getfloat('Params','printSteps'))

Definition at line 50 of file stats.py.

◆ st

stats.st = int(sys.argv[1])

Definition at line 103 of file stats.py.

◆ xDim

int stats.xDim = int(c.getfloat('Params','xDim'))

Definition at line 51 of file stats.py.

◆ yDim

int stats.yDim = int(c.getfloat('Params','yDim'))

Definition at line 52 of file stats.py.