Changeset 1875 for XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp
- Timestamp:
- 05/12/20 11:52:13 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/dev_ym/XIOS_COUPLING/src/node/scalar.cpp
r1870 r1875 68 68 69 69 } 70 71 /*!72 \brief Check if a scalar is completed73 Before make any scalar processing, we must be sure that all scalar informations have74 been sent, for exemple when reading a grid in a file or when grid elements are sent by an75 other context (coupling). So all direct reference of the scalar (scalar_ref) must be also completed76 \return true if scalar and scalar reference are completed77 */78 bool CScalar::checkIfCompleted(void)79 {80 if (hasDirectScalarReference()) if (!getDirectScalarReference()->checkIfCompleted()) return false;81 return isCompleted_ ;82 }83 84 /*!85 \brief Set a scalar as completed86 When all information about a scalar have been received, the scalar is tagged as completed and is87 suitable for processing88 */89 void CScalar::setCompleted(void)90 {91 if (hasDirectScalarReference()) getDirectScalarReference()->setCompleted() ;92 isCompleted_=true ;93 }94 95 /*!96 \brief Set a scalar as uncompleted97 When informations about a scalar are expected from a grid reading from file or coupling, the scalar is98 tagged as uncompleted and is not suitable for processing99 */100 void CScalar::setUncompleted(void)101 {102 if (hasDirectScalarReference()) getDirectScalarReference()->setUncompleted() ;103 isCompleted_=false ;104 }105 106 107 108 70 109 71 /*! … … 187 149 refScalar[i]->setTransformations(scalar->getAllTransformations()); 188 150 } 189 151 190 152 void CScalar::sendScalarToFileServer(CContextClient* client) 191 153 { 192 154 if (sendScalarToFileServer_done_.count(client)!=0) return ; 193 155 else sendScalarToFileServer_done_.insert(client) ; 194 195 156 StdString scalarDefRoot("scalar_definition"); 196 157 CScalarGroup* scalarPtr = CScalarGroup::get(scalarDefRoot); 197 158 this->sendAllAttributesToServer(client); 198 159 } 160 161 void CScalar::sendScalarToCouplerOut(CContextClient* client, const string& fieldId, int posInGrid) 162 { 163 if (sendScalarToCouplerOut_done_.count(client)!=0) return ; 164 else sendScalarToCouplerOut_done_.insert(client) ; 165 166 string scalarId="_scalar["+std::to_string(posInGrid)+"]_of_"+fieldId ; 167 168 if (!scalar_ref.isEmpty()) 169 { 170 auto scalar_ref_tmp=scalar_ref.getValue() ; 171 scalar_ref.reset() ; // remove the reference, find an other way to do that more cleanly 172 this->sendAllAttributesToServer(client, scalarId) ; 173 scalar_ref = scalar_ref_tmp ; 174 } 175 else this->sendAllAttributesToServer(client, scalarId) ; 176 177 178 this->sendAllAttributesToServer(client, scalarId); 179 } 180 181 void CScalar::makeAliasForCoupling(const string& fieldId, int posInGrid) 182 { 183 const string scalarId = "_scalar["+std::to_string(posInGrid)+"]_of_"+fieldId ; 184 this->createAlias(scalarId) ; 185 } 186 187 void CScalar::setContextClient(CContextClient* contextClient) 188 TRY 189 { 190 if (clientsSet.find(contextClient)==clientsSet.end()) 191 { 192 clients.push_back(contextClient) ; 193 clientsSet.insert(contextClient); 194 } 195 } 196 CATCH_DUMP_ATTR 199 197 /*! 200 198 Parse children nodes of a scalar in xml file.
Note: See TracChangeset
for help on using the changeset viewer.