#ifndef _NEAR_INTERAC_HPP_ #define _NEAR_INTERAC_HPP_ #include template class NearInteraction { typedef sctl::Morton MID; typedef sctl::Long Long; struct ObjData { int operator<(const ObjData& p1) const { return mid < p1.mid; } MID mid; Long Rglb; Real rad; Real coord[DIM]; //sctl::StaticArray coord; // not trivially copyable }; public: NearInteraction() {} NearInteraction(sctl::Comm comm) : comm_(comm) { for (sctl::Integer i = 0; i < DIM; i++) { period_length[i] = 0; period_length0[i] = 0; } } void SetPeriodLength(sctl::Integer d, Real len) { period_length[d] = len; } template void SetupRepartition(const std::vector& src_vec, const std::vector& trg_vec); template void SetupNearInterac(const std::vector& src_vec, const std::vector& trg_vec); const std::vector>& GetInteractionList() const { return trg_src_pair; } template void ForwardScatterSrc(const std::vector& in, std::vector& out) const; template void ForwardScatterTrg(const std::vector& in, std::vector& out) const; template void ReverseScatterTrg(const std::vector& in, std::vector& out) const; private: template void ForwardScatter(const std::vector& in_vec, std::vector& out_vec, const sctl::Vector& recv_idx) const; template void ReverseScatter(const std::vector& in_vec, std::vector& out_vec, const sctl::Vector& send_idx) const; sctl::Comm comm_; sctl::Vector TRglb, SRglb; sctl::Vector> TSPair; std::vector> trg_src_pair; sctl::StaticArray period_length, period_length0; sctl::Integer depth; sctl::Vector SData_, TData_; // Globally sorted }; #include #endif //_NEAR_INTERAC_HPP_