Skip to content

Commit 32c5eb3

Browse files
committed
Merge branch 'release/v2.2.5'
2 parents 8c3e915 + 74298bd commit 32c5eb3

11 files changed

+21
-14
lines changed

Bassetti_Erskine.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# This file is part of the code:
99
#
1010
#
11-
# PyPIC Version 2.2.4
11+
# PyPIC Version 2.2.5
1212
#
1313
#
1414
# Author and contact: Giovanni IADAROLA

FFT_OpenBoundary.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# This file is part of the code:
99
#
1010
#
11-
# PyPIC Version 2.2.4
11+
# PyPIC Version 2.2.5
1212
#
1313
#
1414
# Author and contact: Giovanni IADAROLA

FFT_OpenBoundary_SquareGrid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# This file is part of the code:
99
#
1010
#
11-
# PyPIC Version 2.2.4
11+
# PyPIC Version 2.2.5
1212
#
1313
#
1414
# Author and contact: Giovanni IADAROLA

FFT_PEC_Boundary_SquareGrid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# This file is part of the code:
99
#
1010
#
11-
# PyPIC Version 2.2.4
11+
# PyPIC Version 2.2.5
1212
#
1313
#
1414
# Author and contact: Giovanni IADAROLA

FiniteDifferences_ShortleyWeller_SquareGrid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# This file is part of the code:
99
#
1010
#
11-
# PyPIC Version 2.2.4
11+
# PyPIC Version 2.2.5
1212
#
1313
#
1414
# Author and contact: Giovanni IADAROLA

FiniteDifferences_ShortleyWeller_SquareGrid_extrapolation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# This file is part of the code:
99
#
1010
#
11-
# PyPIC Version 2.2.4
11+
# PyPIC Version 2.2.5
1212
#
1313
#
1414
# Author and contact: Giovanni IADAROLA

FiniteDifferences_Staircase_SquareGrid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# This file is part of the code:
99
#
1010
#
11-
# PyPIC Version 2.2.4
11+
# PyPIC Version 2.2.5
1212
#
1313
#
1414
# Author and contact: Giovanni IADAROLA

GPU/pypic.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,8 +395,14 @@ def particles_to_mesh(self, *mp_coords, **kwargs):
395395
Return the charge distribution on the mesh (which is
396396
mesh_charges = rho*volume).
397397
'''
398-
charge = kwargs.get("charge", e)
399398
dtype = kwargs.get("dtype", np.float32)
399+
charge = kwargs.get("charge", e)
400+
try:
401+
charge = charge.get()
402+
except AttributeError:
403+
pass
404+
# ensure returning a dtype np.float64 in particles_to_mesh:
405+
charge = float(charge)
400406

401407
n_macroparticles = len(mp_coords[0])
402408
self.kernel_call_config['p2m']['grid'] = (
@@ -423,7 +429,7 @@ def particles_to_mesh(self, *mp_coords, **kwargs):
423429
self._p2m_inclmeshing_32atomics_kernel.prepared_call(
424430
grid, block, *args)
425431
elif dtype == np.float64:
426-
self._p2m_inclmeshing_32atomics_kernel.prepared_call(
432+
self._p2m_inclmeshing_64atomics_kernel.prepared_call(
427433
grid, block, *args)
428434
else:
429435
raise ValueError("PyPIC: particles_to_mesh() got unknown dtype "
@@ -453,7 +459,8 @@ def particles_to_mesh(self, *mp_coords, **kwargs):
453459
"argument, expected either np.float32 or "
454460
"np.float64!")
455461
self._context.synchronize()
456-
mesh_charges = mesh_count*charge
462+
mesh_charges = mesh_count * charge
463+
# because charge is double precision, mesh_charges will be as well!
457464
return mesh_charges
458465

459466
def sorted_particles_to_mesh(self, *mp_coords, **kwargs):

PyPIC_Scatter_Gather.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# This file is part of the code:
99
#
1010
#
11-
# PyPIC Version 2.2.4
11+
# PyPIC Version 2.2.5
1212
#
1313
#
1414
# Author and contact: Giovanni IADAROLA
@@ -66,7 +66,7 @@ class PyPIC_Scatter_Gather(object):
6666
def __init__(self, x_aper=None, y_aper=None, dx=None, dy=None, xg=None, yg=None,
6767
x_min=None, x_max=None, y_min=None, y_max=None, *args, **kwargs):
6868

69-
print 'PyPIC Version 2.2.4'
69+
print 'PyPIC Version 2.2.5'
7070

7171
if xg!=None and yg!=None:
7272
assert(x_aper==None and y_aper==None and dx==None and dy==None)

change_version_number.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
with open(filename) as fid:
1010
content=fid.read()
1111
if '[email protected]' in content:
12-
content=content.replace('PyPIC Version 2.2.4', 'PyPIC Version 2.2.4')
12+
content=content.replace('PyPIC Version 2.2.5', 'PyPIC Version 2.2.5')
1313
with open(filename,'w') as fid:
1414
fid.write(content)
1515

0 commit comments

Comments
 (0)