Ignore:
Timestamp:
07/05/16 15:59:18 (5 years ago)
Author:
mhnguyen
Message:

Removing some redundant codes and make some minor improvements

+) Make a check to not do grid generation twice

Test
+) On Curie
+) On test compilation

File:
1 edited

Legend:

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

    r887 r890  
    3434      , transformations_(0), isTransformed_(false) 
    3535      , axisPositionInGrid_(), positionDimensionDistributed_(1), hasDomainAxisBaseRef_(false) 
    36       , gridSrc_(), hasTransform_(false), order_(), globalIndexOnServer_() 
     36      , gridSrc_(), hasTransform_(false), isGenerated_(false), order_(), globalIndexOnServer_() 
    3737   { 
    3838     setVirtualDomainGroup(); 
     
    5252      , transformations_(0), isTransformed_(false) 
    5353      , axisPositionInGrid_(), positionDimensionDistributed_(1), hasDomainAxisBaseRef_(false) 
    54       , gridSrc_(), hasTransform_(false), order_(), globalIndexOnServer_() 
     54      , gridSrc_(), hasTransform_(false), isGenerated_(false), order_(), globalIndexOnServer_() 
    5555   { 
    5656     setVirtualDomainGroup(); 
     
    707707   } 
    708708 
    709 //   CGrid* CGrid::createGrid(StdString id, const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    710 //                            const CArray<int,1>& axisDomainOrder) 
    711 //   { 
    712 //      if (axisDomainOrder.numElements() > 0 && axisDomainOrder.numElements() != (domains.size() + axis.size())) 
    713 //        ERROR("CGrid* CGrid::createGrid(...)", 
    714 //              << "The size of axisDomainOrder (" << axisDomainOrder.numElements() 
    715 //              << ") is not coherent with the number of elements (" << domains.size() + axis.size() <<")."); 
    716 // 
    717 //      CGrid* grid = CGridGroup::get("grid_definition")->createChild(id); 
    718 //      grid->setDomainList(domains); 
    719 //      grid->setAxisList(axis); 
    720 // 
    721 //      // By default, domains are always the first elements of a grid 
    722 //      if (0 == axisDomainOrder.numElements()) 
    723 //      { 
    724 //        int size = domains.size() + axis.size(); 
    725 //        grid->axis_domain_order.resize(size); 
    726 //        for (int i = 0; i < size; ++i) 
    727 //        { 
    728 //          if (i < domains.size()) grid->axis_domain_order(i) = 2; 
    729 //          else grid->axis_domain_order(i) = 1; 
    730 //        } 
    731 //      } 
    732 //      else 
    733 //      { 
    734 //        grid->axis_domain_order.resize(axisDomainOrder.numElements()); 
    735 //        grid->axis_domain_order = axisDomainOrder; 
    736 //      } 
    737 // 
    738 //      grid->solveDomainAxisRefInheritance(true); 
    739 // 
    740 //      return grid; 
    741 //   } 
    742  
    743709   CGrid* CGrid::createGrid(StdString id, const std::vector<CDomain*>& domains, const std::vector<CAxis*>& axis, 
    744710                            const std::vector<CScalar*>& scalars, const CArray<int,1>& axisDomainOrder) 
     
    10401006    list<CMessage> listMsg; 
    10411007    list<CArray<size_t,1> > listOutIndex; 
    1042 //    const CClientServerMapping::GlobalIndexMap& globalIndexOnServer = clientServerMap_->getGlobalIndexOnServer(); 
    1043 //    const CClientServerMapping::GlobalIndexMap& globalIndexOnServer = clientServerMap_->getGlobalIndexOnServer(); 
    10441008    const CDistributionClient::GlobalLocalDataMap& globalLocalIndexSendToServer = clientDistribution_->getGlobalLocalDataSendToServer(); 
    10451009    CDistributionClient::GlobalLocalDataMap::const_iterator itIndex = globalLocalIndexSendToServer.begin(), 
     
    17351699    } 
    17361700 
     1701    if (isGenerated()) return; 
     1702    setGenerated(); 
     1703 
    17371704    CGridGenerate gridGenerate(this, transformGridSrc); 
    17381705    gridGenerate.completeGrid(); 
     1706  } 
     1707 
     1708  bool CGrid::isGenerated() 
     1709  { 
     1710    return isGenerated_; 
     1711  } 
     1712 
     1713  void CGrid::setGenerated() 
     1714  { 
     1715    isGenerated_ = true; 
    17391716  } 
    17401717 
Note: See TracChangeset for help on using the changeset viewer.