From 9a4dc0fc97b5c45b311f12b13bd72fb12775e2e5 Mon Sep 17 00:00:00 2001 From: geay Date: Fri, 6 Jun 2014 12:25:58 +0200 Subject: [PATCH] Ready to be tested outside -> next commit suppression. --- src/ParaMEDMEM/CMakeLists.txt | 3 ++- src/ParaMEDMEM/TrioDEC.cxx | 44 +++++++++++++++++++++++++++++++++++ src/ParaMEDMEM/TrioDEC.hxx | 33 ++++++++++++++++++++++++++ 3 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 src/ParaMEDMEM/TrioDEC.cxx create mode 100644 src/ParaMEDMEM/TrioDEC.hxx diff --git a/src/ParaMEDMEM/CMakeLists.txt b/src/ParaMEDMEM/CMakeLists.txt index 0427edd0a..d5bed9bfe 100644 --- a/src/ParaMEDMEM/CMakeLists.txt +++ b/src/ParaMEDMEM/CMakeLists.txt @@ -55,10 +55,11 @@ SET(paramedmem_SOURCES OverlapMapping.cxx ICoCoMEDField.cxx ICoCoField.cxx - ICoCoTrioField.cxx ParaFIELD.cxx ParaGRID.cxx BlockTopology.cxx + ICoCoTrioField.cxx + TrioDEC.cxx ) ADD_LIBRARY(paramedmem SHARED ${paramedmem_SOURCES}) diff --git a/src/ParaMEDMEM/TrioDEC.cxx b/src/ParaMEDMEM/TrioDEC.cxx new file mode 100644 index 000000000..9ae1734f5 --- /dev/null +++ b/src/ParaMEDMEM/TrioDEC.cxx @@ -0,0 +1,44 @@ +// Data exchange channel for trio +// TrioDEC.cxx +// version 0.0 06/06/2014 + +#include "TrioDEC.hxx" + +#include "ICoCoMEDField.hxx" +#include "ICoCoTrioField.hxx" + +using namespace ParaMEDMEM; +using namespace ICoCo; + +TrioDEC::TrioDEC():_traduced_field(0) +{ +} + +TrioDEC::TrioDEC(ProcessorGroup& source_group, ProcessorGroup& target_group):InterpKernelDEC(source_group,target_group),_traduced_field(0) +{ +} + +TrioDEC::TrioDEC(const std::set& src_ids, const std::set& trg_ids, const MPI_Comm& world_comm):InterpKernelDEC(src_ids,trg_ids,world_comm),_traduced_field(0) +{ +} + +void TrioDEC::attachLocalField(ICoCo::TrioField *field) +{ + if(!field) + throw INTERP_KERNEL::Exception("TrioDEC::attachLocalField : The input trio Field is NULL !"); + releaseInternalPointer(); + _traduced_field=field->build_medfield(); + DisjointDEC::attachLocalField(_traduced_field); +} + +void TrioDEC::releaseInternalPointer() +{ + if(_traduced_field) + delete _traduced_field; + _traduced_field=0; +} + +TrioDEC::~TrioDEC() +{ + releaseInternalPointer(); +} diff --git a/src/ParaMEDMEM/TrioDEC.hxx b/src/ParaMEDMEM/TrioDEC.hxx new file mode 100644 index 000000000..4f8fc315d --- /dev/null +++ b/src/ParaMEDMEM/TrioDEC.hxx @@ -0,0 +1,33 @@ +// Data exchange channel for trio +// TrioDEC.h +// version 0.0 06/06/2014 + +#ifndef _TrioDEC_included_ +#define _TrioDEC_included_ + +#include "InterpKernelDEC.hxx" + +namespace ICoCo +{ + class MEDField; + class TrioField; +} + +namespace ParaMEDMEM +{ + class TrioDEC : public InterpKernelDEC + { + public: + TrioDEC(); + TrioDEC(ProcessorGroup& source_group, ProcessorGroup& target_group); + TrioDEC(const std::set& src_ids, const std::set& trg_ids, const MPI_Comm& world_comm=MPI_COMM_WORLD); + void attachLocalField(ICoCo::TrioField *field); + virtual ~TrioDEC(); + private: + void releaseInternalPointer(); + private : + ICoCo::MEDField *_traduced_field; + }; +} + +#endif -- 2.39.2