Ignore:
Timestamp:
07/05/18 14:22:36 (6 years ago)
Author:
oabramkina
Message:

Bugfix for distributed axis with ghost points.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/distribution_client.cpp

    r1549 r1557  
    637637int CDistributionClient::getAxisIndex(const int& dataIndex, const int& dataBegin, const int& ni) 
    638638{ 
    639    int tempI = dataIndex + dataBegin; 
    640    return ((tempI)%ni); 
     639  if (ni == 0) 
     640  { 
     641    return -1; 
     642  } 
     643  int tempI = dataIndex + dataBegin; 
     644  if ((tempI < 0) || (tempI > ni)) 
     645    return -1; 
     646  else if (tempI == ni) 
     647    return tempI; 
     648  else 
     649    return ((tempI)%ni); 
    641650} 
    642651 
Note: See TracChangeset for help on using the changeset viewer.