1 // Copyright (C) 2007-2014 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),_owns_field(false),_owns_groups(false) { }
44 DisjointDEC(ProcessorGroup& source_group, ProcessorGroup& target_group);
45 DisjointDEC(const DisjointDEC&);
46 DisjointDEC &operator=(const DisjointDEC& s);
47 DisjointDEC(const std::set<int>& src_ids, const std::set<int>& trg_ids,
48 const MPI_Comm& world_comm=MPI_COMM_WORLD);
49 void setNature(NatureOfField nature);
50 void attachLocalField( MEDCouplingFieldDouble *field);
51 void attachLocalField(const ParaFIELD *field, bool ownPt=false);
52 void attachLocalField(const ICoCo::MEDField *field);
54 virtual void prepareSourceDE() = 0;
55 virtual void prepareTargetDE() = 0;
56 virtual void recvData() = 0;
57 virtual void sendData() = 0;
58 void sendRecvData(bool way=true);
59 virtual void synchronize() = 0;
60 virtual ~DisjointDEC();
61 virtual void computeProcGroup() { }
62 void renormalizeTargetField(bool isWAbs);
64 ProcessorGroup *getSourceGrp() const { return _source_group; }
65 ProcessorGroup *getTargetGrp() const { return _target_group; }
66 bool isInSourceSide() const;
67 bool isInTargetSide() const;
68 bool isInUnion() const;
70 void compareFieldAndMethod() const throw(INTERP_KERNEL::Exception);
72 void copyInstance(const DisjointDEC& other);
74 const ParaFIELD* _local_field;
75 //! Processor group representing the union of target and source processors
76 ProcessorGroup* _union_group;
77 ProcessorGroup* _source_group;
78 ProcessorGroup* _target_group;
80 const CommInterface* _comm_interface;