From eb2bc23c9de83cc7c9c09c747cfc1c4e6572be85 Mon Sep 17 00:00:00 2001 From: Coulaud <olivier.coulaud@inria.fr> Date: Mon, 14 Feb 2022 10:56:03 +0100 Subject: [PATCH] Fix bug --- include/Kernels/Uniform/FUnifCell.hpp | 31 +++++++++++++++------------ 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/include/Kernels/Uniform/FUnifCell.hpp b/include/Kernels/Uniform/FUnifCell.hpp index 7b0f91c96..ddc7a1cc1 100644 --- a/include/Kernels/Uniform/FUnifCell.hpp +++ b/include/Kernels/Uniform/FUnifCell.hpp @@ -1,4 +1,4 @@ -// See LICENCE file at project root +// See LICENCE file at project root // Keep in private GIT #ifndef FUNIFCELL_HPP @@ -38,13 +38,13 @@ public: /// Multipole expansion in Fourier space stdComplex<FReal> transformed_exp[N * NVALS * TransformedVectorSize]; - + const FReal* get(const int inRhs) const { return this->exp + inRhs*VectorSize; } - + FReal* get(const int inRhs) { return this->exp + inRhs*VectorSize; } - + const stdComplex<FReal>* getTransformed(const int inRhs) const { return this->transformed_exp + inRhs*TransformedVectorSize; } @@ -90,7 +90,7 @@ public: FSize getSavedSize() const { return N * NVALS * VectorSize * (FSize) sizeof(FReal) - + N * NVALS * TransformedVectorSize * (FSize) sizeof(stdComplex<FReal>); + + N * NVALS * TransformedVectorSize * (FSize) sizeof(stdComplex<FReal>); } }; @@ -100,6 +100,9 @@ public: multipole_t m_data {}; local_expansion_t l_data {}; + constexpr int getVectorSize() const { + return VectorSize; + } bool hasMultipoleData() const noexcept { return true; } @@ -185,17 +188,17 @@ public: template <class StreamClass> friend StreamClass& operator<<(StreamClass& output, const FUnifCell<FReal,ORDER, NRHS, NLHS, NVALS>& cell){ output << "Multipole exp NRHS " << NRHS - << " NVALS " << NVALS - << " VectorSize " << cell.getVectorSize() - << '\n'; + << " NVALS " << NVALS + << " VectorSize " << cell.getVectorSize() + << '\n'; for (int rhs= 0 ; rhs < NRHS ; ++rhs) { - const FReal* pole = cell.getMultipole(rhs); + const FReal* pole = cell.getMultipoleData().get(rhs); for (int val= 0 ; val < NVALS ; ++val) { - output<< " val : " << val << " exp: " ; - for (int i= 0 ; i < cell.getVectorSize() ; ++i) { - output<< pole[i] << " "; - } - output << std::endl; + output<< " val : " << val << " exp: " ; + for (int i= 0 ; i < cell.getVectorSize() ; ++i) { + output<< pole[i] << " "; + } + output << std::endl; } } return output; -- GitLab