Last change
on this file since 2004 was
2001,
checked in by ymipsl, 3 years ago
|
Bug fix when introducing gridAlgorithm
YM
|
-
Property svn:eol-style set to
native
-
Property svn:executable set to
*
|
File size:
1.2 KB
|
Rev | Line | |
---|
[1997] | 1 | #include "algorithm_transformation_weight.hpp" |
---|
| 2 | #include "context.hpp" |
---|
| 3 | |
---|
| 4 | namespace xios |
---|
| 5 | { |
---|
| 6 | |
---|
| 7 | |
---|
| 8 | void CAlgorithmTransformationWeight::computeAlgorithm(CLocalView* srcView, CLocalView* dstView) |
---|
[2001] | 9 | { |
---|
[1999] | 10 | this->computeRecvElement(srcView, dstView) ; |
---|
| 11 | weightTransformConnector_ = new CWeightTransformConnector( recvElement_->getView(CElementView::FULL), dstView, transformationMapping_, transformationWeight_) ; |
---|
[1997] | 12 | } |
---|
| 13 | |
---|
| 14 | |
---|
| 15 | void CAlgorithmTransformationWeight::apply(int dimBefore, int dimAfter, const CArray<double,1>& dataIn, CArray<double,1>& dataOut) |
---|
| 16 | { |
---|
[2001] | 17 | weightTransformConnector_ -> transfer(dimBefore, dimAfter, dataIn, dataOut) ; |
---|
[1997] | 18 | } |
---|
| 19 | |
---|
[1999] | 20 | void CAlgorithmTransformationWeight::computeRecvElement(CLocalView* srcView, CLocalView* dstView) |
---|
| 21 | { |
---|
| 22 | auto& srcMap = transformationMapping_ ; |
---|
| 23 | set<size_t> srcIndex ; |
---|
| 24 | for(auto& it : srcMap) |
---|
| 25 | for(size_t index : it.second) srcIndex.insert(index) ; |
---|
| 26 | |
---|
| 27 | CArray<size_t,1> srcArrayIndex(srcIndex.size()) ; |
---|
| 28 | int i=0 ; |
---|
| 29 | for(size_t index : srcIndex) { srcArrayIndex(i) = index ; i++ ;} |
---|
| 30 | recvElement_ = new CLocalElement(CContext::getCurrent()->getIntraCommRank(), srcView->getGlobalSize(), srcArrayIndex) ; |
---|
| 31 | recvElement_->addFullView() ; |
---|
| 32 | } |
---|
[1997] | 33 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.