/** * \file fmm_tree.hpp * \author Dhairya Malhotra, dhairya.malhotra@gmail.com * \date 12-11-2010 * \brief This file contains the definition of the FMM_Tree class. */ #include #include #include #include #include #include #include #ifndef _PVFMM_FMM_TREE_HPP_ #define _PVFMM_FMM_TREE_HPP_ namespace pvfmm{ /** * \brief Base class for FMM tree. */ template class FMM_Tree: public MPI_Tree{ friend FMM_Mat_t; public: typedef typename FMM_Mat_t::FMMNode_t Node_t; typedef typename FMM_Mat_t::Real_t Real_t; /** * \brief Constructor. */ FMM_Tree(MPI_Comm c): MPI_Tree(c), fmm_mat(NULL), bndry(FreeSpace) { }; /** * \brief Virtual destructor. */ virtual ~FMM_Tree(){ } /** * \brief Initialize the distributed MPI tree. */ virtual void Initialize(typename Node_t::NodeData* data_) ; /** * \brief Initialize FMM_Tree. */ void InitFMM_Tree(bool refine, BoundaryType bndry=FreeSpace); /** * \brief Run FMM */ void SetupFMM(FMM_Mat_t* fmm_mat_); /** * \brief Run FMM */ void RunFMM(); /** * \brief Clear FMM data: multipole, local expansions and target potential. */ void ClearFMMData(); /** * \brief Build interaction lists for all nodes. */ void BuildInteracLists(); /** * \brief Upward FMM pass (Including MultipoleReduceBcast). */ void UpwardPass(); /** * \brief Reduction and broadcast of multipole expansions. */ void MultipoleReduceBcast() ; /** * \brief Downward FMM pass. */ void DownwardPass(); /** * \brief Copy FMM output to the tree. */ void Copy_FMMOutput(); protected: std::vector > node_data_buff; InteracList interac_list; FMM_Mat_t* fmm_mat; //Computes all FMM translations. BoundaryType bndry; std::vector > precomp_lst; //Precomputed data for each interaction type. std::vector > setup_data; std::vector > upwd_check_surf; std::vector > upwd_equiv_surf; std::vector > dnwd_check_surf; std::vector > dnwd_equiv_surf; }; }//end namespace #include #endif //_PVFMM_FMM_TREE_HPP_