Changeset 621
- Timestamp:
- 06/22/15 13:36:21 (9 years ago)
- Location:
- XIOS/trunk
- Files:
-
- 8 added
- 1 deleted
- 26 edited
- 4 moved
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/inputs/Version2/iodef.xml
r620 r621 11 11 <field id="field_Axis" operation="average" freq_op="3600s" grid_ref="grid_Axis" /> 12 12 <field id="field_Two_Axis" operation="average" freq_op="3600s" grid_ref="grid_Two_Axis" /> 13 <field id="field_Axis_transformed" operation="average" freq_op="3600s" field_ref="field_A xis" grid_ref="grid_Axis_tranformed" />13 <field id="field_Axis_transformed" operation="average" freq_op="3600s" field_ref="field_A" grid_ref="grid_Axis_tranformed" /> 14 14 <field id="field_All_Axis" operation="average" freq_op="3600s" grid_ref="grid_All_Axis" /> 15 15 <field id="field_Scalar" operation="average" freq_op="3600s" grid_ref="ScalarGrid" /> … … 39 39 <axis id="axis_A" /> 40 40 <axis id="axis_B" /> 41 <axis id="axis_C" zoom_size="2" zoom_end="2"/>41 <axis id="axis_C" /> 42 42 <axis id="axis_D" /> 43 <axis id="axis_E" axis_ref="axis_D"> 44 <transformation type="inverse" /> 43 <axis id="axis_E" axis_ref="axis_C"> 45 44 <!-- <transformation type="zoom" />--> 45 <inverse_axis /> 46 <!-- <zoom_axis zoom_begin=1 zoom_size=1 />--> 46 47 </axis> 47 48 </axis_definition> … … 65 66 </grid> 66 67 <grid id="grid_Axis_tranformed"> 68 <domain domain_ref="domain_A" /> 67 69 <!-- <axis axis_ref="axis_A" />--> 70 <!-- <axis axis_ref="axis_B" />--> 68 71 <axis axis_ref="axis_E" /> 69 72 </grid> -
XIOS/trunk/src/config/node_type.conf
r619 r621 31 31 #endif //__XIOS_CCalendarWrapper__ 32 32 33 #ifdef __XIOS_CTransformation__ 34 DECLARE_NODE(Transformation, transformation) 35 #endif //__XIOS_CTransformation__ 33 #ifdef __XIOS_CInverseAxis__ 34 DECLARE_NODE(InverseAxis, inverse_axis) 35 #endif //__XIOS_CInverseAxis__ 36 37 #ifdef __XIOS_CZoomAxis__ 38 DECLARE_NODE(ZoomAxis, zoom_axis) 39 #endif //__XIOS_CZoomAxis__ 36 40 37 41 #ifdef __XIOS_CContext__ -
XIOS/trunk/src/filter/axis_algorithm_transformation.cpp
r620 r621 1 1 #include "axis_algorithm_transformation.hpp" 2 #include "axis_inverse.hpp" 3 #include "axis_zoom.hpp" 2 4 3 5 namespace xios { 4 6 5 CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination )7 CAxisAlgorithmTransformation::CAxisAlgorithmTransformation(CAxis* axisDestination, CAxis* axisSource, std::vector<ETranformationType>& algos) 6 8 : CGenericAlgorithmTransformation() 7 9 { 8 int niDest = axisDestination->ni.getValue(); 9 int ibeginDest = axisDestination->ibegin.getValue(); 10 for (int idx = 0; idx < algos.size(); ++idx) 11 { 12 switch (algos[idx]) 13 { 14 case TRANS_ZOOM_AXIS: 15 algosOfAnAxis_.push_back(new CAxisZoom(axisDestination, axisSource)); 16 break; 17 case TRANS_INVERSE_AXIS: 18 algosOfAnAxis_.push_back(new CAxisInverse(axisDestination, axisSource)); 19 break; 20 default: 21 break; 22 } 23 } 24 computeIndexSourceMapping(); 25 } 10 26 11 for (int idx = 0; idx < niDest; ++idx) axisDestGlobalIndex_.push_back(ibeginDest+idx); 27 CAxisAlgorithmTransformation::~CAxisAlgorithmTransformation() 28 { 29 for (int idx = 0; idx < algosOfAnAxis_.size(); ++idx) delete algosOfAnAxis_[idx]; 30 } 31 32 void CAxisAlgorithmTransformation::computeIndexSourceMapping() 33 { 34 if (!algosOfAnAxis_.empty()) 35 { 36 algosOfAnAxis_[0]->computeIndexSourceMapping(this->transformationMapping_); 37 for (int idx = 1; idx < algosOfAnAxis_.size(); ++idx) 38 { 39 algosOfAnAxis_[idx]->computeIndexSourceMapping(algosOfAnAxis_[idx-1]->getTransformationMapping()); 40 } 41 this->transformationMapping_ = algosOfAnAxis_[algosOfAnAxis_.size()-1]->getTransformationMapping(); 42 } 12 43 } 13 44 -
XIOS/trunk/src/filter/axis_algorithm_transformation.hpp
r620 r621 4 4 #include "generic_algorithm_transformation.hpp" 5 5 #include "axis.hpp" 6 #include "concrete_algo.hpp" 6 7 7 8 namespace xios { … … 10 11 { 11 12 public: 12 CAxisAlgorithmTransformation(CAxis* axisDestination); 13 virtual ~CAxisAlgorithmTransformation() {} 13 CAxisAlgorithmTransformation(CAxis* axisDestination, CAxis* axisSource, std::vector<ETranformationType>&); 14 15 virtual ~CAxisAlgorithmTransformation(); 14 16 15 17 protected: … … 21 23 CArray<size_t,1>& globalIndexDestGrid, 22 24 std::vector<CArray<size_t,1> >& globalIndexSrcGrid); 23 virtual void computeIndexSourceMapping() = 0; 24 25 void computeIndexSourceMapping(); 25 26 protected: 26 std::vector< int> axisDestGlobalIndex_;27 std::vector<CConcreteAlgo*> algosOfAnAxis_; 27 28 28 29 }; -
XIOS/trunk/src/filter/axis_inverse.cpp
r620 r621 4 4 5 5 CAxisInverse::CAxisInverse(CAxis* axisDestination, CAxis* axisSource) 6 : C AxisAlgorithmTransformation(axisDestination)6 : CConcreteAlgo() 7 7 { 8 8 if (axisDestination->size.getValue() != axisSource->size.getValue()) … … 14 14 } 15 15 16 16 17 axisDestGlobalSize_ = axisDestination->size.getValue(); 18 int niDest = axisDestination->ni.getValue(); 19 int ibeginDest = axisDestination->ibegin.getValue(); 17 20 18 this->computeIndexSourceMapping();21 for (int idx = 0; idx < niDest; ++idx) axisDestGlobalIndex_.push_back(ibeginDest+idx); 19 22 } 20 23 21 void CAxisInverse::computeIndexSourceMapping( )24 void CAxisInverse::computeIndexSourceMapping(const std::map<int, std::vector<int> >& transformationMappingOfPreviousAlgo) 22 25 { 23 26 std::map<int, std::vector<int> >& transMap = this->transformationMapping_; 24 if (!transMap.empty()) transMap.clear(); 25 26 int globalIndexSize = axisDestGlobalIndex_.size(); 27 for (int idx = 0; idx < globalIndexSize; ++idx) 28 transMap[axisDestGlobalIndex_[idx]].push_back(axisDestGlobalSize_-axisDestGlobalIndex_[idx]-1); 27 if (transformationMappingOfPreviousAlgo.empty()) 28 { 29 int globalIndexSize = axisDestGlobalIndex_.size(); 30 for (int idx = 0; idx < globalIndexSize; ++idx) 31 transMap[axisDestGlobalIndex_[idx]].push_back(axisDestGlobalSize_-axisDestGlobalIndex_[idx]-1); 32 } 33 else 34 { 35 std::map<int, std::vector<int> >::const_iterator itb = transformationMappingOfPreviousAlgo.begin(), it, 36 ite = transformationMappingOfPreviousAlgo.end(); 37 for (it = itb; it != ite; ++it) 38 { 39 transMap[it->first].push_back(axisDestGlobalSize_-it->first-1); 40 } 41 } 29 42 } 30 43 31 32 44 } -
XIOS/trunk/src/filter/axis_inverse.hpp
r620 r621 2 2 #define __XIOS_AXIS_ALGORITHM_INVERSE_HPP__ 3 3 4 #include " axis_algorithm_transformation.hpp"4 #include "concrete_algo.hpp" 5 5 #include "axis.hpp" 6 6 7 7 namespace xios { 8 8 9 class CAxisInverse : public C AxisAlgorithmTransformation9 class CAxisInverse : public CConcreteAlgo 10 10 { 11 11 public: … … 13 13 14 14 virtual ~CAxisInverse() {} 15 16 virtual void computeIndexSourceMapping(const std::map<int, std::vector<int> >& transformationMappingOfPreviousAlgo); 17 15 18 protected: 16 virtual void computeIndexSourceMapping();19 std::vector<int> axisDestGlobalIndex_; 17 20 18 21 private: -
XIOS/trunk/src/filter/grid_transformation.cpp
r620 r621 2 2 #include "axis_inverse.hpp" 3 3 #include "transformation_mapping.hpp" 4 #include "transformation_enum.hpp" 5 #include "axis_algorithm_transformation.hpp" 4 6 5 7 namespace xios { … … 86 88 if (axisListDestP[i]->hasTransformation()) 87 89 { 88 CGenericAlgorithmTransformation* algo = new CAxisInverse(axisListDestP[i], axisListSrcP[i]); 90 CGenericAlgorithmTransformation* algo = 0; 91 CAxis::TransMapTypes trans = axisListDestP[i]->getAllTransformations(); 92 CAxis::TransMapTypes::const_iterator itb = trans.begin(), it, 93 ite = trans.end(); 94 std::vector<ETranformationType> algoAxis; 95 for (it = itb; it != ite; ++it) 96 { 97 algoAxis.push_back(it->first); 98 } 99 algo = new CAxisAlgorithmTransformation(axisListDestP[i], axisListSrcP[i], algoAxis); 89 100 algoTransformation_[axisPositionInGrid[i]].push_back(algo); 90 101 } … … 98 109 } 99 110 111 /*! 112 Compute index mapping representing transformation between two grids 113 Each domain and each axis can contain some information of transformation, these information are then converted into 114 form of global index mapping reprensenting transformation between two grids. 115 */ 100 116 void CGridTransformation::computeTransformation() 101 117 { … … 122 138 } 123 139 140 /*! 141 Compute transformation mapping between grid source and grid destination 142 The transformation between grid source and grid destination is represented in form of mapping between global index 143 of two grids. Then local index mapping between data on each grid will be found out thanks to these global indexes 144 */ 124 145 void CGridTransformation::computeTransformationMapping() 125 146 { … … 141 162 CArray<size_t,1> globalIndexOnClientSrc = gridSource_->getDistributionClient()->getGlobalDataIndexSendToServer(); 142 163 143 144 164 std::vector<size_t>::const_iterator itbVec, itVec, iteVec; 145 165 CArray<size_t, 1>::iterator itbArr, itArr, iteArr; 146 166 147 167 std::map<int,std::vector<std::vector<size_t> > >::const_iterator itbMapRecv, itMapRecv, iteMapRecv; 168 148 169 // Find out local index on grid destination (received) 149 170 itbMapRecv = globalIndexToReceive.begin(); … … 166 187 { 167 188 int localIdx = std::distance(itbArr, itArr); 168 (*localIndexToReceiveOnGridDest_[sourceRank][i])(idx) = localIndexOnClientDest(localIdx); 189 // (*localIndexToReceiveOnGridDest_[sourceRank][i])(idx) = localIndexOnClientDest(localIdx); // Local index of un-extracted data (only domain) 190 (*localIndexToReceiveOnGridDest_[sourceRank][i])(idx) = (localIdx); // Local index of extracted data 169 191 } 170 192 } 171 193 } 172 173 194 } 174 195 … … 183 204 CArray<int,1>* ptr = new CArray<int,1>((itMap->second).size()); 184 205 localIndexToSendFromGridSource_[itMap->first] = ptr; 206 int destRank = itMap->first; 185 207 int vecSize = (itMap->second).size(); 186 208 for (int idx = 0; idx < vecSize; ++idx) … … 190 212 { 191 213 int localIdx = std::distance(itbArr, itArr); 192 (*localIndexToSendFromGridSource_[itMap->first])(idx) = localIndexOnClientSrc(localIdx); 193 } 194 } 195 } 196 } 197 214 // (*localIndexToSendFromGridSource_[destRank])(idx) = localIndexOnClientSrc(localIdx); 215 (*localIndexToSendFromGridSource_[destRank])(idx) = (localIdx); 216 } 217 } 218 } 219 } 220 221 /*! 222 Local index of data which need sending from the grid source 223 \return local index of data 224 */ 198 225 std::map<int, CArray<int,1>* > CGridTransformation::getLocalIndexToSendFromGridSource() 199 226 { … … 201 228 } 202 229 230 /*! 231 Local index of data which will be received on the grid destination 232 \return local index of data 233 */ 203 234 std::map<int, std::vector<CArray<int,1>* > > CGridTransformation::getLocalIndexToReceiveOnGridDest() 204 235 { -
XIOS/trunk/src/filter/transformation_mapping.cpp
r620 r621 33 33 /*! 34 34 Suppose that we have transformations between two grids, which are represented in form of mapping between global indexes of these two grids, 35 this function tries to find out which clients a client need to send and receive these global indexes to accomplish the transformations.35 this function tries to find out which clients a client needs to send and receive these global indexes to accomplish the transformations. 36 36 The grid destination is the grid whose global indexes demande global indexes from the grid source 37 37 Grid destination and grid source are also distributed among clients but in a different manner. -
XIOS/trunk/src/group_factory_decl.cpp
r619 r621 25 25 macro(CContextGroup) 26 26 macro(CVariableGroup) 27 macro(CTransformationGroup) 27 macro(CInverseAxisGroup) 28 macro(CZoomAxisGroup) 28 29 } -
XIOS/trunk/src/group_template_decl.cpp
r619 r621 14 14 macro(Axis) 15 15 macro(Variable) 16 macro(Transformation) 16 macro(InverseAxis) 17 macro(ZoomAxis) 17 18 18 19 -
XIOS/trunk/src/node/axis.cpp
r620 r621 18 18 , CAxisAttributes(), isChecked(false), relFiles(), baseRefObject(), areClientAttributesChecked_(false) 19 19 , isDistributed_(false) 20 { /* Ne rien faire de plus */ } 20 , transformationMap_() 21 { 22 } 21 23 22 24 CAxis::CAxis(const StdString & id) … … 24 26 , CAxisAttributes(), isChecked(false), relFiles(), baseRefObject(), areClientAttributesChecked_(false) 25 27 , isDistributed_(false) 26 { /* Ne rien faire de plus */ } 28 , transformationMap_() 29 { 30 } 27 31 28 32 CAxis::~CAxis(void) … … 308 312 bool CAxis::hasTransformation() 309 313 { 310 return (!transformations_.empty()); 311 } 312 313 void CAxis::setTransformations(const std::vector<CTransformation*>& transformations) 314 { 315 transformations_ = transformations; 316 } 317 318 std::vector<CTransformation*> CAxis::getAllTransformations(void) 319 { 320 if (!hasTransformation()) 321 setTransformations(this->getVirtualTransformationGroup()->getAllChildren()); 322 323 return transformations_; 314 return (!transformationMap_.empty()); 315 } 316 317 void CAxis::setTransformations(const TransMapTypes& axisTrans) 318 { 319 transformationMap_ = axisTrans; 320 } 321 322 CAxis::TransMapTypes CAxis::getAllTransformations(void) 323 { 324 return transformationMap_; 325 } 326 327 /*! 328 Check the validity of all transformations applied on axis 329 This functions is called AFTER all inherited attributes are solved 330 */ 331 void CAxis::checkTransformations() 332 { 333 TransMapTypes::const_iterator itb = transformationMap_.begin(), it, 334 ite = transformationMap_.end(); 335 for (it = itb; it != ite; ++it) 336 { 337 (it->second)->checkValid(this); 338 } 324 339 } 325 340 … … 350 365 if (node.goToChildElement()) 351 366 { 352 StdString tranformation("transformation"); 367 StdString inverseAxisDefRoot("inverse_axis_definition"); 368 StdString inverse("inverse_axis"); 369 StdString zoomAxisDefRoot("zoom_axis_definition"); 370 StdString zoom("zoom_axis"); 353 371 do 354 372 { 355 if (node.getElementName() == tranformation) { 356 this->getVirtualTransformationGroup()->parseChild(node); 373 if (node.getElementName() == inverse) { 374 CInverseAxis* tmp = (CInverseAxisGroup::get(inverseAxisDefRoot))->createChild(); 375 tmp->parse(node); 376 transformationMap_[TRANS_INVERSE_AXIS] = tmp; 377 } else if (node.getElementName() == zoom) { 378 CZoomAxis* tmp = (CZoomAxisGroup::get(zoomAxisDefRoot))->createChild(); 379 tmp->parse(node); 380 transformationMap_[TRANS_ZOOM_AXIS] = tmp; 357 381 } 358 382 } while (node.goToNextElement()) ; 359 383 node.goToParentElement(); 360 384 } 361 setTransformations(this->getVirtualTransformationGroup()->getAllChildren());362 385 } 363 386 -
XIOS/trunk/src/node/axis.hpp
r620 r621 16 16 #include "transformation.hpp" 17 17 #include "transformation_enum.hpp" 18 #include "inverse_axis.hpp" 19 #include "zoom_axis.hpp" 18 20 19 21 namespace xios { … … 23 25 class CAxisAttributes; 24 26 class CAxis; 25 class CTransformationGroup;26 class CVirtualTransformationGroup;27 27 28 DECLARE_VIRTUAL_NODE(TransformationGroup);29 28 ///-------------------------------------------------------------- 30 29 … … 39 38 : public CObjectTemplate<CAxis> 40 39 , public CAxisAttributes 41 , public CVirtualTransformationGroup42 40 { 43 41 enum EEventId … … 54 52 typedef CAxisAttributes RelAttributes; 55 53 typedef CAxisGroup RelGroup; 54 typedef CTransformation<CAxis>::TransformationMapTypes TransMapTypes; 56 55 56 public: 57 57 /// Constructeurs /// 58 58 CAxis(void); … … 96 96 bool hasTransformation(); 97 97 void solveInheritanceTransformation(); 98 std::vector<CTransformation*>getAllTransformations();98 TransMapTypes getAllTransformations(); 99 99 100 100 public: … … 106 106 void checkMask(); 107 107 void checkZoom(); 108 void checkTransformations(); 109 void computeServerIndex(const std::vector<int>& globalDim, int orderPositionInGrid, 110 CServerDistributionDescription::ServerDistributionType disType); 108 111 109 112 110 111 void setTransformations(const std::vector<CTransformation*>&); 113 void setTransformations(const TransMapTypes&); 112 114 private: 113 115 bool isChecked; 114 116 bool areClientAttributesChecked_; 115 117 std::set<StdString> relFiles; 116 std::vector<CTransformation*> transformations_;118 TransMapTypes transformationMap_; 117 119 bool isDistributed_; 118 120 -
XIOS/trunk/src/node/field.cpp
r620 r621 31 31 , processed(false), domAxisIds_("", ""), areAllReferenceSolved(false), areAllExpressionBuilt(false), filter(0) 32 32 , isReadDataRequestPending(false) 33 , filterSources_(), algorithms_() 33 34 { setVirtualVariableGroup(); } 34 35 … … 44 45 , processed(false), domAxisIds_("", ""), areAllReferenceSolved(false), areAllExpressionBuilt(false), filter(0) 45 46 , isReadDataRequestPending(false) 47 , filterSources_(), algorithms_() 46 48 { setVirtualVariableGroup(); } 47 49 … … 804 806 gridRefOfFieldRef->transformGrid(relGridRef); 805 807 filterSources_.push_back(fieldRef); 806 // transformations_ = relGridRef->getTransformations();807 // switch (gridRefOfFieldRef->getGridElementType()) {808 // case CGrid::GRID_ONLY_AXIS:809 //// filter = new CAxisFilter(gridRefOfFieldRef, relGridRef);810 //// break;811 // default:812 // filter = new CAxisFilter(gridRefOfFieldRef, relGridRef);813 // break;814 // }815 // setAlgorithms();816 808 } 817 809 } 818 810 } 819 820 821 // void CField::setAlgorithms()822 // {823 // std::vector<ETransformationType>::iterator itTrans = transformations_.begin(),824 // iteTrans = transformations_.end();825 // std::set<ETransformationType> tmp;826 // for (; itTrans != iteTrans; ++itTrans)827 // {828 // if (tmp.end() == tmp.find(*itTrans))829 // {830 // switch (*itTrans) {831 // case eInverse:832 // algorithms_.push_back(new CInvertAlgorithm());833 // break;834 // default:835 // break;836 // }837 // }838 // tmp.insert(*itTrans);839 // }840 // }841 811 842 812 const std::vector<CField*>& CField::getFilterSources() … … 857 827 const std::map<int, CArray<int,1>* >& localIndexToSend = (*itFilterSrc)->grid->getTransformations()->getLocalIndexToSendFromGridSource(); 858 828 const std::map<int, std::vector<CArray<int,1>* > > localIndexToReceive = (*itFilterSrc)->grid->getTransformations()->getLocalIndexToReceiveOnGridDest(); 829 859 830 sendAndReceiveTransformedData(localIndexToSend, dataToSend, 860 831 localIndexToReceive, dataToReceive); … … 862 833 863 834 } 864 865 // std::cout << "it data " << (*it)->data << std::endl;866 // std::cout << "it filtered data " << (*it)->filteredData << std::endl;867 835 } 868 836 } -
XIOS/trunk/src/node/field.hpp
r620 r621 232 232 std::vector<CField*> filterSources_; 233 233 std::vector<CGenericAlgorithm*> algorithms_; 234 std::vector<ETransformationType> transformations_;235 234 DECLARE_REF_FUNC(Field,field) 236 235 -
XIOS/trunk/src/node/field_impl.hpp
r620 r621 38 38 { 39 39 (*itFilterSrc)->updateDataWithoutOperation(_data, (*itFilterSrc)->data); 40 (*it)->updateDataWithoutOperation(_data, (*it)->filteredData); 40 if ((*it)->filteredData.numElements() != (*it)->grid->storeIndex_client.numElements()) 41 { 42 (*it)->filteredData.resize((*it)->grid->storeIndex_client.numElements()); 43 } 41 44 (*it)->applyFilter((*itFilterSrc)->data, (*it)->filteredData); 42 45 } 43 46 if ((*it)->hasOutputFile || (*it)->hasFieldOut) (*it)->updateFilteredData((*it)->filteredData); 44 // itFilterSrc = fieldFilterSources.begin(); iteFilterSrc = fieldFilterSources.end();45 // for (; itFilterSrc != iteFilterSrc; ++itFilterSrc) (*itFilterSrc)->updateDataWithoutOperation(_data);46 // (*it)->applyFilter();47 // std::cout << "it data " << (*it)->data << std::endl;48 // std::cout << "it filtered data " << (*it)->filteredData << std::endl;49 // if ((*it)->hasOutputFile || (*it)->hasFieldOut) (*it)->updateFilteredData((*it)->filteredData);50 47 } 51 48 else … … 54 51 if (hasOutputFile || hasFieldOut) updateData(_data); 55 52 } 56 57 53 } 58 54 -
XIOS/trunk/src/node/grid.cpp
r620 r621 1152 1152 transformations_ = new CGridTransformation(transformedGrid, this); 1153 1153 transformations_->computeTransformationMapping(); 1154 std::cout << "send index " << *(transformations_->getLocalIndexToSendFromGridSource()[0]) << std::endl;1155 std::cout << "receive index " << *(transformations_->getLocalIndexToReceiveOnGridDest()[0][0]) << std::endl;1156 1154 } 1157 1155 -
XIOS/trunk/src/node/node_enum.hpp
r619 r621 19 19 eContext,gContext, 20 20 eCalendarWrapper, 21 eTransformation 22 21 eTransformation, 22 eInverseAxis, 23 eZoomAxis 23 24 //#include "node_type.conf" 24 25 -
XIOS/trunk/src/node/node_type.hpp
r619 r621 10 10 #include "context.hpp" 11 11 #include "transformation.hpp" 12 #include "inverse_axis.hpp" 13 #include "zoom_axis.hpp" 12 14 13 15 #endif // __XIOS_NODE_TYPE__ -
XIOS/trunk/src/node/transformation.hpp
r619 r621 2 2 #define __XMLIO_CTransformation__ 3 3 4 /// xios headers ///5 4 #include "xmlioserver_spl.hpp" 6 #include "attribute_enum.hpp" 7 #include "attribute_enum_impl.hpp" 8 #include "attribute_array.hpp" 9 #include "declare_attribute.hpp" 10 #include "object_template.hpp" 11 #include "group_factory.hpp" 12 #include "declare_group.hpp" 5 #include "transformation_enum.hpp" 13 6 14 7 namespace xios { 15 16 /// ////////////////////// Déclarations ////////////////////// ///17 class CTransformationGroup;18 class CTransformationAttributes;19 class CTransformation;20 ///--------------------------------------------------------------21 22 // Declare/Define CFileAttribute23 BEGIN_DECLARE_ATTRIBUTE_MAP(CTransformation)24 #include "transformation_attribute.conf"25 END_DECLARE_ATTRIBUTE_MAP(CTransformation)26 8 27 9 ///-------------------------------------------------------------- 28 10 /*! 29 11 \class CTransformation 30 This class describes transformationin xml file.12 This class describes inverse_axis in xml file. 31 13 */ 14 template<typename T> 32 15 class CTransformation 33 : public CObjectTemplate<CTransformation>34 , public CTransformationAttributes35 16 { 36 public : 37 enum TransformationId 38 { 39 TRANS_ID_ZOOM, TRANS_ID_INVERSE 40 }; 41 typedef CObjectTemplate<CTransformation> SuperClass; 42 typedef CTransformationAttributes SuperClassAttribute; 17 public: 18 typedef typename boost::unordered_map<ETranformationType, CTransformation<T>*, boost::hash<int> > TransformationMapTypes; 19 typedef TransformationMapTypes TransMapTypes; 43 20 44 21 public : 45 22 /// Constructeurs /// 46 CTransformation(void) ;47 explicit CTransformation(const StdString& id);23 CTransformation(void) {} 24 virtual void checkValid(T* dest) = 0; 48 25 49 26 /// Destructeur /// 50 virtual ~CTransformation(void); 51 52 /// Accesseurs statiques /// 53 static StdString GetName(void); 54 static StdString GetDefName(void); 55 static ENodeType GetType(void); 56 private: 57 static std::vector<StdString> TransformationTypes; 58 static std::vector<TransformationId> TransformationTypeIds; 59 60 public : 61 void checkAttributes(); 62 63 private: 64 void checkAttributesType(TransformationId& transType); 65 void checkAttributesZoomType(); 66 void checkAttributesInverseType(); 67 68 private: 27 virtual ~CTransformation(void) {} 69 28 }; // class CTransformation 70 29 71 DECLARE_GROUP(CTransformation);72 30 } // namespace xios 73 31 -
XIOS/trunk/src/node/transformation_enum.hpp
r619 r621 8 8 { 9 9 /// ////////////////////// Définitions ////////////////////// /// 10 typedef enum transformation Type10 typedef enum transformation_type 11 11 { 12 UnknownTransformation = 0, 13 eInverse, 14 eZoom 15 16 //#include "node_type.conf" 17 18 } ETransformationType; 12 TRANS_ZOOM_AXIS, 13 TRANS_INVERSE_AXIS 14 } ETranformationType; 19 15 20 16 } // namespace xios -
XIOS/trunk/src/object_factory_decl.cpp
r619 r621 24 24 macro(CCalendarWrapper) 25 25 macro(CVariable) 26 macro(CTransformation) 26 macro(CInverseAxis) 27 macro(CZoomAxis) 27 28 28 29 macro(CFieldGroup) … … 33 34 macro(CContextGroup) 34 35 macro(CVariableGroup) 35 macro(CTransformationGroup) 36 macro(CInverseAxisGroup) 37 macro(CZoomAxisGroup) 36 38 } -
XIOS/trunk/src/object_template_decl.cpp
r619 r621 9 9 #include "variable.hpp" 10 10 #include "transformation.hpp" 11 11 #include "inverse_axis.hpp" 12 #include "zoom_axis.hpp" 12 13 13 14 namespace xios … … 21 22 template class CObjectTemplate<CAxis>; 22 23 template class CObjectTemplate<CVariable>; 23 template class CObjectTemplate<CTransformation>; 24 template class CObjectTemplate<CInverseAxis>; 25 template class CObjectTemplate<CZoomAxis>; 24 26 25 27 template class CObjectTemplate<CContextGroup>; … … 30 32 template class CObjectTemplate<CAxisGroup>; 31 33 template class CObjectTemplate<CVariableGroup>; 32 template class CObjectTemplate<CTransformationGroup>; 34 template class CObjectTemplate<CInverseAxisGroup>; 35 template class CObjectTemplate<CZoomAxisGroup>; 33 36 } -
XIOS/trunk/src/test/test_new_features.f90
r620 r621 17 17 INTEGER,PARAMETER :: ni_glo=5 18 18 INTEGER,PARAMETER :: nj_glo=5 19 INTEGER,PARAMETER :: llm= 519 INTEGER,PARAMETER :: llm=2 20 20 DOUBLE PRECISION :: lval(llm)=1, tsTemp 21 21 TYPE(xios_field) :: field_hdl … … 155 155 DO ts=1,24*10 156 156 CALL xios_update_calendar(ts) 157 !CALL xios_send_field("field_A",field_A)157 CALL xios_send_field("field_A",field_A) 158 158 CALL xios_send_field("field_Axis",field_Axis) 159 159 160 160 CALL xios_send_field("field_Two_Axis",field_Two_Axis) 161 !CALL xios_send_field("field_All_Axis",field_All_Axis)161 CALL xios_send_field("field_All_Axis",field_All_Axis) 162 162 ! tsTemp = ts 163 163 ! CALL xios_send_scalar("field_Scalar", tsTemp) -
XIOS/trunk/src/type/type_util.hpp
r619 r621 20 20 class CVariable; 21 21 class CVariableGroup; 22 class CTransformation; 23 class CTransformationGroup; 22 class CInverseAxis; 23 class CInverseAxisGroup; 24 class CZoomAxis; 25 class CZoomAxisGroup; 24 26 25 27 template <typename T> inline string getStrType(void); … … 58 60 macro(CVariable) 59 61 macro(CVariableGroup) 60 macro(CTransformation) 61 macro(CTransformationGroup) 62 62 macro(CInverseAxis) 63 macro(CInverseAxisGroup) 64 macro(CZoomAxis) 65 macro(CZoomAxisGroup) 63 66 #undef macro 64 67 } -
XIOS/trunk/src/xios_spl.hpp
r591 r621 28 28 29 29 /// boost headers /// 30 //#include <boost/unordered_map.hpp>30 #include <boost/unordered_map.hpp> 31 31 #include <boost/shared_ptr.hpp> 32 32 #include <boost/cast.hpp> -
XIOS/trunk/src/xml_parser_decl.cpp
r619 r621 25 25 macro( File ) 26 26 macro( Variable ) 27 macro( Transformation ) 27 macro( InverseAxis ) 28 macro( ZoomAxis ) 28 29 } 29 30 }
Note: See TracChangeset
for help on using the changeset viewer.