Skip to content

Commit

Permalink
make the resizing test more legible
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrKryslUCSD committed Feb 9, 2024
1 parent a3dc247 commit 6cf9d80
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/AssemblyModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 6cf9d80

Please sign in to comment.