X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FINTERP_KERNEL%2FGaussPoints%2FInterpKernelGaussCoords.cxx;h=282a791746a358ea0b3d36cfe583c6dc10c12a47;hb=79c404a024c4b00550400f158f89fcc64859e71d;hp=82278ad732f272bbff899798a2dc7a92efa02dcd;hpb=97cb0a4204e5575274deeea485cb8cdb4c3d96d3;p=tools%2Fmedcoupling.git diff --git a/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.cxx b/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.cxx index 82278ad73..282a79174 100644 --- a/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.cxx +++ b/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.cxx @@ -187,15 +187,61 @@ bool GaussInfo::isSatisfy() return anIsSatisfy; } +std::vector GaussInfo::NormalizeCoordinatesIfNecessary(NormalizedCellType ct, int inputDim, const std::vector& inputArray) +{ + std::size_t sz(inputArray.size()),dim((std::size_t)inputDim); + if(dim==0) + throw INTERP_KERNEL::Exception("GaussInfo::NormalizeCoordinatesIfNecessary : invalid dimension ! Must be !=0 !"); + if(sz%dim!=0) + throw INTERP_KERNEL::Exception("GaussInfo::NormalizeCoordinatesIfNecessary : invalid input array ! Inconsistent with the given dimension !"); + const CellModel& cm(CellModel::GetCellModel(ct)); + std::size_t baseDim((std::size_t)cm.getDimension()); + if(baseDim==dim) + return inputArray; + std::size_t nbOfItems(sz/dim); + std::vector ret(nbOfItems*baseDim); + if(baseDim>dim) + { + for(std::size_t i=0;i