/*! \file axis_algorithm_reduce_domain.hpp \author Ha NGUYEN \since 23 June 2016 \date 23 June 2016 \brief Algorithm for reduce an axis to a axis */ #ifndef __XIOS_AXIS_ALGORITHM_EXTRACT_DOMAIN_HPP__ #define __XIOS_AXIS_ALGORITHM_EXTRACT_DOMAIN_HPP__ #include "axis_algorithm_transformation.hpp" #include "transformation.hpp" namespace xios { class CAxis; class CDomain; class CExtractDomainToAxis; class CReductionAlgorithm; /*! \class CAxisAlgorithmExtractDomain Extract a domain to an axis */ class CAxisAlgorithmExtractDomain : public CAxisAlgorithmTransformation { public: CAxisAlgorithmExtractDomain(CAxis* axisDestination, CDomain* domainSource, CExtractDomainToAxis* algo); virtual void apply(const std::vector >& localIndex, const double* dataInput, CArray& dataOut, std::vector& flagInitial, bool ignoreMissingValue, bool firstPass); virtual ~CAxisAlgorithmExtractDomain(); static bool registerTrans(); protected: enum ExtractDirection { undefined = 0, iDir = 1, jDir = 2 }; ExtractDirection dir_; int pos_; //! Position to extract protected: void computeIndexSourceMapping_(const std::vector* >& dataAuxInputs); protected: CReductionAlgorithm* reduction_; private: static CGenericAlgorithmTransformation* create(CGrid* gridDst, CGrid* gridSrc, CTransformation* transformation, int elementPositionInGrid, std::map& elementPositionInGridSrc2ScalarPosition, std::map& elementPositionInGridSrc2AxisPosition, std::map& elementPositionInGridSrc2DomainPosition, std::map& elementPositionInGridDst2ScalarPosition, std::map& elementPositionInGridDst2AxisPosition, std::map& elementPositionInGridDst2DomainPosition); }; } #endif // __XIOS_AXIS_ALGORITHM_EXTRACT_DOMAIN_HPP__