Changeset 687
- Timestamp:
- 09/15/15 17:30:55 (9 years ago)
- Location:
- XIOS/trunk
- Files:
-
- 8 added
- 22 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/inputs/Version2/iodef.xml
r664 r687 28 28 </file> 29 29 <file id="output_Axis_transformed" name="output_Axis_transformed" type="one_file"> 30 <field field_ref="field_Axis_transformed" />30 <!-- <field field_ref="field_Axis_transformed" />--> 31 31 </file> 32 32 <file id="output_Axis_transformed_interpolated" name="output_Axis_transformed_interpolated"> … … 34 34 </file> 35 35 <file id="output_Domain_transformed_interpolated" name="output_Domain_transformed_interpolated"> 36 <!-- <field field_ref="field_Domain_transformed_Interpolated" />-->36 <field field_ref="field_Domain_transformed_Interpolated" /> 37 37 </file> 38 38 <file id="output_Scalar" name="output_Scalar" type="one_file"> … … 70 70 <!-- <zoom_domain zoom_ibegin="0" zoom_ni="2" zoom_jbegin="0" zoom_nj="2"/>--> 71 71 </domain> 72 <domain id="domain_A_transformed" domain_ref="domain_A"> 73 <interpolate_from_file_domain file="" /> 72 <domain id="domain_A_transformed" domain_src="domain_A"> 73 <!-- <interpolate_from_file_domain file="" />--> 74 <generate_rectilinear_domain /> 74 75 </domain> 75 76 </domain_definition> -
XIOS/trunk/src/config/domain_attribute.conf
r666 r687 56 56 DECLARE_ENUM3(type,rectilinear,curvilinear,unstructured) 57 57 DECLARE_ATTRIBUTE(StdString, domain_ref) 58 58 DECLARE_ATTRIBUTE(StdString, domain_src) -
XIOS/trunk/src/config/node_type.conf
r657 r687 51 51 #endif //__XIOS_CInterpolateFromFileDomain__ 52 52 53 #ifdef __XIOS_CGenerateRectilinearDomain__ 54 DECLARE_NODE(GenerateRectilinearDomain, generate_rectilinear_domain) 55 #endif //__XIOS_CGenerateRectilinearDomain__ 56 57 53 58 #ifdef __XIOS_CContext__ 54 59 DECLARE_NODE_PAR(Context, context) -
XIOS/trunk/src/group_factory_decl.cpp
r657 r687 30 30 macro(CZoomDomainGroup) 31 31 macro(CInterpolateFromFileDomainGroup) 32 macro(CGenerateRectilinearDomainGroup) 32 33 } -
XIOS/trunk/src/group_template_decl.cpp
r657 r687 19 19 macro(ZoomDomain) 20 20 macro(InterpolateFromFileDomain) 21 macro(GenerateRectilinearDomain) 21 22 22 23 } -
XIOS/trunk/src/node/domain.cpp
r679 r687 20 20 #include "zoom_domain.hpp" 21 21 #include "interpolate_from_file_domain.hpp" 22 #include "generate_rectilinear_domain.hpp" 22 23 23 24 #include <algorithm> … … 34 35 , isClientAfterTransformationChecked(false), hasLonLat(false) 35 36 , lonvalue_client(), latvalue_client(), bounds_lon_client(), bounds_lat_client() 37 , srcObject_(0) 36 38 { /* Ne rien faire de plus */ } 37 39 … … 43 45 , isClientAfterTransformationChecked(false), hasLonLat(false) 44 46 , lonvalue_client(), latvalue_client(), bounds_lon_client(), bounds_lat_client() 47 , srcObject_(0) 45 48 { /* Ne rien faire de plus */ } 46 49 … … 158 161 159 162 //---------------------------------------------------------------- 163 164 /*! 165 Redistribute RECTILINEAR domain with a number of local domains. 166 All attributes ni,nj,ibegin,jbegin (if defined) will be rewritten 167 The optional attributes lonvalue, latvalue will be added. Because this function only serves (for now) 168 for interpolation from unstructured domain to rectilinear one, range of latvalue is 0-360 and lonvalue is -90 - +90 169 \param [in] nbLocalDomain number of local domain on the domain destination 170 */ 171 void CDomain::redistribute(int nbLocalDomain) 172 { 173 if (type_attr::rectilinear == type) 174 { 175 CContext* context = CContext::getCurrent(); 176 CContextClient* client = context->client; 177 int rankClient = client->clientRank; 178 int rankOnDomain = rankClient%nbLocalDomain; 179 180 if (ni_glo.isEmpty() || ni_glo <= 0 ) 181 { 182 ERROR("CDomain::redistribute(int nbLocalDomain)", 183 << "[ Id = " << this->getId() << " ] " 184 << "The global domain is badly defined," 185 << " check the \'ni_glo\' value !") 186 } 187 188 if (nj_glo.isEmpty() || nj_glo <= 0 ) 189 { 190 ERROR("CDomain::redistribute(int nbLocalDomain)", 191 << "[ Id = " << this->getId() << " ] " 192 << "The global domain is badly defined," 193 << " check the \'nj_glo\' value !") 194 } 195 196 int globalDomainSize = ni_glo * nj_glo; 197 if (globalDomainSize <= nbLocalDomain) 198 { 199 for (int idx = 0; idx < nbLocalDomain; ++idx) 200 { 201 if (rankOnDomain < globalDomainSize) 202 { 203 int iIdx = rankOnDomain % ni_glo; 204 int jIdx = rankOnDomain / ni_glo; 205 ibegin.setValue(iIdx); jbegin.setValue(jIdx); 206 ni.setValue(1); nj.setValue(1); 207 } 208 else 209 { 210 ibegin.setValue(0); jbegin.setValue(0); 211 ni.setValue(0); nj.setValue(0); 212 } 213 } 214 } 215 else 216 { 217 // Compute (approximately) number of segment on x and y axis 218 float yOverXRatio = (nj_glo.getValue())/(ni_glo.getValue()); 219 int nbProcOnX, nbProcOnY, range; 220 nbProcOnX = std::ceil(std::sqrt(nbLocalDomain/yOverXRatio)); 221 nbProcOnY = std::ceil(((float)nbLocalDomain)/nbProcOnX); 222 223 // Simple distribution: Sweep from top to bottom, left to right 224 // Calculate local begin on x 225 std::vector<int> ibeginVec(nbProcOnX,0), jbeginVec(nbProcOnY,0); 226 std::vector<int> niVec(nbProcOnX), njVec(nbProcOnY); 227 for (int i = 1; i < nbProcOnX; ++i) 228 { 229 range = ni_glo / nbProcOnX; 230 if (i < (ni_glo%nbProcOnX)) ++range; 231 niVec[i-1] = range; 232 ibeginVec[i] = ibeginVec[i-1] + niVec[i-1]; 233 } 234 niVec[nbProcOnX-1] = ni_glo - ibeginVec[nbProcOnX-1]; 235 236 // Calculate local begin on y 237 for (int j = 1; j < nbProcOnY; ++j) 238 { 239 range = nj_glo / nbProcOnY; 240 if (j < (nj_glo%nbProcOnY)) ++range; 241 njVec[j-1] = range; 242 jbeginVec[j] = jbeginVec[j-1] + njVec[j-1]; 243 } 244 njVec[nbProcOnY-1] = nj_glo - jbeginVec[nbProcOnY-1]; 245 246 // Now assign value to ni, ibegin, nj, jbegin 247 int iIdx = rankOnDomain % nbProcOnX; 248 int jIdx = rankOnDomain / nbProcOnX; 249 250 if (rankOnDomain != (nbLocalDomain-1)) 251 { 252 ibegin.setValue(ibeginVec[iIdx]); 253 jbegin.setValue(jbeginVec[jIdx]); 254 nj.setValue(njVec[jIdx]); 255 ni.setValue(niVec[iIdx]); 256 } 257 else // just merge all the remaining rectangle into the last one 258 { 259 ibegin.setValue(ibeginVec[iIdx]); 260 jbegin.setValue(jbeginVec[jIdx]); 261 nj.setValue(njVec[jIdx]); 262 ni.setValue(ni_glo - ibeginVec[iIdx]); 263 } 264 } 265 266 // Now fill other attributes 267 fillInRectilinearLonLat(); 268 } 269 } 270 271 /*! 272 Fill in the values for lonvalue_1d and latvalue_1d of rectilinear domain 273 Range of longitude value from 0 - 360 274 Range of latitude value from -90 - +90 275 */ 276 void CDomain::fillInRectilinearLonLat() 277 { 278 if (!lonvalue_2d.isEmpty()) lonvalue_2d.free(); 279 if (!latvalue_2d.isEmpty()) latvalue_1d.free(); 280 lonvalue_1d.resize(ni); 281 latvalue_1d.resize(nj); 282 double lonStep = double(360/ni_glo.getValue()); 283 double latStep = double(180/nj_glo.getValue()); 284 285 // Assign lon value 286 for (int i = 0; i < ni; ++i) 287 { 288 lonvalue_1d(i) = static_cast<double>(ibegin + i) * lonStep; 289 } 290 291 for (int j = 0; j < nj; ++j) 292 { 293 latvalue_1d(j) = static_cast<double>(jbegin + j) * latStep - 90; 294 } 295 } 160 296 161 297 void CDomain::checkDomain(void) … … 702 838 if (!lonvalue_1d.isEmpty() && lonvalue_2d.isEmpty()) 703 839 { 704 if ( lonvalue_1d.numElements() != i_index.numElements())840 if ((type_attr::rectilinear != type) && (lonvalue_1d.numElements() != i_index.numElements())) 705 841 ERROR("CDomain::completeLonLatClient(void)", 706 842 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " … … 728 864 if (!latvalue_1d.isEmpty() && latvalue_2d.isEmpty()) 729 865 { 730 if ( latvalue_1d.numElements() != i_index.numElements())866 if ((type_attr::rectilinear != type) && (latvalue_1d.numElements() != i_index.numElements())) 731 867 ERROR("CDomain::completeLonLatClient(void)", 732 868 << "[ id = " << this->getId() << " , context = '" << CObjectFactory::GetCurrentContextId() << " ] " … … 1580 1716 } 1581 1717 1718 void CDomain::solveSrcInheritance() 1719 { 1720 if (!domain_src.isEmpty()) 1721 { 1722 if (!CDomain::has(this->domain_src.getValue())) \ 1723 ERROR("CDomain::solveSrcInheritance()", \ 1724 << "[ src_name = " << this->domain_src.getValue() << "]" \ 1725 << " invalid domain name !"); 1726 1727 srcObject_ = CDomain::get(this->domain_src.getValue()); 1728 } 1729 } 1730 1731 CDomain* CDomain::getDomainSrc() 1732 { 1733 return srcObject_; 1734 } 1735 1582 1736 /*! 1583 1737 Parse children nodes of a domain in xml file. … … 1595 1749 StdString interpFromFileDomainDefRoot("interpolate_from_file_domain_definition"); 1596 1750 StdString interpFromFile("interpolate_from_file_domain"); 1751 StdString generateRectilinearDefRoot("generate_rectilinear_domain_definition"); 1752 StdString generateRectilinear("generate_rectilinear_domain"); 1597 1753 do 1598 1754 { … … 1608 1764 transformationMap_.push_back(std::make_pair(TRANS_INTERPOLATE_DOMAIN_FROM_FILE,tmp)); 1609 1765 } 1766 else if (node.getElementName() == generateRectilinear) 1767 { 1768 CGenerateRectilinearDomain* tmp = (CGenerateRectilinearDomainGroup::get(generateRectilinearDefRoot))->createChild(); 1769 tmp->parse(node); 1770 transformationMap_.push_back(std::make_pair(TRANS_GENERATE_RECTILINEAR_DOMAIN,tmp)); 1771 } 1610 1772 } while (node.goToNextElement()) ; 1611 1773 node.goToParentElement(); -
XIOS/trunk/src/node/domain.hpp
r676 r687 76 76 bool hasTransformation(); 77 77 void solveInheritanceTransformation(); 78 void solveSrcInheritance(); 79 CDomain* getDomainSrc(); 78 80 TransMapTypes getAllTransformations(); 81 void redistribute(int nbLocalDomain); 79 82 80 83 public: … … 164 167 void setTransformations(const TransMapTypes&); 165 168 void computeNGlobDomain(); 169 void fillInRectilinearLonLat(); 166 170 167 171 void sendIndex(); … … 187 191 std::vector<int> nGlobDomain_; 188 192 bool isUnstructed_; 193 CDomain* srcObject_; 189 194 190 195 DECLARE_REF_FUNC(Domain,domain) -
XIOS/trunk/src/node/field.cpp
r676 r687 175 175 client->sendEvent(event); 176 176 } 177 177 178 178 CTimer::get("XIOS Send Data").suspend(); 179 179 } … … 498 498 solveGridReference(); 499 499 } 500 if (context->hasClient) 501 { 502 solveGenerateGrid(); 503 } 504 500 505 solveGridDomainAxisRef(doSending2Sever); 506 501 507 if (context->hasClient) 502 508 { 503 509 solveTransformedGrid(); 504 510 } 511 505 512 solveCheckMaskIndex(doSending2Sever); 506 513 } … … 775 782 } 776 783 784 void CField::solveGenerateGrid() 785 { 786 if (!grid_ref.isEmpty() && hasDirectFieldReference() && !getDirectFieldReference()->grid_ref.isEmpty() 787 && grid_ref.getValue() != getDirectFieldReference()->grid_ref.getValue() && !grid->isTransformed()) 788 grid->completeGrid(getDirectFieldReference()->grid); 789 } 790 777 791 ///------------------------------------------------------------------- 778 792 -
XIOS/trunk/src/node/field.hpp
r676 r687 110 110 void solveGridDomainAxisRef(bool checkAtt); 111 111 void solveTransformedGrid(); 112 void solveGenerateGrid(); 112 113 113 114 void buildFilterGraph(CGarbageCollector& gc, bool enableOutput); -
XIOS/trunk/src/node/grid.cpp
r676 r687 17 17 #include "distribution_client.hpp" 18 18 #include "grid_transformation.hpp" 19 #include "grid_generate.hpp" 19 20 20 21 namespace xios { … … 1168 1169 pDom->solveRefInheritance(apply); 1169 1170 pDom->solveBaseReference(); 1171 pDom->solveSrcInheritance(); 1170 1172 pDom->solveInheritanceTransformation(); 1171 1173 if ((!pDom->domain_ref.isEmpty()) && (pDom->name.isEmpty())) … … 1203 1205 { 1204 1206 return transformations_; 1207 } 1208 1209 /*! 1210 Complete all the necessary (and lacking) attributes of a grid 1211 This function is similar to gridTransformation but works only (till now) on generate_rectilinear_domain transformation 1212 */ 1213 void CGrid::completeGrid(CGrid* transformGridSrc) 1214 { 1215 if (axis_domain_order.numElements() != transformGridSrc->axis_domain_order.numElements()) 1216 { 1217 ERROR("CGrid::transformGrid(CGrid* transformGridSrc)", 1218 << "Two grids have different dimension size" 1219 << "Dimension of grid destination " << this->getId() << " is " << axis_domain_order.numElements() << std::endl 1220 << "Dimension of grid source " << transformGridSrc->getId() << " is " << transformGridSrc->axis_domain_order.numElements()); 1221 } 1222 else 1223 { 1224 int ssize = axis_domain_order.numElements(); 1225 for (int i = 0; i < ssize; ++i) 1226 if (axis_domain_order(i) != (transformGridSrc->axis_domain_order)(i)) 1227 ERROR("CGrid::transformGrid(CGrid* transformGridSrc)", 1228 << "Grids " << this->getId() << " and " << transformGridSrc->getId() 1229 << " don't have elements in the same order"); 1230 } 1231 1232 CGridGenerate gridGenerate(this, transformGridSrc); 1233 gridGenerate.completeGrid(); 1205 1234 } 1206 1235 -
XIOS/trunk/src/node/grid.hpp
r680 r687 180 180 181 181 void transformGrid(CGrid* transformGridSrc); 182 void completeGrid(CGrid* transformGridSrc); 183 void doAutoDistribution(CGrid* transformGridSrc); 182 184 bool isTransformed(); 183 185 void setTransformed(); -
XIOS/trunk/src/node/node_enum.hpp
r657 r687 24 24 eInterpolateAxis, 25 25 eZoomDomain, 26 eInterpolateFromFileDomain 26 eInterpolateFromFileDomain, 27 eGenerateRectilinearDomain 27 28 28 29 } ENodeType; -
XIOS/trunk/src/node/node_type.hpp
r657 r687 15 15 #include "zoom_domain.hpp" 16 16 #include "interpolate_from_file_domain.hpp" 17 #include "generate_rectilinear_domain.hpp" 17 18 18 19 #endif // __XIOS_NODE_TYPE__ -
XIOS/trunk/src/node/transformation_enum.hpp
r657 r687 11 11 TRANS_INTERPOLATE_AXIS, 12 12 TRANS_ZOOM_DOMAIN, 13 TRANS_INTERPOLATE_DOMAIN_FROM_FILE 13 TRANS_INTERPOLATE_DOMAIN_FROM_FILE, 14 TRANS_GENERATE_RECTILINEAR_DOMAIN 14 15 } ETranformationType; 15 16 -
XIOS/trunk/src/object_factory_decl.cpp
r657 r687 29 29 macro(CZoomDomain) 30 30 macro(CInterpolateFromFileDomain) 31 macro(CGenerateRectilinearDomain) 31 32 32 33 macro(CFieldGroup) … … 42 43 macro(CZoomDomainGroup) 43 44 macro(CInterpolateFromFileDomainGroup) 45 macro(CGenerateRectilinearDomainGroup) 44 46 } -
XIOS/trunk/src/object_template_decl.cpp
r657 r687 18 18 template class CObjectTemplate<CZoomDomain>; 19 19 template class CObjectTemplate<CInterpolateFromFileDomain>; 20 template class CObjectTemplate<CGenerateRectilinearDomain>; 20 21 21 22 template class CObjectTemplate<CContextGroup>; … … 31 32 template class CObjectTemplate<CZoomDomainGroup>; 32 33 template class CObjectTemplate<CInterpolateFromFileDomainGroup>; 34 template class CObjectTemplate<CGenerateRectilinearDomainGroup>; 33 35 } -
XIOS/trunk/src/test/test_new_features.f90
r666 r687 132 132 CALL xios_set_domain_attr("domain_A",ni_glo=ni_glo, nj_glo=nj_glo, ibegin=ibegin, ni=ni,jbegin=jbegin,nj=nj) 133 133 CALL xios_set_domain_attr("domain_A",data_dim=2, data_ibegin=-1, data_ni=ni+2, data_jbegin=-2, data_nj=nj+4) 134 CALL xios_set_domain_attr("domain_A",lonvalue_2D=lon,latvalue_2D=lat )134 CALL xios_set_domain_attr("domain_A",lonvalue_2D=lon,latvalue_2D=lat, type='curvilinear') 135 135 136 136 CALL xios_set_domain_attr("domain_A_transformed", ni_glo=niDomGlo, nj_glo=njDomGlo, & 137 ibegin=ibeginDomInterp, ni=niDomInterp, jbegin=jbeginDomInterp, nj=njDomInterp) 138 CALL xios_set_domain_attr("domain_A_transformed", lonvalue_2D=lontransformed, & 139 latvalue_2D=lattransformed) 137 type='rectilinear') 138 ! ibegin=ibeginDomInterp, ni=niDomInterp, jbegin=jbeginDomInterp, nj=njDomInterp) 139 ! CALL xios_set_domain_attr("domain_A_transformed", lonvalue_2D=lontransformed, & 140 ! latvalue_2D=lattransformed) 140 141 141 142 CALL xios_set_fieldgroup_attr("field_definition",enabled=.TRUE.) … … 172 173 173 174 ni=0 ; lonvalue(:)=0 174 CALL xios_get_domain_attr("domain_A",ni=ni,lonvalue_1D=lonvalue)175 ! CALL xios_get_domain_attr("domain_A",ni=ni,lonvalue_1D=lonvalue) 175 176 176 177 ! print *,"ni",ni -
XIOS/trunk/src/transformation/grid_transformation.cpp
r671 r687 58 58 59 59 gridSource_ = CGrid::createGrid(domainSrc, axisSrc, gridDestination_->axis_domain_order); 60 gridSourceDimensionSize_ = gridSource_->getGlobalDimension();61 gridDestinationDimensionSize_ = gridDestination_->getGlobalDimension();62 60 63 61 initializeMappingOfOriginalGridSource(); … … 77 75 78 76 CDistributionClient distribution(client->clientRank, originalGridSource_); 79 const std::vector<size_t>& globalIndexGrid DestSendToServer = distribution.getGlobalDataIndexSendToServer();80 81 weightOfGlobalIndexOfOriginalGridSource_.resize(globalIndexGrid DestSendToServer.size());82 globalIndexOfCurrentGridSource_ = globalIndexGrid DestSendToServer;83 globalIndexOfOriginalGridSource_ = globalIndexGrid DestSendToServer;77 const std::vector<size_t>& globalIndexGridSrcSendToServer = distribution.getGlobalDataIndexSendToServer(); 78 79 weightOfGlobalIndexOfOriginalGridSource_.resize(globalIndexGridSrcSendToServer.size()); 80 globalIndexOfCurrentGridSource_ = globalIndexGridSrcSendToServer; 81 globalIndexOfOriginalGridSource_ = globalIndexGridSrcSendToServer; 84 82 weightOfGlobalIndexOfOriginalGridSource_ = 1.0; 85 83 } … … 346 344 ite = listAlgos_.end(), it; 347 345 CGenericAlgorithmTransformation* algo = 0; 348 346 int nbAgloTransformation = 0; // Only count for executed transformation. Generate domain is a special one, not executed in the list 349 347 for (it = itb; it != ite; ++it) 350 348 { … … 358 356 algo = algoTransformation_.back(); 359 357 360 // Recalculate the distribution of grid destination 361 CDistributionClient distributionClientDest(client->clientRank, gridDestination_); 362 const std::vector<size_t>& globalIndexGridDestSendToServer = distributionClientDest.getGlobalDataIndexSendToServer(); 363 364 // ComputeTransformation of global index of each element 365 std::vector<int> gridDestinationDimensionSize = gridDestination_->getGlobalDimension(); 366 std::vector<int> gridSrcDimensionSize = gridSource_->getGlobalDimension(); 367 int elementPosition = it->first; 368 algo->computeGlobalSourceIndex(elementPosition, 369 gridDestinationDimensionSize, 370 gridSrcDimensionSize, 371 globalIndexGridDestSendToServer, 372 globaIndexWeightFromDestToSource); 373 374 // Compute transformation of global indexes among grids 375 computeTransformationFromOriginalGridSource(globaIndexWeightFromDestToSource); 376 377 // Now grid destination becomes grid source in a new transformation 378 setUpGrid(elementPositionInGrid, transType); 379 } 380 381 updateFinalGridDestination(); 382 computeFinalTransformationMapping(); 358 if (0 != algo) // Only registered transformation can be executed 359 { 360 // Recalculate the distribution of grid destination 361 CDistributionClient distributionClientDest(client->clientRank, gridDestination_); 362 const std::vector<size_t>& globalIndexGridDestSendToServer = distributionClientDest.getGlobalDataIndexSendToServer(); 363 364 // ComputeTransformation of global index of each element 365 std::vector<int> gridDestinationDimensionSize = gridDestination_->getGlobalDimension(); 366 std::vector<int> gridSrcDimensionSize = gridSource_->getGlobalDimension(); 367 int elementPosition = it->first; 368 algo->computeGlobalSourceIndex(elementPosition, 369 gridDestinationDimensionSize, 370 gridSrcDimensionSize, 371 globalIndexGridDestSendToServer, 372 globaIndexWeightFromDestToSource); 373 374 // Compute transformation of global indexes among grids 375 computeTransformationFromOriginalGridSource(globaIndexWeightFromDestToSource); 376 377 // Now grid destination becomes grid source in a new transformation 378 setUpGrid(elementPositionInGrid, transType); 379 ++nbAgloTransformation; 380 } 381 } 382 383 if (0 != nbAgloTransformation) 384 { 385 updateFinalGridDestination(); 386 computeFinalTransformationMapping(); 387 } 383 388 } 384 389 -
XIOS/trunk/src/transformation/grid_transformation.hpp
r668 r687 3 3 \author Ha NGUYEN 4 4 \since 14 May 2015 5 \date 18 June20155 \date 26 Aug 2015 6 6 7 7 \brief Interface for all transformations. … … 34 34 { 35 35 public: 36 typedef std::list<std::pair<int,std::pair<ETranformationType,int> > > ListAlgoType; 37 38 public: 36 39 /** Default constructor */ 37 40 CGridTransformation(CGrid* destination, CGrid* source); … … 44 47 CGrid* getGridSource() {return gridSource_; } 45 48 CGrid* getGridDestination() { return gridDestination_; } 49 ListAlgoType getAlgoList() const {return listAlgos_; } 46 50 47 pr ivate:51 protected: 48 52 void computeTransformation(); 49 53 void initializeAlgorithms(); … … 60 64 void updateFinalGridDestination(); 61 65 62 pr ivate:66 protected: 63 67 //! Grid source on transformation 64 68 CGrid* gridSource_; … … 70 74 CGrid* originalGridSource_; 71 75 72 //! Grid source dimension size 73 std::vector<int> gridSourceDimensionSize_; 74 75 //! Grid destination dimension size 76 std::vector<int> gridDestinationDimensionSize_; 77 78 private: 79 typedef std::list<std::pair<int,std::pair<ETranformationType,int> > > ListAlgoType; 76 protected: 80 77 //! List of algorithm types and their order 81 78 ListAlgoType listAlgos_; -
XIOS/trunk/src/type/type_util.hpp
r658 r687 30 30 class CInterpolateFromFileDomain; 31 31 class CInterpolateFromFileDomainGroup; 32 class CGenerateRectilinearDomain; 33 class CGenerateRectilinearDomainGroup; 32 34 33 35 template <typename T> inline string getStrType(void); … … 76 78 macro(CInterpolateFromFileDomain) 77 79 macro(CInterpolateFromFileDomainGroup) 80 macro(CGenerateRectilinearDomain) 81 macro(CGenerateRectilinearDomainGroup) 78 82 #undef macro 79 83 } -
XIOS/trunk/src/utils.hpp
r671 r687 171 171 return hash; 172 172 } 173 174 /*! 175 Adatped version of (stupid) boost hash (but working) 176 */ 177 static inline size_t boost_hash(const std::vector<T>& vec) 178 { 179 size_t hash = 0; 180 int sizeVec = vec.size(); 181 for(int i = 0; i < sizeVec; ++i) 182 { 183 hash ^= i + 0x9e3779b9 + (hash << 6) + (hash >> 2); 184 } 185 return hash; 186 } 173 187 }; 174 188 … … 180 194 Algo al; 181 195 return hash_value(val, al); 196 } 197 198 std::size_t hashVec(const std::vector<T>& vec) 199 { 200 return HashAlgorithm<T>::boost_hash(vec); 182 201 } 183 202 -
XIOS/trunk/src/xml_parser_decl.cpp
r657 r687 24 24 macro( ZoomDomain ) 25 25 macro( InterpolateFromFileDomain ) 26 macro( GenerateRectilinearDomain ) 26 27 } 27 28 }
Note: See TracChangeset
for help on using the changeset viewer.