X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling%2FMEDCouplingGaussLocalization.cxx;h=ebf9cc4a0a44a53167824d4b241fbcafe108f184;hb=ffb8188e28b2b60ee207a8644286821bc4e8fcdc;hp=f75cd82a80e61de94c60df6d950168d448fd9ea2;hpb=cb69486cbd6a1561cd5106919e72e57fbfa23a88;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling/MEDCouplingGaussLocalization.cxx b/src/MEDCoupling/MEDCouplingGaussLocalization.cxx index f75cd82a8..ebf9cc4a0 100644 --- a/src/MEDCoupling/MEDCouplingGaussLocalization.cxx +++ b/src/MEDCoupling/MEDCouplingGaussLocalization.cxx @@ -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 @@ -71,7 +71,7 @@ void MEDCouplingGaussLocalization::checkConsistencyLight() const int dim=cm.getDimension(); if(!cm.isDynamic()) { - if((int)_ref_coord.size()!=nbNodes*dim) + if(ToIdType(_ref_coord.size())!=nbNodes*dim) { std::ostringstream oss; oss << "Invalid size of refCoo : expecting to be : " << nbNodes << " (nbNodePerCell) * " << dim << " (dim) !"; throw INTERP_KERNEL::Exception(oss.str().c_str()); @@ -160,9 +160,9 @@ double MEDCouplingGaussLocalization::getWeight(int gaussPtIdInCell, double newVa * push at the end of tinyInfo its basic serialization info. The size of pushed data is always the same. * @param tinyInfo inout parameter. */ -void MEDCouplingGaussLocalization::pushTinySerializationIntInfo(std::vector& tinyInfo) const +void MEDCouplingGaussLocalization::pushTinySerializationIntInfo(std::vector& tinyInfo) const { - tinyInfo.push_back((int)_type); + tinyInfo.push_back(ToIdType(_type)); tinyInfo.push_back(getNumberOfPtsInRefCell()); tinyInfo.push_back(getNumberOfGaussPt()); } @@ -212,24 +212,24 @@ MCAuto MEDCouplingGaussLocalization::localizePtsInRefCooForEach ptsInRefCoo->checkAllocated(); mesh->checkConsistencyLight(); // - int nbCells(mesh->getNumberOfCells()); + mcIdType nbCells=mesh->getNumberOfCells(); const double *coords(mesh->getCoords()->begin()); - const int *connI(mesh->getNodalConnectivityIndex()->begin()),*conn(mesh->getNodalConnectivity()->begin()); + const mcIdType *connI(mesh->getNodalConnectivityIndex()->begin()),*conn(mesh->getNodalConnectivity()->begin()); // - int nbPts(ptsInRefCoo->getNumberOfTuples()); + mcIdType nbPts(ptsInRefCoo->getNumberOfTuples()); INTERP_KERNEL::NormalizedCellType typ(getType()); - int dim(INTERP_KERNEL::CellModel::GetCellModel(typ).getDimension()); + int dim(INTERP_KERNEL::CellModel::GetCellModel(typ).getDimension()),outDim(mesh->getSpaceDimension()); MCAuto ret(DataArrayDouble::New()); - ret->alloc(nbPts*nbCells,dim); + ret->alloc(nbPts*nbCells,outDim); double *retPtr(ret->getPointer()); - if(dim!=ptsInRefCoo->getNumberOfComponents()) + if(dim!=ToIdType(ptsInRefCoo->getNumberOfComponents())) throw INTERP_KERNEL::Exception("MEDCouplingGaussLocalization::localizePtsInRefCooForEachCell : number of components of input coo is not equal to dim of element !"); const std::vector& wg(getWeights()); INTERP_KERNEL::GaussCoords calculator; calculator.addGaussInfo(typ,dim, ptsInRefCoo->begin(),nbPts,&_ref_coord[0],getNumberOfPtsInRefCell()); // - for(int i=0;i MEDCouplingGaussLocalization::buildRefCell() const { MCAuto coo(DataArrayDouble::New()); const INTERP_KERNEL::CellModel& cm(INTERP_KERNEL::CellModel::GetCellModel(getType())); - if(getDimension()!=cm.getDimension()) + if(getDimension()!=ToIdType(cm.getDimension())) throw INTERP_KERNEL::Exception("BuildRefCell : dimension mistmatch !"); coo->alloc(cm.getNumberOfNodes(),getDimension()); std::copy(_ref_coord.begin(),_ref_coord.end(),coo->getPointer()); MCAuto ret(MEDCoupling1SGTUMesh::New("",getType())); ret->setCoords(coo); - MCAuto conn(DataArrayInt::New()); + MCAuto conn(DataArrayIdType::New()); conn->alloc(cm.getNumberOfNodes(),1); conn->iota(); ret->setNodalConnectivity(conn); @@ -299,17 +299,17 @@ void MEDCouplingGaussLocalization::setWeights(const std::vector& w) /*! * The format of 'tinyData' parameter is the same than pushed in method MEDCouplingGaussLocalization::pushTinySerializationIntInfo. */ -MEDCouplingGaussLocalization MEDCouplingGaussLocalization::BuildNewInstanceFromTinyInfo(int dim, const std::vector& tinyData) +MEDCouplingGaussLocalization MEDCouplingGaussLocalization::BuildNewInstanceFromTinyInfo(mcIdType dim, const std::vector& tinyData) { std::vector v1(dim*tinyData[1]),v2(dim*tinyData[2]),v3(tinyData[2]); return MEDCouplingGaussLocalization((INTERP_KERNEL::NormalizedCellType)tinyData[0],v1,v2,v3); } -int MEDCouplingGaussLocalization::checkCoherencyOfRequest(int gaussPtIdInCell, int comp) const +int MEDCouplingGaussLocalization::checkCoherencyOfRequest(mcIdType gaussPtIdInCell, int comp) const { const INTERP_KERNEL::CellModel& cm=INTERP_KERNEL::CellModel::GetCellModel(_type); int dim=cm.getDimension(); - int nbGsPts=getNumberOfGaussPt(); + mcIdType nbGsPts=getNumberOfGaussPt(); if(gaussPtIdInCell<0 || gaussPtIdInCell>=nbGsPts) throw INTERP_KERNEL::Exception("gaussPtIdInCell specified is invalid : must be in [0:nbGsPts) !"); if(comp<0 || comp>=dim)