3.1.17. c3po.LocalDataManager module

Inheritance diagram of c3po.LocalDataManager

Contain the class LocalDataManager.

class c3po.LocalDataManager.LocalDataManager

Bases: DataManager, DataAccessor

LocalDataManager is the implementation of DataManager for local data.

It also implements DataAccessor.

Data can be double, int, string, fields of double of fields of int. Only double and fields of double are affected by the methods herited from DataManager. Other data are just (shallow) copied in new objects created by these methods.

__add__(other)

Return self + other.

Use "+" to call it. For example a = b + c.

Parameters:

other (LocalDataManager) – A LocalDataManager with the same list of data then self.

Returns:

A new (consistent with self) LocalDataManager where the data are added.

Return type:

LocalDataManager

Raises:

Exception – If self and other are not consistent.

__iadd__(other)

Add other in self (in place addition).

Use "+=" to call it. For example a += b.

Parameters:

other (LocalDataManager) – A LocalDataManager with the same list of data then self.

Returns:

self.

Return type:

LocalDataManager

Raises:

Exception – If self and other are not consistent.

__imul__(scalar)

Multiply self by scalar (in place multiplication).

Use "*=" to call it. For example a *= b.

Parameters:

scalar – A scalar value.

Returns:

self.

Return type:

LocalDataManager

__init__()

Default constructor

__isub__(other)

Substract other to self (in place subtraction).

Use "-=" to call it. For example a -= b.

Parameters:

other (LocalDataManager) – A LocalDataManager with the same list of data then self.

Returns:

self.

Return type:

LocalDataManager

Raises:

Exception – If self and other are not consistent.

__mul__(scalar)

Return scalar * self.

Use "*" to call it. For example a = b * c. The scalar first.

Parameters:

scalar – A scalar value.

Returns:

A new (consistent with self) LocalDataManager where the data are multiplied by scalar.

Return type:

LocalDataManager

__sub__(other)

Return self - other.

Use "-" to call it. For example a = b - c.

Parameters:

other (LocalDataManager) – A LocalDataManager with the same list of data then self.

Returns:

A new (consistent with self) LocalDataManager where the data are substracted.

Return type:

LocalDataManager

Raises:

Exception – If self and other are not consistent.

checkBeforeOperator(other)

INTERNAL Make basic checks before the call of an operator: same data names between self and other.

clone()

Return a clone of self.

Returns:

A clone of self. Data are copied.

Return type:

LocalDataManager

cloneEmpty()

Return a clone of self without copying the data.

Returns:

An empty clone of self.

Return type:

LocalDataManager

copy(other)

Copy data of other in self.

Parameters:

other – A LocalDataManager with the same list of data than self.

Raises:

Exception – If self and other are not consistent.

dot(other)

Return the scalar product of self with other.

Parameters:

other (LocalDataManager) – A LocalDataManager with the same list of data then self.

Return type:

The scalar product of self with other.

Raises:

Exception – If self and other are not consistent.

getFieldType(name)

Return the type of a previously stored field.

getInputMEDDoubleFieldTemplate(name)

Return the MED field previously stored as a MEDDoubleFieldTemplate under the name name. If there is not, returns 0.

Parameters:

name – The name of the field to return.

Return type:

The MED field of name name previously stored, or 0.

getOutputDoubleValue(name)

Return the scalar of name name previously stored.

Parameters:

name – The name of the value to return.

Return type:

The value of name name previously stored.

Raises:

Exception – If there is no stored name Double value.

getOutputIntValue(name)

Similar to getOutputDoubleValue() but for Int.

getOutputMEDDoubleField(name)

Return the MED field of name name previously stored.

Parameters:

name – The name of the field to return.

Return type:

The MED field of name name previously stored.

Raises:

Exception – If there is no stored name Double field.

getOutputMEDIntField(name)

Similar to getOutputMEDDoubleField() but for MEDIntField.

getOutputStringValue(name)

Similar to getOutputDoubleValue() but for String.

getValueType(name)

Return the type of a previously stored field.

imuladd(scalar, other)

Add in self scalar * other (in place operation).

In order to do so, other *= scalar and other *= 1./scalar are done.

For example a.imuladd(b, c).

Parameters:
Returns:

self.

Return type:

LocalDataManager

Raises:

Exception – If self and other are not consistent.

norm2()

Return the norm 2.

Return type:

sqrt(sum_i(val[i] * val[i])) where val[i] stands for each scalar and each component of the MED fields.

normMax()

Return the infinite norm.

Return type:

The max of the absolute values of the scalars and of the infinite norms of the MED fields.

setInputDoubleValue(name, value)

Store the scalar value under the name name.

Parameters:
  • name – The name given to the scalar to store.

  • value – A scalar value to store.

setInputIntValue(name, value)

Similar to setInputDoubleValue() but for Int.

setInputMEDDoubleField(name, field)

Store the MED field field under the name name.

Parameters:
  • name – The name given to the field to store.

  • field – A field to store.

setInputMEDDoubleFieldTemplate(name, field)

Store the MED field field as a MEDFieldTemplate under the name name.

Note

These fields are not be part of data, and will therefore not be taken into account in data manipulations (operators, norms etc.).

Parameters:
  • name – The name given to the field to store.

  • field – A field to store.

setInputMEDIntField(name, field)

Similar to setInputMEDDoubleField() but for MEDIntField.

setInputStringValue(name, value)

Similar to setInputDoubleValue() but for String.