X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParaMEDMEM%2FOverlapInterpolationMatrix.cxx;h=00b64df0c7b5262ccae49e84d749516ef917e16f;hb=b832b15337be013a56e0976170e5e235b89fcb03;hp=842ba5f96eb5ad65cc4e921eddc2fc8f09a87467;hpb=e8f616a523471bd47f2eb60e6fded7b2b6363639;p=tools%2Fmedcoupling.git diff --git a/src/ParaMEDMEM/OverlapInterpolationMatrix.cxx b/src/ParaMEDMEM/OverlapInterpolationMatrix.cxx index 842ba5f96..00b64df0c 100644 --- a/src/ParaMEDMEM/OverlapInterpolationMatrix.cxx +++ b/src/ParaMEDMEM/OverlapInterpolationMatrix.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D +// Copyright (C) 2007-2024 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -32,6 +32,7 @@ #include "Interpolation2D3D.txx" #include "Interpolation2D1D.txx" #include "MEDCouplingUMesh.hxx" +#include "MEDCouplingFieldDouble.hxx" #include "MEDCouplingNormalizedUnstructuredMesh.txx" #include "InterpolationOptions.hxx" #include "NormalizedUnstructuredMesh.hxx" @@ -56,17 +57,16 @@ namespace MEDCoupling _target_field(target_field), _source_support(source_field->getSupport()->getCellMesh()), _target_support(target_field->getSupport()->getCellMesh()), - _mapping(group, locator), - _group(group) + _mapping(group, locator) { } - void OverlapInterpolationMatrix::keepTracksOfSourceIds(int procId, DataArrayInt *ids) + void OverlapInterpolationMatrix::keepTracksOfSourceIds(int procId, DataArrayIdType *ids) { _mapping.keepTracksOfSourceIds(procId,ids); } - void OverlapInterpolationMatrix::keepTracksOfTargetIds(int procId, DataArrayInt *ids) + void OverlapInterpolationMatrix::keepTracksOfTargetIds(int procId, DataArrayIdType *ids) { _mapping.keepTracksOfTargetIds(procId,ids); } @@ -84,14 +84,14 @@ namespace MEDCoupling * * One of the 2 is necessarily null (the two can be null together) */ - void OverlapInterpolationMatrix::computeLocalIntersection(const MEDCouplingPointSet *src, const DataArrayInt *srcIds, const std::string& srcMeth, int srcProcId, - const MEDCouplingPointSet *trg, const DataArrayInt *trgIds, const std::string& trgMeth, int trgProcId) + void OverlapInterpolationMatrix::computeLocalIntersection(const MEDCouplingPointSet *src, const DataArrayIdType *srcIds, const std::string& srcMeth, int srcProcId, + const MEDCouplingPointSet *trg, const DataArrayIdType *trgIds, const std::string& trgMeth, int trgProcId) { std::string interpMethod(srcMeth); interpMethod+=trgMeth; //creating the interpolator structure vector sparse_matrix_part; - int colSize=0; + mcIdType colSize=0; //computation of the intersection volumes between source and target elements const MEDCouplingUMesh *trgC=dynamic_cast(trg); const MEDCouplingUMesh *srcC=dynamic_cast(src); @@ -160,7 +160,7 @@ namespace MEDCoupling vector matrixTranspose; colSize=interpolator.interpolateMeshes(target_wrapper,source_wrapper,sparse_matrix_part,interpMethod);//not a bug target in source. TransposeMatrix(matrixTranspose,colSize,sparse_matrix_part); - colSize=matrixTranspose.size(); + colSize=ToIdType(matrixTranspose.size()); } else if ( src->getMeshDimension() == 1 && trg->getMeshDimension() == 2 && trg->getSpaceDimension() == 2 && src->getSpaceDimension() == 2 ) @@ -181,7 +181,7 @@ namespace MEDCoupling vector matrixTranspose; colSize=interpolator.interpolateMeshes(target_wrapper,source_wrapper,matrixTranspose,interpMethod);//not a bug target in source. TransposeMatrix(matrixTranspose,colSize,sparse_matrix_part); - colSize=matrixTranspose.size(); + colSize=ToIdType(matrixTranspose.size()); } else if (trg->getMeshDimension() != _source_support->getMeshDimension()) { @@ -257,14 +257,14 @@ namespace MEDCoupling void OverlapInterpolationMatrix::computeSurfacesAndDeno() { - if(_target_field->getField()->getNature()==ConservativeVolumic) + if(_target_field->getField()->getNature()==IntensiveMaximum) _mapping.computeDenoConservativeVolumic(_target_field->getField()->getNumberOfTuplesExpected()); else - throw INTERP_KERNEL::Exception("OverlapDEC: Policy not implemented yet: only ConservativeVolumic!"); + throw INTERP_KERNEL::Exception("OverlapDEC: Policy not set (did you call setNature()?) or not implemented yet: only IntensiveMaximum!"); // { -// if(_target_field->getField()->getNature()==RevIntegral) +// if(_target_field->getField()->getNature()==IntensiveConservation) // { -// MEDCouplingAutoRefCountObjectPtr f; +// MCAuto f; // int orient = getOrientation(); // From InterpolationOptions inheritance // if(orient == 2) // absolute areas // f = _target_support->getMeasureField(true); @@ -276,7 +276,7 @@ namespace MEDCoupling // _mapping.computeDenoRevIntegral(*f->getArray()); // } // else -// throw INTERP_KERNEL::Exception("OverlapDEC: Policy not implemented yet: only ConservativeVolumic and RevIntegral defined!"); +// throw INTERP_KERNEL::Exception("OverlapDEC: Policy not implemented yet: only IntensiveMaximum and IntensiveConservation defined!"); // } } @@ -291,7 +291,7 @@ namespace MEDCoupling } void OverlapInterpolationMatrix::TransposeMatrix(const std::vector& matIn, - int nbColsMatIn, std::vector& matOut) + mcIdType nbColsMatIn, std::vector& matOut) { matOut.resize(nbColsMatIn); int id=0;