X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FINTERP_KERNEL%2FGaussPoints%2FInterpKernelGaussCoords.cxx;h=282a791746a358ea0b3d36cfe583c6dc10c12a47;hb=79c404a024c4b00550400f158f89fcc64859e71d;hp=f5a84b5fd7b1bd101991313d3238b24c0dd90532;hpb=f1a947b32a36d8dc8e3079b25305bb50e8cb59a0;p=tools%2Fmedcoupling.git diff --git a/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.cxx b/src/INTERP_KERNEL/GaussPoints/InterpKernelGaussCoords.cxx index f5a84b5fd..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;igetNbGauss(); @@ -2093,7 +2786,7 @@ double* GaussCoords::calculateCoords( NormalizedCellType theGeometry, } -void GaussCoords::calculateCoords( NormalizedCellType theGeometry, const double *theNodeCoords, const int theSpaceDim, const int *theIndex, double *result) throw(INTERP_KERNEL::Exception) +void GaussCoords::calculateCoords( NormalizedCellType theGeometry, const double *theNodeCoords, const int theSpaceDim, const int *theIndex, double *result) { const GaussInfo *info = getInfoGivenCellType(theGeometry); calculateCoordsAlg(info,theNodeCoords,theSpaceDim,theIndex,result);