1 // Copyright (C) 2007-2016 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
20 #ifndef __DISJOINTDEC_HXX__
21 #define __DISJOINTDEC_HXX__
23 #include "MEDCouplingFieldDouble.hxx"
24 #include "NormalizedUnstructuredMesh.hxx"
40 class DisjointDEC : public DEC
43 DisjointDEC():_local_field(0),_union_group(0),_source_group(0),_target_group(0),
45 _owns_field(false),_owns_groups(false),
46 _union_comm(MPI_COMM_NULL)
48 DisjointDEC(ProcessorGroup& source_group, ProcessorGroup& target_group);
49 DisjointDEC(const DisjointDEC&);
50 DisjointDEC &operator=(const DisjointDEC& s);
51 DisjointDEC(const std::set<int>& src_ids, const std::set<int>& trg_ids,
52 const MPI_Comm& world_comm=MPI_COMM_WORLD);
53 void setNature(NatureOfField nature);
54 void attachLocalField( MEDCouplingFieldDouble *field);
55 void attachLocalField(const ParaFIELD *field, bool ownPt=false);
56 void attachLocalField(const ICoCo::MEDField *field);
58 virtual void prepareSourceDE() = 0;
59 virtual void prepareTargetDE() = 0;
60 virtual void recvData() = 0;
61 virtual void sendData() = 0;
62 void sendRecvData(bool way=true);
63 virtual void synchronize() = 0;
64 virtual ~DisjointDEC();
65 virtual void computeProcGroup() { }
66 void renormalizeTargetField(bool isWAbs);
68 ProcessorGroup *getSourceGrp() const { return _source_group; }
69 ProcessorGroup *getTargetGrp() const { return _target_group; }
70 bool isInSourceSide() const;
71 bool isInTargetSide() const;
72 bool isInUnion() const;
74 void compareFieldAndMethod() const throw(INTERP_KERNEL::Exception);
76 void copyInstance(const DisjointDEC& other);
77 void checkPartitionGroup() const;
79 const ParaFIELD* _local_field;
80 //! Processor group representing the union of target and source processors
81 ProcessorGroup* _union_group;
82 ProcessorGroup* _source_group;
83 ProcessorGroup* _target_group;
85 const CommInterface* _comm_interface;