ppmd.data.scalar_array module

class ppmd.data.scalar_array.ScalarArray(initial_value=None, name=None, ncomp=1, dtype=<class 'ctypes.c_double'>)

Bases: ppmd.host.Array

Class to hold an array of scalar values.

Parameters
  • initial_value – Value to initialise array with, default 0.0.

  • name (str) – Collective name of stored vars eg positions.

  • ncomp (int) – Number of components.

  • dtype – Data type. Should be a ctypes C data type.

property ctypes_value
Returns

first value in correct type.

halo_aware

How to handle writes to this dat in a reduction sense. In general for a reduction in a pair loop a write will occur once per pair In the case where one of the pair is in a halo, the write will occur if the ithparticle is not in the halo?

property max
Returns

The maximum value in the array.

property mean
Returns

The mean value in the array.

property min
Returns

The minimum in the array.

name

Name of ScalarArray instance.

resize(new_length)

Increase the size of the array. :param int new_length: New array length.

scale(val)

Scale data array by given value.

Parameters

val – Coefficient to scale all elements by.

property sum
Returns

The array sum.