3.1.5.3. c3po.multi1D.MEDInterface module
Contain the class MEDInterface.
- class c3po.multi1D.MEDInterface.MEDInterface(multi1DAPI, baseGrid, objectGrids=None)
Bases:
objectMEDInterface links a set of 1D objects with 3D MEDCoupling meshes.
- __init__(multi1DAPI, baseGrid, objectGrids=None)
Build a
MEDInterfaceobject.- Parameters:
multi1DAPI – A
Multi1DAPIobject holding the 1D objects. Should derive fromc3po.multi1D.Multi1DAPI.Multi1DWithObjectsAPIif objectGrids is provided.baseGrid – A
Gridobject positioning the components ofmulti1DAPIin space.objectGrids (list[list[Grid]]) – A list of list of
Gridobjects. The first dimension is associated withbaseGrid:len(objectGrids)should be== baseGrid.getNumberOfCells(). The second dimension is associated with the mesh of the associated component ofmulti1DAPI:len(objectGrids[i])should be== multi1DAPI.getNumberOfCells(j)wherej = baseGrid.getCorrespondence(i). Finally, the grid objects provide the positioning in space of the “internal objects” (seec3po.multi1D.Multi1DAPI.Multi1DWithObjectsAPI) hold by the associated component ofmulti1DAPI, 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 thangetObjectMEDMesh(), 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 theBaseMEDMesh).- 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 onfieldName. No projection is made.- Parameters:
fieldName – Name of the field to set.
field – MEDCoupling field with data to be set.