- Timestamp:
- 07/05/16 15:59:16 (8 years ago)
- Location:
- XIOS/trunk/src/transformation
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/transformation/generic_algorithm_transformation.cpp
r888 r889 27 27 for (int idx = 0; idx < nbLocalIndex; ++idx) 28 28 { 29 dataOut(localIndex[idx].first) = *(dataInput + idx) * localIndex[idx].second;29 dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 30 30 } 31 31 } -
XIOS/trunk/src/transformation/grid_generate.cpp
r887 r889 14 14 namespace xios { 15 15 CGridGenerate::CGridGenerate(CGrid* destination, CGrid* source) 16 : CGridTransformationSelector(destination, source )16 : CGridTransformationSelector(destination, source, special) 17 17 { 18 18 } -
XIOS/trunk/src/transformation/grid_transformation_selector.cpp
r887 r889 13 13 namespace xios { 14 14 15 CGridTransformationSelector::CGridTransformationSelector(CGrid* destination, CGrid* source )15 CGridTransformationSelector::CGridTransformationSelector(CGrid* destination, CGrid* source, TransformationType type) 16 16 : gridSource_(source), gridDestination_(destination), 17 17 listAlgos_(), algoTypes_(), nbNormalAlgos_(0), nbSpecialAlgos_(0), auxInputs_() … … 26 26 << "Number of elements of grid source " <<gridSource_->getId() << " is " << gridSource_->axis_domain_order.numElements() << std::endl 27 27 << "Number of elements of grid destination " <<gridDestination_->getId() << " is " << numElement); 28 initializeTransformations( );28 initializeTransformations(type); 29 29 } 30 30 … … 35 35 for each transformation, we need to make sure that the current "temporary source" maps its global index correctly to the original one. 36 36 */ 37 void CGridTransformationSelector::initializeTransformations( )37 void CGridTransformationSelector::initializeTransformations(TransformationType type) 38 38 { 39 39 // Initialize algorithms 40 40 initializeAlgorithms(); 41 ListAlgoType:: const_iterator itb = listAlgos_.begin(),42 41 ListAlgoType::iterator itb = listAlgos_.begin(), 42 ite = listAlgos_.end(), it; 43 43 44 44 for (it = itb; it != ite; ++it) 45 45 { 46 46 ETranformationType transType = (it->second).first; 47 if (!isSpecialTransformation(transType)) ++nbNormalAlgos_; 48 else ++nbSpecialAlgos_; 47 if (!isSpecialTransformation(transType)) 48 { 49 ++nbNormalAlgos_; 50 if (special == type) 51 { 52 it = listAlgos_.erase(it); 53 --it; 54 } 55 } 56 else 57 { 58 ++nbSpecialAlgos_; 59 if (normal == type) 60 { 61 it = listAlgos_.erase(it); 62 --it; 63 } 64 } 65 49 66 } 50 67 } -
XIOS/trunk/src/transformation/grid_transformation_selector.hpp
r888 r889 34 34 }; 35 35 36 protected: 37 enum TransformationType { 38 special = 0, normal = 1 39 }; 40 36 41 public: 37 42 /** Default constructor */ 38 CGridTransformationSelector(CGrid* destination, CGrid* source );43 CGridTransformationSelector(CGrid* destination, CGrid* source, TransformationType type = normal); 39 44 virtual ~CGridTransformationSelector(); 40 45 … … 49 54 void initializeAxisAlgorithms(int axisPositionInGrid); 50 55 void initializeScalarAlgorithms(int scalarPositionInGrid); 51 void initializeTransformations( );56 void initializeTransformations(TransformationType type); 52 57 void selectAlgo(int elementPositionInGrid, ETranformationType transType, int transformationOrder, AlgoType algo); 53 58 bool isSpecialTransformation(ETranformationType transType);
Note: See TracChangeset
for help on using the changeset viewer.