X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingNormalizedUnstructuredMesh.txx;h=9c5aab27c3f28208b3aefce0f652577defcedbdf;hb=b607ffc713080a567fb90595118069ac18181e99;hp=111b6186cb3776cf513ac447c6d1a7bef740cd51;hpb=46ddce3caf8076fa140934bb3ce88c5d8040efb9;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingNormalizedUnstructuredMesh.txx b/src/MEDCoupling/MEDCouplingNormalizedUnstructuredMesh.txx index 111b6186c..9c5aab27c 100644 --- a/src/MEDCoupling/MEDCouplingNormalizedUnstructuredMesh.txx +++ b/src/MEDCoupling/MEDCouplingNormalizedUnstructuredMesh.txx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D +// Copyright (C) 2007-2020 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -48,11 +48,11 @@ void MEDCouplingNormalizedUnstructuredMesh::getBoundingBox(dou } const MEDCoupling::DataArrayDouble *array=_mesh->getCoords(); const double *ptr=array->getConstPointer(); - int nbOfPts=array->getNbOfElems()/SPACEDIM; + mcIdType nbOfPts=ToIdType(array->getNbOfElems())/SPACEDIM; for(int j=0;j*work) boundingBox[j]=*work; @@ -63,31 +63,31 @@ void MEDCouplingNormalizedUnstructuredMesh::getBoundingBox(dou } template -INTERP_KERNEL::NormalizedCellType MEDCouplingNormalizedUnstructuredMesh::getTypeOfElement(int eltId) const +INTERP_KERNEL::NormalizedCellType MEDCouplingNormalizedUnstructuredMesh::getTypeOfElement(mcIdType eltId) const { return _mesh->getTypeOfCell(eltId); } template -int MEDCouplingNormalizedUnstructuredMesh::getNumberOfNodesOfElement(int eltId) const +mcIdType MEDCouplingNormalizedUnstructuredMesh::getNumberOfNodesOfElement(mcIdType eltId) const { return _mesh->getNumberOfNodesInCell(eltId); } template -int MEDCouplingNormalizedUnstructuredMesh::getNumberOfElements() const +mcIdType MEDCouplingNormalizedUnstructuredMesh::getNumberOfElements() const { - return _mesh->getNumberOfCells(); + return ToIdType(_mesh->getNumberOfCells()); } template -int MEDCouplingNormalizedUnstructuredMesh::getNumberOfNodes() const +mcIdType MEDCouplingNormalizedUnstructuredMesh::getNumberOfNodes() const { return _mesh->getNumberOfNodes(); } template -const int *MEDCouplingNormalizedUnstructuredMesh::getConnectivityPtr() const +const mcIdType *MEDCouplingNormalizedUnstructuredMesh::getConnectivityPtr() const { return _conn_for_interp; } @@ -100,7 +100,7 @@ const double *MEDCouplingNormalizedUnstructuredMesh::getCoordi } template -const int *MEDCouplingNormalizedUnstructuredMesh::getConnectivityIndexPtr() const +const mcIdType *MEDCouplingNormalizedUnstructuredMesh::getConnectivityIndexPtr() const { return _conn_index_for_interp; } @@ -129,18 +129,18 @@ void MEDCouplingNormalizedUnstructuredMesh::prepare() const MEDCoupling::MEDCouplingUMesh *m1(dynamic_cast(_mesh)); if(m1) { - int nbOfCell=m1->getNumberOfCells(); - int initialConnSize=m1->getNodalConnectivity()->getNbOfElems(); - _conn_for_interp=new int[initialConnSize-nbOfCell]; - _conn_index_for_interp=new int[nbOfCell+1]; + mcIdType nbOfCell=ToIdType(m1->getNumberOfCells()); + mcIdType initialConnSize=ToIdType(m1->getNodalConnectivity()->getNbOfElems()); + _conn_for_interp=new mcIdType[initialConnSize-nbOfCell]; + _conn_index_for_interp=new mcIdType[nbOfCell+1]; _conn_index_for_interp[0]=0; - const int *work_conn=m1->getNodalConnectivity()->getConstPointer()+1; - const int *work_conn_index=m1->getNodalConnectivityIndex()->getConstPointer(); - int *work_conn_for_interp=_conn_for_interp; - int *work_conn_index_for_interp=_conn_index_for_interp; - for(int i=0;igetNodalConnectivity()->getConstPointer()+1; + const mcIdType *work_conn_index=m1->getNodalConnectivityIndex()->getConstPointer(); + mcIdType *work_conn_for_interp=_conn_for_interp; + mcIdType *work_conn_index_for_interp=_conn_index_for_interp; + for(mcIdType i=0;i::prepare() const MEDCoupling::MEDCoupling1DGTUMesh *m2(dynamic_cast(_mesh)); if(m2) { - int nbOfCell(m2->getNumberOfCells()); - _conn_index_for_interp=new int[nbOfCell+1]; - const int *conni(m2->getNodalConnectivityIndex()->begin()); + mcIdType nbOfCell=ToIdType(m2->getNumberOfCells()); + _conn_index_for_interp=new mcIdType[nbOfCell+1]; + const mcIdType *conni(m2->getNodalConnectivityIndex()->begin()); std::copy(conni,conni+nbOfCell+1,_conn_index_for_interp); - _conn_for_interp=new int[m2->getNodalConnectivity()->getNumberOfTuples()]; + _conn_for_interp=new mcIdType[m2->getNodalConnectivity()->getNumberOfTuples()]; std::copy(m2->getNodalConnectivity()->begin(),m2->getNodalConnectivity()->end(),_conn_for_interp); return ; } const MEDCoupling::MEDCoupling1SGTUMesh *m3(dynamic_cast(_mesh)); if(m3) { - int nbOfCell(m3->getNumberOfCells()),nbNodesPerCell(m3->getNumberOfNodesPerCell()); - _conn_index_for_interp=new int[nbOfCell+1]; _conn_index_for_interp[0]=0; - int *work(_conn_index_for_interp); - for(int i=0;igetNumberOfCells()),nbNodesPerCell(m3->getNumberOfNodesPerCell()); + _conn_index_for_interp=new mcIdType[nbOfCell+1]; _conn_index_for_interp[0]=0; + mcIdType *work(_conn_index_for_interp); + for(mcIdType i=0;igetNodalConnectivity()->getNumberOfTuples()]; + _conn_for_interp=new mcIdType[m3->getNodalConnectivity()->getNumberOfTuples()]; std::copy(m3->getNodalConnectivity()->begin(),m3->getNodalConnectivity()->end(),_conn_for_interp); return ; }