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

Functions

def expectValueR (dataName, i, Val)
 
def energy_total (dataName, i)
 

Variables

 CPUs = os.environ['SLURM_JOB_CPUS_PER_NODE']
 
 prec
 
 c = ConfigParser.ConfigParser()
 
 xDim = int(c.getfloat('Params','xDim'))
 
 yDim = int(c.getfloat('Params','yDim'))
 
 gndMaxVal = int(c.getfloat('Params','gsteps'))
 
 evMaxVal = int(c.getfloat('Params','esteps'))
 
 incr = int(c.getfloat('Params','print_out'))
 
tuple sep = (c.getfloat('Params','dx'))
 
tuple dx = (c.getfloat('Params','dx'))
 
tuple dy = (c.getfloat('Params','dx'))
 
tuple dt = (c.getfloat('Params','dt'))
 
tuple xMax = (c.getfloat('Params','xMax'))
 
tuple yMax = (c.getfloat('Params','yMax'))
 
int num_vort = 0
 
 data = numpy.ndarray(shape=(xDim,yDim))
 
 K = np.reshape(np.array(open('K_0').read().splitlines(),dtype='f8'),(xDim,yDim))
 
 V = np.reshape(np.array(open('V_0').read().splitlines(),dtype='f8'),(xDim,yDim))
 
 X = np.array(open('x_0').read().splitlines(),dtype='f8')
 
 Y = np.array(open('y_0').read().splitlines(),dtype='f8')
 
 XM
 
 YM
 
tuple R = (XM**2+YM**2)
 
int macheps = 7./3. - 4./3. - 1.
 
tuple Q = (XM**2-YM**2)
 

Detailed Description

en.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

◆ energy_total()

def en.energy_total (   dataName,
  i 
)

Definition at line 84 of file en.py.

References expectValueR().

84 def energy_total(dataName,i):
85  real=open(dataName + '_' + str(i)).read().splitlines()
86  img=open(dataName + 'i_' + str(i)).read().splitlines()
87  a_r = np.array(real,dtype='f8') #64-bit double
88  a_i = np.array(img,dtype='f8') #64-bit double
89  wfcr = np.reshape(a_r[:] + 1j*a_i[:],(xDim,yDim))
90  wfcp = np.array(np.fft.fft2(wfcr))
91  wfcr_c = np.conj(wfcr)
92 
93  E1 = np.fft.ifft2(K*wfcp)
94  E2 = V*wfcr
95 
96  E_k = np.trapz(np.trapz(wfcr_c*E1))*dx*dy
97  E_vi = np.trapz(np.trapz(wfcr_c*E2))*dx*dy
98  return np.real(E_k + E_vi)
99 
100 #for ii in range(0,gndMaxVal,incr):
101 # print "E(t={} s)={}".format(ii*dt,energy_total('wfc_0_const',ii))
102 
def energy_total(dataName, i)
Definition: en.py:84
Here is the call graph for this function:

◆ expectValueR()

def en.expectValueR (   dataName,
  i,
  Val 
)

Definition at line 76 of file en.py.

Referenced by energy_total().

76 def expectValueR(dataName,i,Val):
77  real=open(dataName + '_' + str(i)).read().splitlines()
78  img=open(dataName + 'i_' + str(i)).read().splitlines()
79  a_r = np.array(real,dtype='f8') #64-bit double
80  a_i = np.array(img,dtype='f8') #64-bit double
81  wfcr = np.reshape(a_r[:] + 1j*a_i[:],(xDim,yDim))
82  return np.real(np.trapz(np.trapz(np.conj(wfcr)*Val*wfcr))*dx*dy)
83 
def expectValueR(dataName, i, Val)
Definition: en.py:76
Here is the caller graph for this function:

Variable Documentation

◆ c

en.c = ConfigParser.ConfigParser()

Definition at line 48 of file en.py.

◆ CPUs

en.CPUs = os.environ['SLURM_JOB_CPUS_PER_NODE']

Definition at line 34 of file en.py.

◆ data

en.data = numpy.ndarray(shape=(xDim,yDim))

Definition at line 66 of file en.py.

◆ dt

tuple en.dt = (c.getfloat('Params','dt'))

Definition at line 61 of file en.py.

◆ dx

tuple en.dx = (c.getfloat('Params','dx'))

Definition at line 59 of file en.py.

◆ dy

tuple en.dy = (c.getfloat('Params','dx'))

Definition at line 60 of file en.py.

◆ evMaxVal

en.evMaxVal = int(c.getfloat('Params','esteps'))

Definition at line 56 of file en.py.

◆ gndMaxVal

en.gndMaxVal = int(c.getfloat('Params','gsteps'))

Definition at line 55 of file en.py.

◆ incr

en.incr = int(c.getfloat('Params','print_out'))

Definition at line 57 of file en.py.

◆ K

en.K = np.reshape(np.array(open('K_0').read().splitlines(),dtype='f8'),(xDim,yDim))

Definition at line 67 of file en.py.

◆ macheps

int en.macheps = 7./3. - 4./3. - 1.

Definition at line 73 of file en.py.

◆ num_vort

int en.num_vort = 0

Definition at line 64 of file en.py.

◆ prec

en.prec

Definition at line 47 of file en.py.

◆ Q

tuple en.Q = (XM**2-YM**2)

Definition at line 74 of file en.py.

◆ R

tuple en.R = (XM**2+YM**2)

Definition at line 72 of file en.py.

◆ sep

tuple en.sep = (c.getfloat('Params','dx'))

Definition at line 58 of file en.py.

◆ V

en.V = np.reshape(np.array(open('V_0').read().splitlines(),dtype='f8'),(xDim,yDim))

Definition at line 68 of file en.py.

◆ X

en.X = np.array(open('x_0').read().splitlines(),dtype='f8')

Definition at line 69 of file en.py.

◆ xDim

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

Definition at line 53 of file en.py.

◆ XM

en.XM

Definition at line 71 of file en.py.

◆ xMax

tuple en.xMax = (c.getfloat('Params','xMax'))

Definition at line 62 of file en.py.

◆ Y

en.Y = np.array(open('y_0').read().splitlines(),dtype='f8')

Definition at line 70 of file en.py.

◆ yDim

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

Definition at line 54 of file en.py.

◆ YM

en.YM

Definition at line 71 of file en.py.

◆ yMax

tuple en.yMax = (c.getfloat('Params','yMax'))

Definition at line 63 of file en.py.