Compare commits

...

3 Commits

5 changed files with 44 additions and 36 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
*__pycache__

View File

@ -106,7 +106,8 @@ if [ ! -s ${din}/${fproc} ]; then
fi
if [ ! -s ${din}/${fpart} ]; then
(>&2 echo "[Error] File not found or empty: ${din}/${fpart}")
exit 1
# exit 1
fpart=
fi
# Check if all velocity fields exist and are not empty

View File

@ -0,0 +1 @@
from .ibmppp import *

View File

@ -291,19 +291,19 @@ class ibmppp:
# Also determine file which contains the desired field as well as the
# dataset ID
if key[0]=='u':
filebase = self.__dir_base+'uvwp.'
filebase = self.__dir_base+'/uvwp.'
dset = 1
elif key[0]=='v':
filebase = self.__dir_base+'uvwp.'
filebase = self.__dir_base+'/uvwp.'
dset = 2
elif key[0]=='w':
filebase = self.__dir_base+'uvwp.'
filebase = self.__dir_base+'/uvwp.'
dset = 3
elif key[0]=='p':
filebase = self.__dir_base+'uvwp.'
filebase = self.__dir_base+'/uvwp.'
dset = 4
elif key[0]=='s':
filebase = self.__dir_base+'scal.'
filebase = self.__dir_base+'/scal.'
dset = int(key[1])
if dset!=1:
self.fields[key] = None
@ -348,10 +348,14 @@ class ibmppp:
if kb1!=chunk['kbeg'] or ke1!=chunk['kbeg']+chunk['nzl']-1:
raise ValueError('Loaded chunk does not correspond to processor grid (kbeg={}, nzl={} vs kbeg={},nzl={}'.format(kb1,ke1-kb1+1,chunk['kbeg'],chunk['nzl']))
ngh1 = chunk['ighost']
ibeg = [i + ngh1 for i in [0,0,0]]
iend = [i-ngh1 for i in chunk['data'].shape]
# No need to care about ghost cells here, we communicate them later
self.field[key][ib1-ib+self.__nghx:ie1-ib+self.__nghx+1,
jb1-jb+self.__nghy:je1-jb+self.__nghy+1,
kb1-kb+self.__nghz:ke1-kb+self.__nghz+1] = chunk['data'][ngh1:-ngh1,ngh1:-ngh1,ngh1:-ngh1]
kb1-kb+self.__nghz:ke1-kb+self.__nghz+1] = chunk['data'][ibeg[0]:iend[0],\
ibeg[1]:iend[1],\
ibeg[2]:iend[2]]
# Exchange ghost cells and set boundary conditions
self.exchangeGhostCells(key)
self.imposeBoundaryConditions(key)

1
python/ucf/__init__.py Normal file
View File

@ -0,0 +1 @@
from .ucf import *