Ignore:
Timestamp:
08/20/21 14:38:23 (3 years ago)
Author:
ymipsl
Message:

New functionnality : domain, axis and scalar can now be retrieve with new syntax id :
ex. for domain :

id="domainId" : old syntax, working as before
id="fieldId::domainId" : get the domain related to "domainId" associated to the field "fieldId", work if only 1 domain related to domainId is associated to the field.
id="fieldId::domainId[n]" : get the nth domain related to "domainId" associated to the field "fieldId"
id="fieldId::" : get the domain associated the the field "fieldId, work if grid associated to th field is composed with exactly 1 domain (and possibly other components axis or scalars)
id="fieldId::[n] : get the nth domain composing the grid associated to the field

YM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/dev_ym/XIOS_COUPLING/src/object_template_impl.hpp

    r1875 r2203  
    157157   } 
    158158 
     159   // --------------------------------------------------------------- 
     160   template <class T> 
     161   void CObjectTemplate<T>::setInheritedId(T* obj) 
     162   { 
     163     if (!hasInheritedId_) 
     164     { 
     165       if (!(hasId() && !hasAutoGeneratedId()))  
     166        if (obj->hasId() && !obj->hasAutoGeneratedId())  
     167        { 
     168          hasInheritedId_=true ; 
     169          inheritedId_=obj->getId() ; 
     170        }  
     171     } 
     172   } 
     173 
     174   template <class T> 
     175   void CObjectTemplate<T>::setTemplateId(T* obj) 
     176   { 
     177     if (hasId() && !hasAutoGeneratedId()) 
     178     { 
     179        templateId_ = getId() ; 
     180        hasTemplateId_ = true ; 
     181     } 
     182     else if (obj->hasId() && !obj->hasAutoGeneratedId()) 
     183     { 
     184       templateId_ = obj->getId() ; 
     185       hasTemplateId_ = true ; 
     186     } 
     187     else if (obj->hasTemplateId()) 
     188     { 
     189       templateId_= obj->getTemplateId() ; 
     190       hasTemplateId_=true ; 
     191     } 
     192   } 
     193    
     194    
    159195   //--------------------------------------------------------------- 
    160196 
Note: See TracChangeset for help on using the changeset viewer.