Changeset 918
- Timestamp:
- 08/12/16 19:57:50 (8 years ago)
- Location:
- XIOS/trunk/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/filter/spatial_transform_filter.cpp
r888 r918 197 197 int countSize = itRecv->second.size(); 198 198 const std::vector<std::pair<int,double> >& localIndex_p = itRecv->second; 199 // for (int idx = 0; idx < countSize; ++idx)200 // {201 // dataCurrentDest(localIndex_p[idx].first) += *(recvBuff+currentBuff+idx) * localIndex_p[idx].second;202 // }203 199 (*itAlgo)->apply(localIndex_p, 204 200 recvBuff+currentBuff, 205 201 dataCurrentDest, 206 localInitFlag); 202 localInitFlag, 203 defaultValue); 207 204 208 205 currentBuff += countSize; -
XIOS/trunk/src/transformation/axis_algorithm_extract_domain.cpp
r895 r918 30 30 const double* dataInput, 31 31 CArray<double,1>& dataOut, 32 std::vector<bool>& flagInitial) 32 std::vector<bool>& flagInitial, 33 const double& defaultValue) 33 34 { 34 35 reduction_->apply(localIndex, dataInput, dataOut, flagInitial); -
XIOS/trunk/src/transformation/axis_algorithm_extract_domain.hpp
r895 r918 31 31 const double* dataInput, 32 32 CArray<double,1>& dataOut, 33 std::vector<bool>& flagInitial); 33 std::vector<bool>& flagInitial, 34 const double& defaultValue); 34 35 35 36 virtual ~CAxisAlgorithmExtractDomain(); -
XIOS/trunk/src/transformation/axis_algorithm_interpolate.cpp
r913 r918 69 69 { 70 70 std::vector<double>::const_iterator itb = axisValue.begin(), ite = axisValue.end(); 71 std::vector<double>::const_iterator itLowerBound, itUpperBound, it ;71 std::vector<double>::const_iterator itLowerBound, itUpperBound, it, iteRange; 72 72 const double sfmax = NumTraits<double>::sfmax(); 73 73 … … 79 79 for (int idx = 0; idx < numValue; ++idx) 80 80 { 81 bool outOfRange = false; 81 82 double destValue = axisDestValue(idx); 83 if (destValue < *itb) outOfRange = true; 84 82 85 itLowerBound = std::lower_bound(itb, ite, destValue); 83 86 itUpperBound = std::upper_bound(itb, ite, destValue); 84 87 if ((ite != itUpperBound) && (sfmax == *itUpperBound)) itUpperBound = ite; 85 88 89 if ((ite == itLowerBound) || (ite == itUpperBound)) outOfRange = true; 86 90 // If the value is not in the range, that means we'll do extra-polation 87 if (ite == itLowerBound) // extra-polation 88 { 89 itLowerBound = itb; 90 itUpperBound = itb + order_+1; 91 } 92 else if (ite == itUpperBound) // extra-polation 93 { 94 itLowerBound = itUpperBound - order_-1; 95 } 96 else 97 { 98 if (itb != itLowerBound) --itLowerBound; 99 if (ite != itUpperBound) ++itUpperBound; 91 // if (ite == itLowerBound) // extra-polation 92 // { 93 // itLowerBound = itb; 94 // itUpperBound = itb + order_+1; 95 // } 96 // else if (ite == itUpperBound) // extra-polation 97 // { 98 // itLowerBound = itUpperBound - order_-1; 99 // } 100 //else 101 // We don't do extrapolation FOR NOW, maybe in the future 102 if (!outOfRange) 103 { 104 if ((itLowerBound == itUpperBound) && (itb != itLowerBound)) --itLowerBound; 100 105 int order = (order_ + 1) - 2; 101 106 bool down = true; … … 114 119 } 115 120 } 116 } 117 118 for (it = itLowerBound; it != itUpperBound; ++it) 119 { 120 int index = std::distance(itb, it); 121 interpolatingIndexValues[idx+ibegin].push_back(make_pair(indexVec[index],*it)); 121 122 123 iteRange = (ite == itUpperBound) ? itUpperBound : itUpperBound + 1; 124 for (it = itLowerBound; it != iteRange; ++it) 125 { 126 int index = std::distance(itb, it); 127 interpolatingIndexValues[idx+ibegin].push_back(make_pair(indexVec[index],*it)); 128 } 122 129 } 123 130 } … … 163 170 } 164 171 } 172 if (!transPosition_.empty() && this->transformationPosition_[transPos].empty()) 173 (this->transformationPosition_[transPos])[0] = transPosition_[transPos]; 174 165 175 } 166 176 -
XIOS/trunk/src/transformation/axis_algorithm_reduce_domain.cpp
r895 r918 27 27 28 28 void CAxisAlgorithmReduceDomain::apply(const std::vector<std::pair<int,double> >& localIndex, 29 const double* dataInput, 30 CArray<double,1>& dataOut, 31 std::vector<bool>& flagInitial) 29 const double* dataInput, 30 CArray<double,1>& dataOut, 31 std::vector<bool>& flagInitial, 32 const double& defaultValue) 32 33 { 33 34 reduction_->apply(localIndex, dataInput, dataOut, flagInitial); -
XIOS/trunk/src/transformation/axis_algorithm_reduce_domain.hpp
r895 r918 31 31 const double* dataInput, 32 32 CArray<double,1>& dataOut, 33 std::vector<bool>& flagInitial); 33 std::vector<bool>& flagInitial, 34 const double& defaultValue); 34 35 35 36 virtual ~CAxisAlgorithmReduceDomain(); -
XIOS/trunk/src/transformation/generic_algorithm_transformation.cpp
r889 r918 22 22 const double* dataInput, 23 23 CArray<double,1>& dataOut, 24 std::vector<bool>& flagInitial) 24 std::vector<bool>& flagInitial, 25 const double& defaultValue) 25 26 { 26 27 int nbLocalIndex = localIndex.size(); 27 for (int idx = 0; idx < nbLocalIndex; ++idx) 28 { 29 dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 28 bool hasMissingValue = (0.0 != defaultValue) ? true : false; 29 if (hasMissingValue) 30 { 31 for (int idx = 0; idx < nbLocalIndex; ++idx) 32 { 33 if (defaultValue == *(dataInput + idx)) 34 { 35 flagInitial[localIndex[idx].first] = false; 36 } 37 else 38 { 39 dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 40 } 41 } 42 43 for (int idx = 0; idx < nbLocalIndex; ++idx) 44 { 45 if (!flagInitial[localIndex[idx].first]) 46 dataOut(localIndex[idx].first) = defaultValue; 47 } 48 } 49 else 50 { 51 for (int idx = 0; idx < nbLocalIndex; ++idx) 52 { 53 dataOut(localIndex[idx].first) += *(dataInput + idx) * localIndex[idx].second; 54 } 30 55 } 31 56 } -
XIOS/trunk/src/transformation/generic_algorithm_transformation.hpp
r888 r918 63 63 const double* dataInput, 64 64 CArray<double,1>& dataOut, 65 std::vector<bool>& flagInitial); 65 std::vector<bool>& flagInitial, 66 const double& defaultValue); 66 67 67 68 std::vector<StdString> getIdAuxInputs(); -
XIOS/trunk/src/transformation/scalar_algorithm_reduce_axis.cpp
r890 r918 37 37 const double* dataInput, 38 38 CArray<double,1>& dataOut, 39 std::vector<bool>& flagInitial) 39 std::vector<bool>& flagInitial, 40 const double& defaultValue) 40 41 { 41 42 reduction_->apply(localIndex, dataInput, dataOut, flagInitial); -
XIOS/trunk/src/transformation/scalar_algorithm_reduce_axis.hpp
r888 r918 31 31 const double* dataInput, 32 32 CArray<double,1>& dataOut, 33 std::vector<bool>& flagInitial); 33 std::vector<bool>& flagInitial, 34 const double& defaultValue); 34 35 35 36 virtual ~CScalarAlgorithmReduceScalar();
Note: See TracChangeset
for help on using the changeset viewer.