Ignore:
Timestamp:
07/07/15 10:46:25 (9 years ago)
Author:
mhnguyen
Message:

Implementing interpolation (polynomial) and correct some bugs

+) Implement interpolation (polynomial)
+) Correct some minor bugs relating to memory allocation
+) Clear some redundant codes

Test
+) On Curie
+) test_client and test_complete pass

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/node/field.cpp

    r624 r630  
    814814     { 
    815815        itFilterSrc = filterSources_.begin(); iteFilterSrc = filterSources_.end(); 
     816        dataToReceive = 0.0; // Reset all data destination 
    816817        for (; itFilterSrc != iteFilterSrc; ++itFilterSrc) 
    817818        { 
     
    819820          { 
    820821             const std::map<int, CArray<int,1>* >& localIndexToSend = (*itFilterSrc)->grid->getTransformations()->getLocalIndexToSendFromGridSource(); 
    821              const std::map<int, std::vector<CArray<int,1>* > >& localIndexToReceive = (*itFilterSrc)->grid->getTransformations()->getLocalIndexToReceiveOnGridDest(); 
     822             const std::map<int,std::vector<std::vector<std::pair<int,double> > > >& localIndexToReceive = (*itFilterSrc)->grid->getTransformations()->getLocalIndexToReceiveOnGridDest(); 
    822823 
    823824             sendAndReceiveTransformedData(localIndexToSend, dataToSend, 
     
    831832   void CField::sendAndReceiveTransformedData(const std::map<int, CArray<int,1>* >& localIndexToSend, 
    832833                                              const CArray<double, 1>& dataSrc, 
    833                                               const std::map<int, std::vector<CArray<int,1>* > >& localIndexToReceive, 
     834                                              const std::map<int,std::vector<std::vector<std::pair<int,double> > > >& localIndexToReceive, 
    834835                                              CArray<double,1>& dataDest) 
    835836   { 
     
    858859 
    859860     // Receiving data on destination fields 
    860      std::map<int, std::vector<CArray<int,1>* > >::const_iterator itbRecv = localIndexToReceive.begin(), itRecv, 
     861     std::map<int,std::vector<std::vector<std::pair<int,double> > > >::const_iterator itbRecv = localIndexToReceive.begin(), itRecv, 
    861862                                                                  iteRecv = localIndexToReceive.end(); 
    862863     int recvBuffSize = 0; 
     
    873874       for (int idx = 0; idx < countSize; ++idx) 
    874875       { 
    875          CArray<int,1>* localIndex_p = (itRecv->second)[idx]; 
    876          int numIndex = localIndex_p->numElements(); 
     876         const std::vector<std::pair<int,double> >& localIndex_p = (itRecv->second)[idx]; 
     877         int numIndex = localIndex_p.size(); 
    877878         for (int i = 0; i < numIndex; ++i) 
    878879         { 
    879            dataDest((*localIndex_p)(i)) = recvBuff[idx]; 
     880//           if ((localIndex_p)[i].first >= dataDest.numElements() ) 
     881           dataDest((localIndex_p)[i].first) += recvBuff[idx] * ((localIndex_p)[i].second); 
    880882         } 
    881883       } 
Note: See TracChangeset for help on using the changeset viewer.