+std::vector< std::pair<mcIdType,mcIdType> > MEDCouplingCartesianAMRMeshSub::positionRelativeToGodFather(std::vector<mcIdType>& st) const
+{
+ st=_father->getFactors();
+ std::size_t dim(st.size());
+ std::vector<mcIdType> prev(st);
+ mcIdType id(_father->getPatchIdFromChildMesh(this));
+ const MEDCouplingCartesianAMRPatch *p(_father->getPatch(id));
+ std::vector< std::pair<mcIdType,mcIdType> > ret(p->getBLTRRange());
+ std::vector<mcIdType> delta(MEDCouplingStructuredMesh::GetDimensionsFromCompactFrmt(ret)),start(dim);
+ std::transform(delta.begin(),delta.end(),prev.begin(),delta.begin(),std::multiplies<mcIdType>());
+ for(std::size_t i=0;i<dim;i++)
+ start[i]=ret[i].first;
+ std::transform(start.begin(),start.end(),prev.begin(),start.begin(),std::multiplies<mcIdType>());
+ const MEDCouplingCartesianAMRMeshGen *it(_father);
+ while(!dynamic_cast<const MEDCouplingCartesianAMRMesh *>(it))
+ {
+ const MEDCouplingCartesianAMRMeshSub *itc(static_cast<const MEDCouplingCartesianAMRMeshSub *>(it));
+ mcIdType id2(itc->_father->getPatchIdFromChildMesh(itc));
+ const MEDCouplingCartesianAMRPatch *p2(itc->_father->getPatch(id2));
+ const std::vector< std::pair<mcIdType,mcIdType> >& start2(p2->getBLTRRange());
+ std::vector<mcIdType> tmp(dim);
+ for(std::size_t i=0;i<dim;i++)
+ tmp[i]=start2[i].first;
+ //
+ prev=itc->_father->getFactors();
+ std::transform(st.begin(),st.end(),prev.begin(),st.begin(),std::multiplies<mcIdType>());
+ std::transform(st.begin(),st.end(),tmp.begin(),tmp.begin(),std::multiplies<mcIdType>());
+ std::transform(start.begin(),start.end(),tmp.begin(),start.begin(),std::plus<mcIdType>());
+ it=itc->_father;
+ }
+ for(std::size_t i=0;i<dim;i++)
+ {
+ ret[i].first=start[i];
+ ret[i].second=start[i]+delta[i];
+ }
+ return ret;
+}
+
+mcIdType MEDCouplingCartesianAMRMeshSub::getAbsoluteLevelRelativeTo(const MEDCouplingCartesianAMRMeshGen *ref) const
+{
+ if(this==ref)
+ return 0;
+ if(_father==0)
+ throw INTERP_KERNEL::Exception("MEDCouplingCartesianAMRMeshSub::getAbsoluteLevelRelativeTo : ref is not in the progeny of this !");
+ else
+ return _father->getAbsoluteLevelRelativeTo(ref)+1;
+}
+
+MEDCouplingCartesianAMRMeshSub::MEDCouplingCartesianAMRMeshSub(const MEDCouplingCartesianAMRMeshSub& other, MEDCouplingCartesianAMRMeshGen *father):MEDCouplingCartesianAMRMeshGen(other),_father(father)
+{
+}
+
+MEDCouplingCartesianAMRMeshSub *MEDCouplingCartesianAMRMeshSub::deepCopy(MEDCouplingCartesianAMRMeshGen *fath) const
+{
+ return new MEDCouplingCartesianAMRMeshSub(*this,fath);
+}
+
+/*!
+ * \sa getPositionRelativeTo
+ */
+void MEDCouplingCartesianAMRMeshSub::getPositionRelativeToInternal(const MEDCouplingCartesianAMRMeshGen *ref, std::vector<mcIdType>& ret) const
+{
+ if(this==ref)
+ return ;
+ if(!_father)
+ throw INTERP_KERNEL::Exception("MEDCouplingCartesianAMRMeshSub::getPositionRelativeToInternal : ref is not in the progeny of this !");
+ mcIdType myId(_father->getPatchIdFromChildMesh(this));
+ ret.push_back(myId);
+ _father->getPositionRelativeToInternal(ref,ret);
+}
+
+MEDCouplingCartesianAMRMesh *MEDCouplingCartesianAMRMesh::New(const std::string& meshName, int spaceDim, const mcIdType *nodeStrctStart, const mcIdType *nodeStrctStop,