Creating, Playing with DataArrays, Meshes and Fields with the MEDCoupling library¶
The objective of these exercises is to learn to manipulate MEDCoupling objects in Python.
the first exercise shows how to manipulate DataArrayDouble objects,
the second shows how to manipulate MEDCouplingUMesh objects,
and the third shows how to manipulate MEDCouplingFieldDouble objects.
- Manipulate DataArray objects
- Objective
- Starting the implementation
- Create a DataArrayDouble instance containing 6 tuples
- Initialize an instance of DataArrayDouble
- Duplication and aggregation of DataArrayDouble
- Aggregating DataArrayDouble
- Find identical tuples in d2
- Manipulate DataArrayInt couple representing a pair (Data,IndexData)
- Build old to new array from c and cI
- Translate all tuples at once
- Build an unstructured mesh using d3 (coordinates) and o2n
- Solution
- Playing with unstructured mesh
- Objective
- Implementation start
- Convert coordinate unit from meters to centimeters
- Find the different Z levels in mesh3D and sort in increasing order
- Extract the 6 cells of the second row along Oz
- Extract a sub-part of mesh3D
- Extract the 3 cells in mesh3D whose barycenters are along the line (pt=[250.,150.,0.],v=[0.,0.,1.])
- Duplicate “mesh3DSlice2” and translate it
- Descending connectivity
- Solution
- Playing with fields