Changeset 897


Ignore:
Timestamp:
07/11/16 17:36:11 (5 years ago)
Author:
mhnguyen
Message:

Fixing bug in transformation selector

+) If grid source and grid destination are the same (case of special transformations)
we still check transformation list

Location:
XIOS/trunk/src/transformation
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/transformation/grid_transformation_selector.cpp

    r889 r897  
    1414 
    1515CGridTransformationSelector::CGridTransformationSelector(CGrid* destination, CGrid* source, TransformationType type) 
    16  : gridSource_(source), gridDestination_(destination), 
     16 : gridSource_(source), gridDestination_(destination), isSameGrid_(false), 
    1717  listAlgos_(), algoTypes_(), nbNormalAlgos_(0), nbSpecialAlgos_(0), auxInputs_() 
    1818{ 
    19   if (0 == source) gridSource_ = gridDestination_; 
     19  if (0 == source) 
     20  {  gridSource_ = gridDestination_; isSameGrid_ = true; } 
    2021 
    2122  //Verify the compatibity between two grids 
     
    162163    // If source and destination grid share the same scalar 
    163164    if ((-1 != scalarDstPos) && (-1 != scalarSrcPos) && 
    164         (scalarListDestP[scalarDstPos] == scalarListSrcP[scalarSrcPos])) return; 
     165        (scalarListDestP[scalarDstPos] == scalarListSrcP[scalarSrcPos]) && !isSameGrid_) return; 
    165166 
    166167    if (scalarListDestP[scalarDstPos]->hasTransformation()) 
     
    203204    // If source and destination grid share the same axis 
    204205    if ((-1 != axisDstPos) && (-1 != axisSrcPos) && 
    205         (axisListDestP[axisDstPos] == axisListSrcP[axisSrcPos])) return; 
     206        (axisListDestP[axisDstPos] == axisListSrcP[axisSrcPos]) && !isSameGrid_) return; 
    206207 
    207208    if (axisListDestP[axisDstPos]->hasTransformation()) 
     
    243244    // If source and destination grid share the same domain 
    244245    if ((-1 != domDstPos) && (-1 != domSrcPos) && 
    245         (domListDestP[domDstPos] == domListSrcP[domSrcPos])) return; 
     246        (domListDestP[domDstPos] == domListSrcP[domSrcPos]) && !isSameGrid_) return; 
    246247 
    247248    if (domListDestP[domDstPos]->hasTransformation()) 
  • XIOS/trunk/src/transformation/grid_transformation_selector.hpp

    r889 r897  
    7070  CGrid* gridDestination_; 
    7171 
     72  //! Grid source and grid destination it's the same 
     73  bool isSameGrid_; 
     74 
    7275protected: 
    7376  //! List of algorithm types and their order 
Note: See TracChangeset for help on using the changeset viewer.