source: XIOS/dev/dev_trunk_omp/src/transformation/Functions/extract.cpp @ 1677

Last change on this file since 1677 was 1677, checked in by yushan, 5 years ago

MARK: Dynamic workflow graph developement. Branch up to date with trunk @1663.

File size: 1.2 KB
Line 
1/*!
2   \file extract.cpp
3   \author Ha NGUYEN
4   \since 27 June 2016
5   \date 27 June 2016
6
7   \brief extract reduction
8 */
9#include "extract.hpp"
10
11namespace xios {
12
13CExtractReductionAlgorithm::CExtractReductionAlgorithm()
14  : CReductionAlgorithm()
15{
16}
17
18CReductionAlgorithm* CExtractReductionAlgorithm::create()
19{
20  return (new CExtractReductionAlgorithm());
21}
22
23bool CExtractReductionAlgorithm::registerTrans()
24{
25  return registerOperation(TRANS_REDUCE_EXTRACT, CExtractReductionAlgorithm::create);
26}
27
28void CExtractReductionAlgorithm::apply(const std::vector<std::pair<int,double> >& localIndex,
29                                       const double* dataInput,
30                                       CArray<double,1>& dataOut,
31                                       std::vector<bool>& flagInitial,
32                                       bool ignoreMissingValue, bool firstPass)
33{
34  std::cout<<"================================ CExtractReductionAlgorithm::apply"<<std::endl;
35  int nbLocalIndex = localIndex.size();
36  int currentlocalIndex = 0;
37  for (int idx = 0; idx < nbLocalIndex; ++idx)
38  {
39    currentlocalIndex = localIndex[idx].first;
40    dataOut(currentlocalIndex) = *(dataInput + idx);
41  }
42}
43
44}
Note: See TracBrowser for help on using the repository browser.