From 24fc150c4a1b1a597cb7b25a81a3730d70391131 Mon Sep 17 00:00:00 2001 From: ageay Date: Tue, 23 Feb 2010 10:02:07 +0000 Subject: [PATCH] *** empty log message *** --- src/ParaMEDMEM/DEC.cxx | 14 +++++++------- src/ParaMEDMEM/DEC.hxx | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ParaMEDMEM/DEC.cxx b/src/ParaMEDMEM/DEC.cxx index 966e25db9..6d6679c02 100644 --- a/src/ParaMEDMEM/DEC.cxx +++ b/src/ParaMEDMEM/DEC.cxx @@ -103,9 +103,12 @@ namespace ParaMEDMEM will be updated by a recvData() call. Reversely, if the processor is on the sending end, the field will be read, possibly transformed, and sent appropriately to the other side. */ - void DEC::attachLocalField(const ParaFIELD* field) + void DEC::attachLocalField(const ParaFIELD* field, bool ownPt) { + if(_owns_field) + delete _local_field; _local_field=field; + _owns_field=ownPt; _comm_interface=&(field->getTopology()->getProcGroup()->getCommInterface()); compareFieldAndMethod(); } @@ -130,12 +133,9 @@ namespace ParaMEDMEM else throw INTERP_KERNEL::Exception("Invalid procgroup for field attachment to DEC"); ParaMESH *paramesh=new ParaMESH((MEDCouplingPointSet *)field->getMesh(),*local_group,field->getMesh()->getName()); - if(_owns_field) - delete _local_field; - _local_field = new ParaFIELD(field, paramesh, *local_group); - _owns_field=true; - _local_field->setOwnSupport(true); - attachLocalField(_local_field); + ParaFIELD *tmp=new ParaFIELD(field, paramesh, *local_group); + tmp->setOwnSupport(true); + attachLocalField(tmp,true); //_comm_interface=&(local_group->getCommInterface()); } diff --git a/src/ParaMEDMEM/DEC.hxx b/src/ParaMEDMEM/DEC.hxx index d6cc17a7b..2914dcaf8 100644 --- a/src/ParaMEDMEM/DEC.hxx +++ b/src/ParaMEDMEM/DEC.hxx @@ -40,7 +40,7 @@ namespace ParaMEDMEM DEC(ProcessorGroup& source_group, ProcessorGroup& target_group); void setNature(NatureOfField nature); void attachLocalField( MEDCouplingFieldDouble* field); - void attachLocalField(const ParaFIELD* field); + void attachLocalField(const ParaFIELD* field, bool ownPt=false); void attachLocalField(const ICoCo::Field* field); virtual void prepareSourceDE()=0; -- 2.39.2