From 6cf9d807a5676c3da9a013100df25ce6ba26def9 Mon Sep 17 00:00:00 2001 From: Petr Krysl Date: Fri, 9 Feb 2024 10:05:34 -0800 Subject: [PATCH] make the resizing test more legible --- src/AssemblyModule.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/AssemblyModule.jl b/src/AssemblyModule.jl index ef5588bf..19d32c7d 100644 --- a/src/AssemblyModule.jl +++ b/src/AssemblyModule.jl @@ -213,7 +213,7 @@ function assemble!(self::SysmatAssemblerSparse, nrows = length(dofnums_row) ncolumns = length(dofnums_col) p = self.buffer_pointer - if p + ncolumns * nrows > self.buffer_length + if self.buffer_length < p + ncolumns * nrows - 1 self = _resize(self, ncolumns * nrows * 1000) end @assert size(mat) == (nrows, ncolumns) @@ -442,7 +442,7 @@ function assemble!(self::SysmatAssemblerSparseSymm, ncolumns = length(dofnums_col) @assert nrows == ncolumns p = self.buffer_pointer - if p + ncolumns * nrows > self.buffer_length + if self.buffer_length < p + ncolumns * nrows - 1 self = _resize(self, ncolumns * nrows * 1000) end @assert size(mat) == (nrows, ncolumns) @@ -642,7 +642,7 @@ function assemble!(self::SysmatAssemblerSparseDiag, ncolumns = length(dofnums_col) @assert nrows == ncolumns p = self.buffer_pointer - if p + ncolumns >= self.buffer_length + if self.buffer_length < p + ncolumns * nrows - 1 self = _resize(self, ncolumns * nrows * 1000) end @assert size(mat) == (nrows, ncolumns) @@ -961,7 +961,7 @@ function assemble!(self::SysmatAssemblerSparseHRZLumpingSymm, ncolumns = length(dofnums_col) @assert nrows == ncolumns p = self.buffer_pointer - if p + ncolumns >= self.buffer_length + if self.buffer_length < p + ncolumns * nrows - 1 self = _resize(self, ncolumns * nrows * 1000) end @assert size(mat) == (nrows, ncolumns)