From 76af2e1945b25b5427f74539753f8ff28035a847 Mon Sep 17 00:00:00 2001 From: Douglas Serson Date: Thu, 11 Aug 2016 12:47:01 +0100 Subject: [PATCH] Perform asserts as soon as possible --- library/MultiRegions/ExpListHomogeneous1D.cpp | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/library/MultiRegions/ExpListHomogeneous1D.cpp b/library/MultiRegions/ExpListHomogeneous1D.cpp index 96948a54a..26e861e18 100644 --- a/library/MultiRegions/ExpListHomogeneous1D.cpp +++ b/library/MultiRegions/ExpListHomogeneous1D.cpp @@ -71,13 +71,6 @@ namespace Nektar m_comm->GetColumnComm()->GetColumnComm() : m_comm->GetColumnComm(); - m_transposition = MemoryManager - ::AllocateSharedPtr(HomoBasis, m_comm, m_StripZcomm); - - m_planes = Array( - m_homogeneousBasis->GetNumPoints() / - m_StripZcomm->GetSize()); - ASSERTL0( m_homogeneousBasis->GetNumPoints() % m_StripZcomm->GetSize() == 0, "HomModesZ should be a multiple of npz."); @@ -87,10 +80,19 @@ namespace Nektar && (m_homogeneousBasis->GetBasisType() != LibUtilities::eFourierHalfModeIm) ) { - ASSERTL0( m_planes.num_elements() % 2 == 0, - "HomModesZ/npz should be an even integer."); + ASSERTL0( + (m_homogeneousBasis->GetNumPoints() / + m_StripZcomm->GetSize()) % 2 == 0, + "HomModesZ/npz should be an even integer."); } + m_transposition = MemoryManager + ::AllocateSharedPtr(HomoBasis, m_comm, m_StripZcomm); + + m_planes = Array( + m_homogeneousBasis->GetNumPoints() / + m_StripZcomm->GetSize()); + if(m_useFFT) { m_FFT = LibUtilities::GetNektarFFTFactory().CreateInstance( -- GitLab