1 // Copyright (C) 2007-2023 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
21 #ifndef __OVERLAPINTERPOLATIONMATRIX_HXX__
22 #define __OVERLAPINTERPOLATIONMATRIX_HXX__
24 #include "MPIAccessDEC.hxx"
25 #include "OverlapMapping.hxx"
26 #include "InterpolationOptions.hxx"
27 #include "DECOptions.hxx"
32 class MEDCouplingPointSet;
35 * Internal class, not part of the public API.
37 * Similar to InterpolationMatrix, but for the OverlapDEC instead of the InterpKernelDEC.
39 class OverlapInterpolationMatrix : public INTERP_KERNEL::InterpolationOptions,
44 OverlapInterpolationMatrix(ParaFIELD *source_field,
45 ParaFIELD *target_field,
46 const ProcessorGroup& group,
47 const DECOptions& dec_opt,
48 const InterpolationOptions& i_opt,
49 const OverlapElementLocator & loc);
51 void keepTracksOfSourceIds(int procId, DataArrayIdType *ids);
53 void keepTracksOfTargetIds(int procId, DataArrayIdType *ids);
55 void computeLocalIntersection(const MEDCouplingPointSet *src, const DataArrayIdType *srcIds, const std::string& srcMeth, int srcProcId,
56 const MEDCouplingPointSet *trg, const DataArrayIdType *trgIds, const std::string& trgMeth, int trgProcId);
58 void prepare(const std::vector< int > & procsToSendField);
60 void computeSurfacesAndDeno();
62 void multiply(double default_val);
64 void transposeMultiply();
66 virtual ~OverlapInterpolationMatrix();
69 static void TransposeMatrix(const std::vector<SparseDoubleVec>& matIn, mcIdType nbColsMatIn,
70 std::vector<SparseDoubleVec>& matOut);
72 ParaFIELD *_source_field;
73 ParaFIELD *_target_field;
74 MEDCouplingPointSet *_source_support;
75 MEDCouplingPointSet *_target_support;
76 OverlapMapping _mapping;