3.1.5.4. c3po.multi1D.Multi1DAPI module
Contain the classes Multi1DAPI and Multi1DWithObjectsAPI.
- class c3po.multi1D.Multi1DAPI.Multi1DAPI
Bases:
ABCMulti1DAPIis an abstract class handling a set of 1D object.- abstractmethod getCellSizes(index)
Return the list of the sizes of the cells of the 1D object with the required index.
Note
The length of the returned list should be equal to
getNumberOfCells().- Parameters:
index – Index of the queried 1D object.
- Returns:
List with the sizes of the cells of the required 1D object.
- Return type:
- abstractmethod getNature(fieldName)
Return the nature of the field
fieldName, which mush be available forgetValues(), using MEDCoupling enum.- Parameters:
fieldName – Name of the field.
- Return type:
Nature of the field.
- abstractmethod getNumberOfCells(index)
Return the number of cells of the 1D object with the required index.
- Parameters:
index – Index of the queried 1D object .
- Return type:
The number of cells in the required 1D object.
- abstractmethod getSize()
Return the number of 1D objects handled by self.
- Return type:
The number of 1D objects.
- abstractmethod getValues(index, fieldName)
Return the values of the field
fieldNamefor the 1D object with the required index.Note
The length of the returned list should be equal to
getNumberOfCells().- Parameters:
index – Index of the queried 1D object.
fieldName – Name of the field.
- Returns:
List of values.
- Return type:
- abstractmethod setValues(index, fieldName, values)
Set the values of the field
fieldNameto the 1D object with the required index.Note
The length of
valuesshould be equal togetNumberOfCells().- Parameters:
index – Index of the queried 1D object.
fieldName – Name of the field.
values (list) – List of values to set.
- class c3po.multi1D.Multi1DAPI.Multi1DWithObjectsAPI
Bases:
Multi1DAPIMulti1DWithObjectsAPIis an abstract class that extendsMulti1DAPIwith the possibility for each 1D object to hold internal objects.These internal objects are named. They can differ from one 1D object to another. Values may be written and read from (or on) these internal objects. They may not be all involved in every set or get.
- abstractmethod getObjectNames(index)
Return the list of list of the names of the internal objects hold by the 1D object with the required index at each cell.
Note
The length of the returned list should be equal to
getNumberOfCells().- Parameters:
index – Index of the queried 1D object.
- Returns:
List (for each cell) of list of internal object names.
- Return type:
- abstractmethod getObjectNamesInField(fieldName)
Return the list of the names of the internal objects that are involved in get / set methods for the field
fieldName.Note
The names of all involved internal object should be listed, even if they appear in only one cell of one 1D object.
The ordering of the names must be coherent with
getObjectValues()andsetObjectValues()behavior.Note
This method returns an empty list if the field is known but does not involve any internal object. It means that the field should be handled using Multi1DAPI methods. If the field is totally unknown, an exception is raised.
- Parameters:
fieldName – Name of the field.
- Returns:
List of internal object names involved in the required field.
- Return type:
- abstractmethod getObjectValues(index, fieldName)
Return the list of list of the values for the field
fieldNamefor the 1D object with the required index (for each object and for each cell).Note
The length of the returned list should be equal to the lenght of the list returned by
getObjectNamesInField(fieldName).For every
i, the length of thei-th components of the return list should be equal togetNumberOfCells(index).- Parameters:
index – Index of the queried 1D object.
fieldName – Name of the field.
- Returns:
List of list of values.
- Return type:
- abstractmethod setObjectValues(index, fieldName, values)
Set the values for the field
fieldNameto the 1D object with the required index (for each object and for each cell).Note
The length of values should be equal to the lenght of the list returned by
getObjectNamesInField(fieldName).For every
i, the length ofvalues[i]should be equal togetNumberOfCells(index).- Parameters:
index – Index of the queried 1D object.
fieldName – Name of the field.
values (list) – List of list of values to set.