X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FParaMEDMEM%2FDisjointDEC.hxx;h=8e84c9980d6d3d39e7a0eff20136c81423225bbf;hb=1b5fb5650409b0ad3a61da3215496f2adf2dae02;hp=0cac7c597ae76d88b17ba99fcebe776a77f11d14;hpb=c5873d1cac2ac6b6becd4d64a76049adc5a44595;p=tools%2Fmedcoupling.git diff --git a/src/ParaMEDMEM/DisjointDEC.hxx b/src/ParaMEDMEM/DisjointDEC.hxx index 0cac7c597..8e84c9980 100644 --- a/src/ParaMEDMEM/DisjointDEC.hxx +++ b/src/ParaMEDMEM/DisjointDEC.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D +// Copyright (C) 2007-2023 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -29,27 +29,62 @@ namespace ICoCo { - class MEDField; + class MEDDoubleField; } -namespace ParaMEDMEM +namespace MEDCoupling { class ProcessorGroup; class ParaFIELD; - + + /*! + * \anchor DisjointDEC-det + * \class DisjointDEC + * + * \section DisjointDEC-over Overview + * + * Abstract interface class representing a link between two + * processor groups for exchanging mesh or field data. The two processor groups must + * have a void intersection (\ref MEDCoupling::OverlapDEC "OverlapDEC" is to be considered otherwise). + * The %DEC is initialized by attaching a field on the receiving or on the + * sending side. + * + * The data is sent or received through calls to the (abstract) methods recvData() and sendData(). + * + * One can attach either a \c MEDCoupling::ParaFIELD, or a + * \c ICoCo::Field, or directly a \c MEDCoupling::MEDCouplingFieldDouble instance. + * See the various signatures of the method DisjointDEC::attachLocalField() + * + * The derivations of this class should be considered for practical instantiation: + * - \ref InterpKernelDEC-det "InterpKernelDEC" + * - \ref ExplicitCoincidentDEC-det "ExplicitCoincidentDEC" + * - \ref StructuredCoincidentDEC-det "StructuredCoincidentDEC" + * + * \section DisjointDEC-options DisjointDEC options + * The options supported by %DisjointDEC objects are the same that the ones supported for all + * DECs in general and are all inherited from the class \ref MEDCoupling::DECOptions "DECOptions" + * + */ + class DisjointDEC : public DEC { public: - DisjointDEC():_local_field(0),_union_group(0),_source_group(0),_target_group(0),_owns_field(false),_owns_groups(false) { } + DisjointDEC():_local_field(0),_union_group(0),_source_group(0),_target_group(0), + _comm_interface(0), + _owns_field(false),_owns_groups(false), + _union_comm(MPI_COMM_NULL) + { } DisjointDEC(ProcessorGroup& source_group, ProcessorGroup& target_group); DisjointDEC(const DisjointDEC&); DisjointDEC &operator=(const DisjointDEC& s); DisjointDEC(const std::set& src_ids, const std::set& trg_ids, const MPI_Comm& world_comm=MPI_COMM_WORLD); + virtual ~DisjointDEC(); + void setNature(NatureOfField nature); void attachLocalField( MEDCouplingFieldDouble *field); void attachLocalField(const ParaFIELD *field, bool ownPt=false); - void attachLocalField(const ICoCo::MEDField *field); + void attachLocalField(const ICoCo::MEDDoubleField *field); virtual void prepareSourceDE() = 0; virtual void prepareTargetDE() = 0; @@ -57,7 +92,7 @@ namespace ParaMEDMEM virtual void sendData() = 0; void sendRecvData(bool way=true); virtual void synchronize() = 0; - virtual ~DisjointDEC(); + virtual void computeProcGroup() { } void renormalizeTargetField(bool isWAbs); // @@ -67,9 +102,10 @@ namespace ParaMEDMEM bool isInTargetSide() const; bool isInUnion() const; protected: - void compareFieldAndMethod() const throw(INTERP_KERNEL::Exception); + void compareFieldAndMethod() const; void cleanInstance(); void copyInstance(const DisjointDEC& other); + void checkPartitionGroup() const; protected: const ParaFIELD* _local_field; //! Processor group representing the union of target and source processors @@ -80,6 +116,7 @@ namespace ParaMEDMEM const CommInterface* _comm_interface; bool _owns_field; bool _owns_groups; + MPI_Comm _union_comm; }; }