Changeset 632


Ignore:
Timestamp:
07/08/15 14:27:28 (7 years ago)
Author:
mhnguyen
Message:

Moving transformation from grid source to grid destination

+) grid transformation object moved to grid destination
+) Add getter methods fro grid transformation

Test
+) On Curie
+) test_complete and test_client pass

Location:
XIOS/trunk/src
Files:
4 edited

Legend:

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

    r630 r632  
    797797       if ((0 != gridRefOfFieldRef) && (relGridRef != gridRefOfFieldRef) && (!(relGridRef->isTransformed()))) 
    798798       { 
    799          gridRefOfFieldRef->transformGrid(relGridRef); 
     799         relGridRef->transformGrid(gridRefOfFieldRef); 
    800800         filterSources_.push_back(fieldRef); 
    801801       } 
     
    817817        for (; itFilterSrc != iteFilterSrc; ++itFilterSrc) 
    818818        { 
    819           if (0 != (*itFilterSrc)->grid->getTransformations()) 
     819          if (0 != grid->getTransformations()) 
    820820          { 
    821              const std::map<int, CArray<int,1>* >& localIndexToSend = (*itFilterSrc)->grid->getTransformations()->getLocalIndexToSendFromGridSource(); 
    822              const std::map<int,std::vector<std::vector<std::pair<int,double> > > >& localIndexToReceive = (*itFilterSrc)->grid->getTransformations()->getLocalIndexToReceiveOnGridDest(); 
     821             const std::map<int, CArray<int,1>* >& localIndexToSend = grid->getTransformations()->getLocalIndexToSendFromGridSource(); 
     822             const std::map<int,std::vector<std::vector<std::pair<int,double> > > >& localIndexToReceive = grid->getTransformations()->getLocalIndexToReceiveOnGridDest(); 
    823823 
    824824             sendAndReceiveTransformedData(localIndexToSend, dataToSend, 
  • XIOS/trunk/src/node/grid.cpp

    r631 r632  
    11611161  } 
    11621162 
    1163   void CGrid::transformGrid(CGrid* transformedGrid) 
    1164   { 
    1165     if (transformedGrid->isTransformed()) return; 
    1166     transformedGrid->setTransformed(); 
    1167     if (axis_domain_order.numElements() != transformedGrid->axis_domain_order.numElements()) 
    1168     { 
    1169       ERROR("CGrid::transformGrid(CGrid* transformedGrid)", 
     1163  void CGrid::transformGrid(CGrid* transformGridSrc) 
     1164  { 
     1165    if (isTransformed()) return; 
     1166    setTransformed(); 
     1167    if (axis_domain_order.numElements() != transformGridSrc->axis_domain_order.numElements()) 
     1168    { 
     1169      ERROR("CGrid::transformGrid(CGrid* transformGridSrc)", 
    11701170           << "Two grids have different dimension size" 
    1171            << "Dimension of grid source " <<this->getId() << " is " << axis_domain_order.numElements() << std::endl 
    1172            << "Dimension of grid destination " <<transformedGrid->getId() << " is " << transformedGrid->axis_domain_order.numElements()); 
     1171           << "Dimension of grid destination " <<this->getId() << " is " << axis_domain_order.numElements() << std::endl 
     1172           << "Dimension of grid source " <<transformGridSrc->getId() << " is " << transformGridSrc->axis_domain_order.numElements()); 
    11731173    } 
    11741174    else 
     
    11761176      int ssize = axis_domain_order.numElements(); 
    11771177      for (int i = 0; i < ssize; ++i) 
    1178         if (axis_domain_order(i) != (transformedGrid->axis_domain_order)(i)) 
    1179           ERROR("CGrid::transformGrid(CGrid* transformedGrid)", 
    1180                 << "Grids " <<this->getId() <<" and " << transformedGrid->getId() 
     1178        if (axis_domain_order(i) != (transformGridSrc->axis_domain_order)(i)) 
     1179          ERROR("CGrid::transformGrid(CGrid* transformGridSrc)", 
     1180                << "Grids " <<this->getId() <<" and " << transformGridSrc->getId() 
    11811181                << " don't have elements in the same order"); 
    11821182    } 
    11831183 
    1184     transformations_ = new CGridTransformation(transformedGrid, this); 
     1184    transformations_ = new CGridTransformation(this, transformGridSrc); 
    11851185    transformations_->computeAll(); 
    11861186 
    11871187    // Ok, now need to compute index of grid source 
    1188     checkMaskIndex(false); 
     1188    transformGridSrc->checkMaskIndex(false); 
    11891189  } 
    11901190 
  • XIOS/trunk/src/node/grid.hpp

    r623 r632  
    187187         CGridTransformation* getTransformations(); 
    188188 
    189          void transformGrid(CGrid* transformedGrid); 
     189         void transformGrid(CGrid* transformGridSrc); 
    190190         bool isTransformed(); 
    191191         void setTransformed(); 
  • XIOS/trunk/src/transformation/grid_transformation.hpp

    r631 r632  
    4242  const std::map<int, CArray<int,1>* >& getLocalIndexToSendFromGridSource() const; 
    4343  const std::map<int, std::vector<std::vector<std::pair<int,double> > > >& getLocalIndexToReceiveOnGridDest() const; 
     44  CGrid* getGridSource() {return gridSource_; } 
     45  CGrid* getGridDestination() { return gridDestination_; } 
    4446 
    4547private: 
Note: See TracChangeset for help on using the changeset viewer.