+void MEDStructuredMeshMultiLev::initStdFieldOfIntegers(const MEDFileStructuredMesh *m)
+{
+ // ids fields management
+ const DataArrayInt *tmp(0);
+ tmp=m->getFamilyFieldAtLevel(0);
+ if(tmp)
+ {
+ tmp->incrRef();
+ _cell_fam_ids=const_cast<DataArrayInt *>(tmp);
+ }
+ tmp=m->getNumberFieldAtLevel(0);
+ if(tmp)
+ {
+ tmp->incrRef();
+ _cell_num_ids=const_cast<DataArrayInt *>(tmp);
+ }
+ //
+ tmp=0;
+ tmp=m->getFamilyFieldAtLevel(1);
+ if(tmp)
+ {
+ tmp->incrRef();
+ _node_fam_ids=const_cast<DataArrayInt *>(tmp);
+ }
+ tmp=m->getNumberFieldAtLevel(1);
+ if(tmp)
+ {
+ tmp->incrRef();
+ _node_num_ids=const_cast<DataArrayInt *>(tmp);
+ }
+ // faces (if any)
+ tmp=m->getFamilyFieldAtLevel(-1);
+ if(tmp)
+ {
+ tmp->incrRef();
+ _face_fam_ids=const_cast<DataArrayInt *>(tmp);
+ }
+ tmp=m->getNumberFieldAtLevel(-1);
+ if(tmp)
+ {
+ tmp->incrRef();
+ _face_num_ids=const_cast<DataArrayInt *>(tmp);
+ }
+}
+
+void MEDStructuredMeshMultiLev::moveFaceToCell() const
+{
+ const_cast<MEDStructuredMeshMultiLev *>(this)->_cell_fam_ids=_face_fam_ids; const_cast<MEDStructuredMeshMultiLev *>(this)->_face_fam_ids=0;
+ const_cast<MEDStructuredMeshMultiLev *>(this)->_cell_num_ids=_face_num_ids; const_cast<MEDStructuredMeshMultiLev *>(this)->_face_num_ids=0;
+}
+
+bool MEDStructuredMeshMultiLev::prepareForImplicitUnstructuredMeshCase(MEDMeshMultiLev *&ret) const
+{
+ ret=0;
+ if(_geo_types.empty())
+ return false;
+ if(_geo_types.size()!=1)
+ throw INTERP_KERNEL::Exception("MEDStructuredMeshMultiLev::prepareForImplicitUnstructuredMeshCase only one geo types supported at most supported for the moment !");
+ INTERP_KERNEL::NormalizedCellType gt(MEDCouplingStructuredMesh::GetGeoTypeGivenMeshDimension(_mesh->getMeshDimension()));
+ if(_geo_types[0]==gt)
+ return false;
+ MEDCoupling1GTUMesh *facesIfPresent((static_cast<const MEDFileStructuredMesh *>(_mesh))->getImplicitFaceMesh());
+ if(!facesIfPresent)
+ return false;
+ const DataArrayInt *pfl(0),*nr(_node_reduction);
+ if(!_pfls.empty())
+ pfl=_pfls[0];
+ MCAuto<MEDCoupling1GTUMesh> facesIfPresent2(facesIfPresent); facesIfPresent->incrRef();
+ moveFaceToCell();
+ MCAuto<MEDUMeshMultiLev> ret2(new MEDUMeshMultiLev(*this,facesIfPresent2));
+ if(pfl)
+ ret2->setCellReduction(pfl);
+ if(nr)
+ throw INTERP_KERNEL::Exception("MEDStructuredMeshMultiLev::prepareForImplicitUnstructuredMeshCase : case is not treated yet for node reduction on implicit unstructured mesh.");
+ ret=ret2.retn();
+ return true;
+}
+
+void MEDStructuredMeshMultiLev::dealWithImplicitUnstructuredMesh(const MEDFileMesh *m)
+{
+ const DataArrayInt *tmp(0);
+ tmp=m->getFamilyFieldAtLevel(-1);
+ if(tmp)
+ {
+ tmp->incrRef();
+ _cell_fam_ids=const_cast<DataArrayInt *>(tmp);
+ }
+ tmp=m->getNumberFieldAtLevel(-1);
+ if(tmp)
+ {
+ tmp->incrRef();
+ _cell_num_ids=const_cast<DataArrayInt *>(tmp);
+ }
+}
+