Ignore:
Timestamp:
03/23/16 16:10:45 (8 years ago)
Author:
mhnguyen
Message:

Implementing dynamic interpolation on axis

+) Change grid transformation to make it more flexible
+) Make some small improvements

Test
+) On Curie
+) All test pass

File:
1 edited

Legend:

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

    r630 r827  
    11#include "interpolate_axis.hpp" 
    22#include "type.hpp" 
     3#include "field.hpp" 
    34 
    45namespace xios { 
     
    2324  ENodeType CInterpolateAxis::GetType(void)    { return eInterpolateAxis; } 
    2425 
    25   void CInterpolateAxis::checkValid(CAxis* axisDest) 
     26  void CInterpolateAxis::checkValid(CAxis* axisSrc) 
    2627  { 
     28    if (this->order.isEmpty()) this->order.setValue(2); 
     29    int order = this->order.getValue(); 
     30    if (order >= axisSrc->n_glo.getValue()) 
     31    { 
     32      ERROR("CInterpolateAxis::checkValid(CAxis* axisSrc)", 
     33             << "Order of interpolation is greater than global size of axis source" 
     34             << "Size of axis source " <<axisSrc->getId() << " is " << axisSrc->n_glo.getValue()  << std::endl 
     35             << "Order of interpolation is " << order ); 
     36    } 
     37 
     38 
     39    if (!this->coordinate.isEmpty()) 
     40    { 
     41      StdString coordinate = this->coordinate.getValue(); 
     42      if (!CField::has(coordinate)) 
     43        ERROR("CInterpolateAxis::checkValid(CAxis* axisSrc)", 
     44               << "Coordinate field whose id " << coordinate << "does not exist " 
     45               << "Please define one"); 
     46    } 
    2747  } 
    2848 
     49  std::vector<StdString> CInterpolateAxis::checkAuxInputs_() 
     50  { 
     51    std::vector<StdString> auxInputs; 
     52    if (!this->coordinate.isEmpty()) 
     53    { 
     54      StdString coordinate = this->coordinate.getValue(); 
     55      if (!CField::has(coordinate)) 
     56        ERROR("CInterpolateAxis::checkValid(CAxis* axisSrc)", 
     57               << "Coordinate field whose id " << coordinate << "does not exist " 
     58               << "Please define one"); 
     59      auxInputs.push_back(coordinate); 
     60    } 
     61 
     62    return auxInputs; 
     63  } 
    2964} 
Note: See TracChangeset for help on using the changeset viewer.