Changeset 1974 for XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp
- Timestamp:
- 11/05/20 15:53:27 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/context.cpp
r1973 r1974 1243 1243 for (unsigned int i = 0; i < this->enabledReadModeFiles.size(); ++i) 1244 1244 (void)this->enabledReadModeFiles[i]->readAttributesOfEnabledFieldsInReadMode(); 1245 }1246 CATCH_DUMP_ATTR1247 1248 void CContext::sendGridComponentEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles)1249 TRY1250 {1251 int size = activeFiles.size();1252 for (int i = 0; i < size; ++i)1253 {1254 activeFiles[i]->sendGridComponentOfEnabledFields();1255 }1256 }1257 CATCH_DUMP_ATTR1258 1259 /*!1260 Send active (enabled) fields in file from a client to others1261 \param [in] activeFiles files contains enabled fields to send1262 */1263 void CContext::sendGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles)1264 TRY1265 {1266 int size = activeFiles.size();1267 for (int i = 0; i < size; ++i)1268 {1269 activeFiles[i]->sendGridOfEnabledFields();1270 }1271 }1272 CATCH_DUMP_ATTR1273 1274 void CContext::checkGridEnabledFields()1275 TRY1276 {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_ATTR1290 1291 /*!1292 Check grid of active (enabled) fields in file1293 \param [in] activeFiles files contains enabled fields whose grid needs checking1294 */1295 void CContext::checkGridEnabledFieldsInFiles(const std::vector<CFile*>& activeFiles)1296 TRY1297 {1298 int size = activeFiles.size();1299 for (int i = 0; i < size; ++i)1300 {1301 activeFiles[i]->checkGridOfEnabledFields();1302 }1303 1245 } 1304 1246 CATCH_DUMP_ATTR … … 2157 2099 CATCH_DUMP_ATTR 2158 2100 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 2195 2102 //! Client side: Send information of reference domain, axis and scalar of active fields 2196 2103 void CContext::sendRefDomainsAxisScalars(const std::vector<CFile*>& activeFiles)
Note: See TracChangeset
for help on using the changeset viewer.