Ignore:
Timestamp:
11/05/20 15:53:27 (4 years ago)
Author:
ymipsl
Message:

Big cleaning on XIOS coupling branch
YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp

    r1973 r1974  
    12431243      for (unsigned int i = 0; i < this->enabledReadModeFiles.size(); ++i) 
    12441244        (void)this->enabledReadModeFiles[i]->readAttributesOfEnabledFieldsInReadMode(); 
    1245    } 
    1246    CATCH_DUMP_ATTR 
    1247  
    1248    void CContext::sendGridComponentEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
    1249    TRY 
    1250    { 
    1251      int size = activeFiles.size(); 
    1252      for (int i = 0; i < size; ++i) 
    1253      {        
    1254        activeFiles[i]->sendGridComponentOfEnabledFields(); 
    1255      } 
    1256    } 
    1257    CATCH_DUMP_ATTR 
    1258  
    1259    /*! 
    1260       Send active (enabled) fields in file from a client to others 
    1261       \param [in] activeFiles files contains enabled fields to send 
    1262    */ 
    1263    void CContext::sendGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
    1264    TRY 
    1265    { 
    1266      int size = activeFiles.size(); 
    1267      for (int i = 0; i < size; ++i) 
    1268      {        
    1269        activeFiles[i]->sendGridOfEnabledFields(); 
    1270      } 
    1271    } 
    1272    CATCH_DUMP_ATTR 
    1273  
    1274    void CContext::checkGridEnabledFields() 
    1275    TRY 
    1276    { 
    1277      int size = enabledFiles.size(); 
    1278      for (int i = 0; i < size; ++i) 
    1279      { 
    1280        enabledFiles[i]->checkGridOfEnabledFields();        
    1281      } 
    1282  
    1283      size = enabledCouplerOut.size(); 
    1284      for (int i = 0; i < size; ++i) 
    1285      { 
    1286        enabledCouplerOut[i]->checkGridOfEnabledFields();        
    1287      } 
    1288    } 
    1289    CATCH_DUMP_ATTR 
    1290  
    1291    /*! 
    1292       Check grid of active (enabled) fields in file  
    1293       \param [in] activeFiles files contains enabled fields whose grid needs checking 
    1294    */ 
    1295    void CContext::checkGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles) 
    1296    TRY 
    1297    { 
    1298      int size = activeFiles.size(); 
    1299      for (int i = 0; i < size; ++i) 
    1300      { 
    1301        activeFiles[i]->checkGridOfEnabledFields();        
    1302      } 
    13031245   } 
    13041246   CATCH_DUMP_ATTR 
     
    21572099   CATCH_DUMP_ATTR 
    21582100 
    2159    //! Client side: Send information of reference grid of active fields 
    2160    void CContext::sendRefGrid(const std::vector<CFile*>& activeFiles) 
    2161    TRY 
    2162    { 
    2163      std::set<pair<StdString,CContextClient*>> gridIds; 
    2164  
    2165      int sizeFile = activeFiles.size(); 
    2166      CFile* filePtr(NULL); 
    2167  
    2168      // Firstly, find all reference grids of all active fields 
    2169      for (int i = 0; i < sizeFile; ++i) 
    2170      { 
    2171        filePtr = activeFiles[i]; 
    2172        std::vector<CField*> enabledFields = filePtr->getEnabledFields(); 
    2173        int sizeField = enabledFields.size(); 
    2174        for (int numField = 0; numField < sizeField; ++numField) 
    2175        { 
    2176          if (0 != enabledFields[numField]->getRelGrid()) 
    2177            gridIds.insert(make_pair(CGrid::get(enabledFields[numField]->getRelGrid())->getId(),enabledFields[numField]->getContextClient())); 
    2178        } 
    2179      } 
    2180  
    2181      // Create all reference grids on server side 
    2182      StdString gridDefRoot("grid_definition"); 
    2183      CGridGroup* gridPtr = CGridGroup::get(gridDefRoot); 
    2184      for (auto it = gridIds.begin(); it != gridIds.end(); ++it) 
    2185      { 
    2186        gridPtr->sendCreateChild(it->first,it->second); 
    2187        CGrid::get(it->first)->sendAllAttributesToServer(it->second); 
    2188        CGrid::get(it->first)->sendAllDomains(it->second); 
    2189        CGrid::get(it->first)->sendAllAxis(it->second); 
    2190        CGrid::get(it->first)->sendAllScalars(it->second); 
    2191      } 
    2192    } 
    2193    CATCH_DUMP_ATTR 
    2194  
     2101   
    21952102   //! Client side: Send information of reference domain, axis and scalar of active fields 
    21962103   void CContext::sendRefDomainsAxisScalars(const std::vector<CFile*>& activeFiles) 
Note: See TracChangeset for help on using the changeset viewer.