+ int meshDim(getMeshDimension());
+ std::vector<mcIdType> ret(meshDim);
+ std::vector<mcIdType> struc(getCellGridStructure());
+ mcIdType nbCells(std::accumulate(struc.begin(),struc.end(),1,std::multiplies<mcIdType>()));
+ if(cellId<0 || cellId>=nbCells)
+ {
+ std::ostringstream oss; oss << "MEDCouplingStructuredMesh::getLocationFromCellId : Input cell id (" << cellId << ") is invalid ! Should be in [0," << nbCells << ") !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ std::vector<mcIdType> spt(GetSplitVectFromStruct(struc));
+ GetPosFromId(cellId,meshDim,&spt[0],&ret[0]);
+ return ret;
+}
+
+/*!
+ * This method returns for a node which id is \a nodeId the location (locX,locY,locZ) of this node in \a this.
+ *
+ * \param [in] nodeId ID of the node
+ * \return - A vector of size this->getSpaceDimension()
+ * \throw if \a cellId not in [ 0, this->getNumberOfNodes() )
+ */
+std::vector<mcIdType> MEDCouplingStructuredMesh::getLocationFromNodeId(mcIdType nodeId) const
+{
+ int spaceDim(getSpaceDimension());
+ std::vector<mcIdType> ret(spaceDim);
+ std::vector<mcIdType> struc(getNodeGridStructure());
+ mcIdType nbNodes(std::accumulate(struc.begin(),struc.end(),1,std::multiplies<mcIdType>()));
+ if(nodeId<0 || nodeId>=nbNodes)
+ {
+ std::ostringstream oss; oss << "MEDCouplingStructuredMesh::getLocationFromNodeId : Input node id (" << nodeId << ") is invalid ! Should be in [0," << nbNodes << ") !";
+ throw INTERP_KERNEL::Exception(oss.str().c_str());
+ }
+ std::vector<mcIdType> spt(GetSplitVectFromStruct(struc));
+ GetPosFromId(nodeId,spaceDim,&spt[0],&ret[0]);
+ return ret;
+}
+
+void MEDCouplingStructuredMesh::GetPosFromId(mcIdType eltId, int meshDim, const mcIdType *split, mcIdType *res)
+{
+ mcIdType work(eltId);