Changeset 632
- Timestamp:
- 07/08/15 14:27:28 (9 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/node/field.cpp
r630 r632 797 797 if ((0 != gridRefOfFieldRef) && (relGridRef != gridRefOfFieldRef) && (!(relGridRef->isTransformed()))) 798 798 { 799 gridRefOfFieldRef->transformGrid(relGridRef);799 relGridRef->transformGrid(gridRefOfFieldRef); 800 800 filterSources_.push_back(fieldRef); 801 801 } … … 817 817 for (; itFilterSrc != iteFilterSrc; ++itFilterSrc) 818 818 { 819 if (0 != (*itFilterSrc)->grid->getTransformations())819 if (0 != grid->getTransformations()) 820 820 { 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(); 823 823 824 824 sendAndReceiveTransformedData(localIndexToSend, dataToSend, -
XIOS/trunk/src/node/grid.cpp
r631 r632 1161 1161 } 1162 1162 1163 void CGrid::transformGrid(CGrid* transform edGrid)1164 { 1165 if ( transformedGrid->isTransformed()) return;1166 transformedGrid->setTransformed();1167 if (axis_domain_order.numElements() != transform edGrid->axis_domain_order.numElements())1168 { 1169 ERROR("CGrid::transformGrid(CGrid* transform edGrid)",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)", 1170 1170 << "Two grids have different dimension size" 1171 << "Dimension of grid source" <<this->getId() << " is " << axis_domain_order.numElements() << std::endl1172 << "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()); 1173 1173 } 1174 1174 else … … 1176 1176 int ssize = axis_domain_order.numElements(); 1177 1177 for (int i = 0; i < ssize; ++i) 1178 if (axis_domain_order(i) != (transform edGrid->axis_domain_order)(i))1179 ERROR("CGrid::transformGrid(CGrid* transform edGrid)",1180 << "Grids " <<this->getId() <<" and " << transform edGrid->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() 1181 1181 << " don't have elements in the same order"); 1182 1182 } 1183 1183 1184 transformations_ = new CGridTransformation(t ransformedGrid, this);1184 transformations_ = new CGridTransformation(this, transformGridSrc); 1185 1185 transformations_->computeAll(); 1186 1186 1187 1187 // Ok, now need to compute index of grid source 1188 checkMaskIndex(false);1188 transformGridSrc->checkMaskIndex(false); 1189 1189 } 1190 1190 -
XIOS/trunk/src/node/grid.hpp
r623 r632 187 187 CGridTransformation* getTransformations(); 188 188 189 void transformGrid(CGrid* transform edGrid);189 void transformGrid(CGrid* transformGridSrc); 190 190 bool isTransformed(); 191 191 void setTransformed(); -
XIOS/trunk/src/transformation/grid_transformation.hpp
r631 r632 42 42 const std::map<int, CArray<int,1>* >& getLocalIndexToSendFromGridSource() const; 43 43 const std::map<int, std::vector<std::vector<std::pair<int,double> > > >& getLocalIndexToReceiveOnGridDest() const; 44 CGrid* getGridSource() {return gridSource_; } 45 CGrid* getGridDestination() { return gridDestination_; } 44 46 45 47 private:
Note: See TracChangeset
for help on using the changeset viewer.