- MEDMEM::SUPPORT source_support(&source_mesh,"on All support");
- MEDMEM::FIELD<double> source_field(&source_support,1);
- double* value=const_cast<double*>(source_field.getValue());
- for (int i=0; i<source_support.getNumberOfElements(MED_EN::MED_ALL_ELEMENTS); i++)
+ MEDCouplingUMesh *source_mesh_mc=source_mesh->getMeshAtLevel(0);
+ MEDCouplingFieldDouble *source_field=MEDCouplingFieldDouble::New(ON_CELLS);
+ source_field->setMesh(source_mesh_mc); source_mesh_mc->decrRef();
+ DataArrayDouble *arr=DataArrayDouble::New(); arr->alloc(source_mesh_mc->getNumberOfCells(),1);
+ source_field->setArray(arr); arr->decrRef();
+ double *value=arr->getPointer();
+ for(int i=0; i<source_mesh_mc->getNumberOfCells(); i++)