]> SALOME platform Git repositories - tools/medcoupling.git/commitdiff
Salome HOME
*** empty log message ***
authorageay <ageay>
Tue, 23 Feb 2010 10:02:07 +0000 (10:02 +0000)
committerageay <ageay>
Tue, 23 Feb 2010 10:02:07 +0000 (10:02 +0000)
src/ParaMEDMEM/DEC.cxx
src/ParaMEDMEM/DEC.hxx

index 966e25db9dffa2f7ce2ddf8e98eab865bb0d9e0b..6d6679c02c105fe30cabbf5212c31625329dc365 100644 (file)
@@ -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());
   }
 
index d6cc17a7bced119b8b6fa030a917c46c61849421..2914dcaf80bcb2185dbc6323f673dea8003a623a 100644 (file)
@@ -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;