Changeset 1980 for XIOS/trunk/src/node


Ignore:
Timestamp:
11/24/20 11:33:59 (3 years ago)
Author:
yushan
Message:

trunk : axis interpolate can have coordinate source (coordinate_src) and coordinate destination (coordinate_dst), while previous attribute coordinate compatible to source

File:
1 edited

Legend:

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

    r937 r1980  
    4141  { 
    4242    if (this->order.isEmpty()) this->order.setValue(1); 
     43    if (this->coordinate.isEmpty() && !this->coordinate_src.isEmpty()) this->coordinate.setValue(this->coordinate_src.getValue()); 
     44    if (this->coordinate_src.isEmpty() && !this->coordinate.isEmpty()) this->coordinate_src.setValue(this->coordinate.getValue()); 
    4345    int order = this->order.getValue(); 
    4446    if (order >= axisSrc->n_glo.getValue()) 
     
    6769               << "Please define one"); 
    6870    } 
     71     
     72    if (!this->coordinate_dst.isEmpty()) 
     73    { 
     74      StdString coordinate = this->coordinate_dst.getValue(); 
     75      if (!CField::has(coordinate)) 
     76        ERROR("CInterpolateAxis::checkValid(CAxis* axisSrc)", 
     77               << "Coordinate field whose id " << coordinate << "does not exist " 
     78               << "Please define one"); 
     79    } 
     80    
    6981  } 
    7082 
     
    7284  { 
    7385    std::vector<StdString> auxInputs; 
    74     if (!this->coordinate.isEmpty()) 
     86    if (!this->coordinate.isEmpty() && this->coordinate_src.isEmpty()) 
    7587    { 
    7688      StdString coordinate = this->coordinate.getValue(); 
     89      this->coordinate_src.setValue(coordinate); 
     90      if (!CField::has(coordinate)) 
     91        ERROR("CInterpolateAxis::checkValid(CAxis* axisSrc)", 
     92               << "Coordinate field whose id " << coordinate << "does not exist " 
     93               << "Please define one"); 
     94      auxInputs.push_back(coordinate); 
     95    } 
     96    if (!this->coordinate_src.isEmpty() || !this->coordinate.isEmpty()) 
     97    { 
     98      StdString coordinate = !this->coordinate.isEmpty()? this->coordinate.getValue():this->coordinate_src.getValue(); 
     99      this->coordinate.setValue(coordinate); 
     100      if (!CField::has(coordinate)) 
     101        ERROR("CInterpolateAxis::checkValid(CAxis* axisSrc)", 
     102               << "Coordinate field whose id " << coordinate << "does not exist " 
     103               << "Please define one"); 
     104      auxInputs.push_back(coordinate); 
     105    } 
     106     
     107    if (!this->coordinate_dst.isEmpty()) 
     108    { 
     109      StdString coordinate = this->coordinate_dst.getValue(); 
    77110      if (!CField::has(coordinate)) 
    78111        ERROR("CInterpolateAxis::checkValid(CAxis* axisSrc)", 
Note: See TracChangeset for help on using the changeset viewer.