00001 // Copyright (C) 2007-2011 CEA/DEN, EDF R&D 00002 // 00003 // This library is free software; you can redistribute it and/or 00004 // modify it under the terms of the GNU Lesser General Public 00005 // License as published by the Free Software Foundation; either 00006 // version 2.1 of the License. 00007 // 00008 // This library is distributed in the hope that it will be useful, 00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 // Lesser General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU Lesser General Public 00014 // License along with this library; if not, write to the Free Software 00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00016 // 00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com 00018 // 00019 00020 #ifndef __DISJOINTDEC_HXX__ 00021 #define __DISJOINTDEC_HXX__ 00022 00023 #include "MEDCouplingFieldDouble.hxx" 00024 #include "NormalizedUnstructuredMesh.hxx" 00025 #include "DEC.hxx" 00026 00027 #include <mpi.h> 00028 #include <set> 00029 00030 namespace ICoCo 00031 { 00032 class Field; 00033 } 00034 00035 namespace ParaMEDMEM 00036 { 00037 class ProcessorGroup; 00038 class ParaFIELD; 00039 00040 class DisjointDEC : public DEC 00041 { 00042 public: 00043 DisjointDEC():_local_field(0) { } 00044 DisjointDEC(ProcessorGroup& source_group, ProcessorGroup& target_group); 00045 DisjointDEC(const std::set<int>& src_ids, const std::set<int>& trg_ids, 00046 const MPI_Comm& world_comm=MPI_COMM_WORLD); 00047 void setNature(NatureOfField nature); 00048 void attachLocalField( MEDCouplingFieldDouble* field); 00049 void attachLocalField(const ParaFIELD* field, bool ownPt=false); 00050 void attachLocalField(const ICoCo::Field* field); 00051 00052 virtual void prepareSourceDE() = 0; 00053 virtual void prepareTargetDE() = 0; 00054 virtual void recvData() = 0; 00055 virtual void sendData() = 0; 00056 void sendRecvData(bool way=true); 00057 virtual void synchronize() = 0; 00058 virtual ~DisjointDEC(); 00059 virtual void computeProcGroup() { } 00060 void renormalizeTargetField(bool isWAbs); 00061 // 00062 ProcessorGroup *getSourceGrp() const { return _source_group; } 00063 ProcessorGroup *getTargetGrp() const { return _target_group; } 00064 bool isInSourceSide() const; 00065 bool isInTargetSide() const; 00066 bool isInUnion() const; 00067 protected: 00068 void compareFieldAndMethod() const throw(INTERP_KERNEL::Exception); 00069 protected: 00070 const ParaFIELD* _local_field; 00072 ProcessorGroup* _union_group; 00073 ProcessorGroup* _source_group; 00074 ProcessorGroup* _target_group; 00075 00076 const CommInterface* _comm_interface; 00077 bool _owns_field; 00078 bool _owns_groups; 00079 private: 00080 ICoCo::Field* _icoco_field; 00081 }; 00082 } 00083 00084 #endif