1 // Copyright (C) 2007-2024 CEA, EDF
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
20 #ifndef __MXN_MAPPING_HXX__
21 #define __MXN_MAPPING_HXX__
23 #include "MEDCouplingFieldDouble.hxx"
24 #include "MPIAccessDEC.hxx"
25 #include "DECOptions.hxx"
35 * Internal class, not part of the public API.
37 * Used by InterpolationMatrix. This class manages the mapping between a given processor and part
38 * of the mesh (cell ids).
40 class MxN_Mapping : public DECOptions
43 MxN_Mapping(const ProcessorGroup& source_group, const ProcessorGroup& target_group, const DECOptions& dec_options);
44 virtual ~MxN_Mapping();
45 void addElementFromSource(int distant_proc, mcIdType distant_elem);
46 void prepareSendRecv();
47 void sendRecv(MEDCouplingFieldDouble& field);
48 MCAuto<DataArrayIdType> retrieveNonFetchedIdsTarget(mcIdType nbTuples) const;
49 void sendRecv(double* sendfield, MEDCouplingFieldDouble& field) const ;
50 void reverseSendRecv(double* recvfield, MEDCouplingFieldDouble& field) const ;
53 const std::vector<std::pair<int,mcIdType> >& getSendingIds() const { return _sending_ids; }
54 const std::vector<int>& getSendProcsOffsets() const { return _send_proc_offsets; }
57 MPIAccessDEC* getAccessDEC(){ return _access_DEC; }
59 ProcessorGroup* _union_group;
60 MPIAccessDEC * _access_DEC;
62 std::vector<std::pair<int,mcIdType> > _sending_ids;
63 std::vector<mcIdType> _recv_ids;
64 std::vector<int> _send_proc_offsets;
65 std::vector<int> _recv_proc_offsets;
68 std::ostream & operator<< (std::ostream &,const AllToAllMethod &);