Skip to content

Commit 10e406d

Browse files
authored
Merge pull request #100 from WIAS-PDELib/chmerdon/cellfinder_allocationhunt
remove allocations from cell finder
2 parents 57c64ef + 25de7a2 commit 10e406d

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

src/cellfinder.jl

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,13 +95,12 @@ Upon return, xref contains the barycentric coordinates of the point in the seque
9595
!!! warning
9696
Currently implemented for simplex grids only.
9797
"""
98-
function gFindLocal!(xref, CF::CellFinder{Tv, Ti}, x; icellstart::Int = 1, trybrute = true, eps = 1.0e-14) where {Tv, Ti}
99-
100-
# works for convex domainsand simplices only !
98+
function gFindLocal!(xref, CF::CellFinder{Tv, Ti}, x; icellstart = 1, trybrute = true, eps = 1.0e-14) where {Tv, Ti}
99+
# works for convex domains and simplices only !
101100
xCellFaces::Adjacency{Ti} = CF.xCellFaces
102101
xFaceCells::Adjacency{Ti} = CF.xFaceCells
103102
xCellGeometries::GridEGTypes = CF.xCellGeometries
104-
EG::GridEGTypes = CF.EG
103+
EG = CF.EG
105104
cx::Vector{Tv} = CF.cx
106105
cEG::Int = 0
107106
facetogo::Array{Array{Ti, 1}, 1} = CF.facetogo
@@ -124,7 +123,7 @@ function gFindLocal!(xref, CF::CellFinder{Tv, Ti}, x; icellstart::Int = 1, trybr
124123

125124
# update local 2 global map
126125
L2G = CF.L2G4EG[cEG]
127-
update_trafo!(L2G, icell)
126+
update_trafo!(L2G, icell) # 1 allocation
128127
L2Gb = L2G.b
129128

130129
# compute barycentric coordinates of node

0 commit comments

Comments
 (0)