X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParaMEDMEM%2FOverlapInterpolationMatrix.cxx;h=0607838330ff4bbb9b6d81ad6617182a5fc059b5;hb=702822890118781c9b9f6c97be554076f14c6ebf;hp=95b7e1b942198468d5772c6397dd6fa94270c63a;hpb=6f841c1f16f8b9d0b7ba50cf000ade240b2484b2;p=tools%2Fmedcoupling.git diff --git a/src/ParaMEDMEM/OverlapInterpolationMatrix.cxx b/src/ParaMEDMEM/OverlapInterpolationMatrix.cxx index 95b7e1b94..060783833 100644 --- a/src/ParaMEDMEM/OverlapInterpolationMatrix.cxx +++ b/src/ParaMEDMEM/OverlapInterpolationMatrix.cxx @@ -48,14 +48,15 @@ namespace ParaMEDMEM ParaFIELD *target_field, const ProcessorGroup& group, const DECOptions& dec_options, - const INTERP_KERNEL::InterpolationOptions& i_opt): + const INTERP_KERNEL::InterpolationOptions& i_opt, + const OverlapElementLocator & locator): INTERP_KERNEL::InterpolationOptions(i_opt), DECOptions(dec_options), _source_field(source_field), _target_field(target_field), _source_support(source_field->getSupport()->getCellMesh()), _target_support(target_field->getSupport()->getCellMesh()), - _mapping(group), + _mapping(group, locator), _group(group) { } @@ -76,12 +77,14 @@ namespace ParaMEDMEM // TODO? Merge with MEDCouplingRemapper::prepareInterpKernelOnlyUU() ? /**! + * Local run (on this proc) of the sequential interpolation algorithm. + * * @param srcIds is null if the source mesh is on the local proc * @param trgIds is null if the source mesh is on the local proc * * One of the 2 is necessarily null (the two can be null together) */ - void OverlapInterpolationMatrix::addContribution(const MEDCouplingPointSet *src, const DataArrayInt *srcIds, const std::string& srcMeth, int srcProcId, + 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) { std::string interpMethod(srcMeth); @@ -240,7 +243,6 @@ namespace ParaMEDMEM _mapping.addContributionST(sparse_matrix_part,srcIds,srcProcId,trgIds,trgProcId); } - /*! * 'procsToSendField' gives the list of procs field data has to be sent to. * See OverlapElementLocator::computeBoundingBoxesAndTodoList() @@ -253,17 +255,34 @@ namespace ParaMEDMEM _mapping.prepare(procsToSendField,0); } - void OverlapInterpolationMatrix::computeDeno() + void OverlapInterpolationMatrix::computeSurfacesAndDeno() { if(_target_field->getField()->getNature()==ConservativeVolumic) _mapping.computeDenoConservativeVolumic(_target_field->getField()->getNumberOfTuplesExpected()); else - throw INTERP_KERNEL::Exception("Policy Not implemented yet : only ConservativeVolumic defined !"); + throw INTERP_KERNEL::Exception("OverlapDEC: Policy not implemented yet: only ConservativeVolumic!"); +// { +// if(_target_field->getField()->getNature()==RevIntegral) +// { +// MEDCouplingAutoRefCountObjectPtr f; +// int orient = getOrientation(); // From InterpolationOptions inheritance +// if(orient == 2) // absolute areas +// f = _target_support->getMeasureField(true); +// else +// if(orient == 0) // relative areas +// f = _target_support->getMeasureField(false); +// else +// throw INTERP_KERNEL::Exception("OverlapDEC: orientation policy not impl. yet!"); +// _mapping.computeDenoRevIntegral(*f->getArray()); +// } +// else +// throw INTERP_KERNEL::Exception("OverlapDEC: Policy not implemented yet: only ConservativeVolumic and RevIntegral defined!"); +// } } - void OverlapInterpolationMatrix::multiply() + void OverlapInterpolationMatrix::multiply(double default_val) { - _mapping.multiply(_source_field->getField(),_target_field->getField()); + _mapping.multiply(_source_field->getField(),_target_field->getField(), default_val); } void OverlapInterpolationMatrix::transposeMultiply() @@ -271,11 +290,6 @@ namespace ParaMEDMEM _mapping.transposeMultiply(_target_field->getField(),_source_field->getField()); } -// bool OverlapInterpolationMatrix::isSurfaceComputationNeeded(const std::string& method) const -// { -// return method=="P0"; -// } - void OverlapInterpolationMatrix::TransposeMatrix(const std::vector& matIn, int nbColsMatIn, std::vector& matOut) {