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

Adding a new type of element into grid: Scalar

+) Add a new node Scalar for xml
+) Make some change on writing scalar value
+) Reorganize some codes
+) Remove some redundant codes

Test
+) On Curie
+) All tests pass

File:
1 edited

Legend:

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

    r823 r887  
    10271027       CGrid::get(*it)->sendAllDomains(); 
    10281028       CGrid::get(*it)->sendAllAxis(); 
     1029       CGrid::get(*it)->sendAllScalars(); 
    10291030     } 
    10301031   } 
     
    10341035   void CContext::sendRefDomainsAxis() 
    10351036   { 
    1036      std::set<StdString> domainIds; 
    1037      std::set<StdString> axisIds; 
     1037     std::set<StdString> domainIds, axisIds, scalarIds; 
    10381038 
    10391039     // Find all reference domain and axis of all active fields 
     
    10451045       for (int j = 0; j < numEnabledFields; ++j) 
    10461046       { 
    1047          const std::pair<StdString, StdString>& prDomAxisId = enabledFields[j]->getRefDomainAxisIds(); 
    1048          if ("" != prDomAxisId.first) domainIds.insert(prDomAxisId.first); 
    1049          if ("" != prDomAxisId.second) axisIds.insert(prDomAxisId.second); 
     1047         const std::vector<StdString>& prDomAxisScalarId = enabledFields[j]->getRefDomainAxisIds(); 
     1048         if ("" != prDomAxisScalarId[0]) domainIds.insert(prDomAxisScalarId[0]); 
     1049         if ("" != prDomAxisScalarId[1]) axisIds.insert(prDomAxisScalarId[1]); 
     1050         if ("" != prDomAxisScalarId[2]) scalarIds.insert(prDomAxisScalarId[2]); 
    10501051       } 
    10511052     } 
    10521053 
    10531054     // Create all reference axis on server side 
    1054      std::set<StdString>::iterator itDom, itAxis; 
     1055     std::set<StdString>::iterator itDom, itAxis, itScalar; 
    10551056     std::set<StdString>::const_iterator itE; 
     1057 
     1058     StdString scalarDefRoot("scalar_definition"); 
     1059     CScalarGroup* scalarPtr = CScalarGroup::get(scalarDefRoot); 
     1060     itE = scalarIds.end(); 
     1061     for (itScalar = scalarIds.begin(); itScalar != itE; ++itScalar) 
     1062     { 
     1063       if (!itScalar->empty()) 
     1064       { 
     1065         scalarPtr->sendCreateChild(*itScalar); 
     1066         CScalar::get(*itScalar)->sendAllAttributesToServer(); 
     1067       } 
     1068     } 
    10561069 
    10571070     StdString axiDefRoot("axis_definition"); 
Note: See TracChangeset for help on using the changeset viewer.