3.1.5.3. c3po.multi1D.MEDInterface module

Inheritance diagram of c3po.multi1D.MEDInterface

Contain the class MEDInterface.

class c3po.multi1D.MEDInterface.MEDInterface(multi1DAPI, baseGrid, objectGrids=None)

Bases: object

MEDInterface links a set of 1D objects with 3D MEDCoupling meshes.

__init__(multi1DAPI, baseGrid, objectGrids=None)

Build a MEDInterface object.

Parameters:
  • multi1DAPI – A Multi1DAPI object holding the 1D objects. Should derive from c3po.multi1D.Multi1DAPI.Multi1DWithObjectsAPI if objectGrids is provided.

  • baseGrid – A Grid object positioning the components of multi1DAPI in space.

  • objectGrids (list[list[Grid]]) – A list of list of Grid objects. The first dimension is associated with baseGrid : len(objectGrids) should be == baseGrid.getNumberOfCells(). The second dimension is associated with the mesh of the associated component of multi1DAPI : len(objectGrids[i]) should be == multi1DAPI.getNumberOfCells(j) where j = baseGrid.getCorrespondence(i). Finally, the grid objects provide the positioning in space of the “internal objects” (see c3po.multi1D.Multi1DAPI.Multi1DWithObjectsAPI) hold by the associated component of multi1DAPI, at the given position.

getBaseMEDMesh()

Return the 3D MEDCouling first level mesh (whose 2D base is baseGrid).

Return type:

The 3D MEDCouling first level mesh.

getField(fieldName)

Return the 3D MEDCoupling field associated with fieldName.

Note

The field underlying mesh is either the same than getBaseMEDMesh(), or the same than getObjectMEDMesh(), depending on fieldName.

Parameters:

fieldName – name of the required field.

Return type:

The required 3D MEDCoupling field.

getObjectMEDMesh()

Return the 3D MEDCouling second level mesh (built using objectGrids[i][j] at each cell of the BaseMEDMesh).

Return type:

The 3D MEDCouling second level mesh (and None if not defined).

getPartOfObjectMEDMesh(objectNames)

Return the part of the 3D MEDCouling second level mesh associated with the provided object names.

Parameters:

objectNames (list) – List of object names for which the mesh is required.

Return type:

The part of the 3D MEDCouling second level mesh, associated with the provided object names.

setField(fieldName, field)

Set a 3D MEDCoupling field.

Note

The field underlying mesh must be the base one (getBaseMEDMesh()) or the object one (getObjectMEDMesh()), depending on fieldName. No projection is made.

Parameters:
  • fieldName – Name of the field to set.

  • field – MEDCoupling field with data to be set.