Skip to content

Commit

Permalink
initialize all buffers to one/zero
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrKryslUCSD committed Mar 11, 2023
1 parent 8316d11 commit 357908e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "FinEtools"
uuid = "91bb5406-6c9a-523d-811d-0644c4229550"
authors = ["Petr Krysl <[email protected]>"]
version = "6.0.4"
version = "6.0.5"

[deps]
ChunkSplitters = "ae650224-84b6-46f8-82ea-d812ca08434e"
Expand Down
20 changes: 17 additions & 3 deletions src/AssemblyModule.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ Type for assembling a sparse global matrix from elementwise matrices.
!!! note
All fields of the datatype are private. No need to access them directly.
All fields of the datatype are private. The type is manipulated by the
functions `startassembly!`, `assemble!`, and `makematrix`.
"""
mutable struct SysmatAssemblerSparse{IT, MBT, IBT} <: AbstractSysmatAssembler
buffer_length::IT
Expand Down Expand Up @@ -148,6 +149,9 @@ function startassembly!(
resize!(self.rowbuffer, self.buffer_length)
resize!(self.colbuffer, self.buffer_length)
resize!(self.matbuffer, self.buffer_length)
self.rowbuffer .= 1
self.colbuffer .= 1
self.matbuffer .= 0
self.buffer_pointer = 1
self.ndofs_row = ndofs_row
self.ndofs_col = ndofs_col
Expand Down Expand Up @@ -325,6 +329,9 @@ function startassembly!(
resize!(self.rowbuffer, self.buffer_length)
resize!(self.colbuffer, self.buffer_length)
resize!(self.matbuffer, self.buffer_length)
self.rowbuffer .= 1
self.colbuffer .= 1
self.matbuffer .= 0
self.buffer_pointer = 1
self.ndofs = ndofs
end
Expand Down Expand Up @@ -480,6 +487,9 @@ function startassembly!(
resize!(self.rowbuffer, self.buffer_length)
resize!(self.colbuffer, self.buffer_length)
resize!(self.matbuffer, self.buffer_length)
self.rowbuffer .= 1
self.colbuffer .= 1
self.matbuffer .= 0
self.buffer_pointer = 1
self.ndofs = ndofs
end
Expand Down Expand Up @@ -646,7 +656,7 @@ the first call to the method assemble.
function startassembly!(self::SysvecAssembler, ndofs_row)
self.ndofs = ndofs_row
resize!(self.F_buffer, self.ndofs)
self.F_buffer .= zero(eltype(self.F_buffer))
self.F_buffer .= 0
return self
end

Expand Down Expand Up @@ -755,6 +765,9 @@ function startassembly!(
resize!(self.rowbuffer, self.buffer_length)
resize!(self.colbuffer, self.buffer_length)
resize!(self.matbuffer, self.buffer_length)
self.rowbuffer .= 1
self.colbuffer .= 1
self.matbuffer .= 0
self.buffer_pointer = 1
self.ndofs = ndofs
end
Expand Down Expand Up @@ -868,7 +881,8 @@ Type for assembling a sparse global matrix from elementwise matrices.
!!! note
All fields of the datatype are private. No need to access them directly.
All fields of the datatype are private. The type is manipulated by the
functions `startassembly!`, `assemble!`, and `makematrix`.
"""
mutable struct SysmatAssemblerReduced{MT, TMT, IT} <: AbstractSysmatAssembler
m::MT # reduced system matrix
Expand Down

2 comments on commit 357908e

@PetrKryslUCSD
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/79413

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v6.0.5 -m "<description of version>" 357908ee9e2b00c2281d8ec3219674f9680b4042
git push origin v6.0.5

Please sign in to comment.