From bd1c0c9ba99f4624dedae83c05aed640a6a87950 Mon Sep 17 00:00:00 2001 From: chmerdon Date: Wed, 5 Nov 2025 08:23:26 +0100 Subject: [PATCH 1/2] removed some allocations and identified line of another --- src/cellfinder.jl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/cellfinder.jl b/src/cellfinder.jl index dafead3a..1240d52b 100644 --- a/src/cellfinder.jl +++ b/src/cellfinder.jl @@ -95,13 +95,12 @@ Upon return, xref contains the barycentric coordinates of the point in the seque !!! warning Currently implemented for simplex grids only. """ -function gFindLocal!(xref, CF::CellFinder{Tv, Ti}, x; icellstart::Int = 1, trybrute = true, eps = 1.0e-14) where {Tv, Ti} - - # works for convex domainsand simplices only ! +function gFindLocal!(xref, CF::CellFinder{Tv, Ti}, x; icellstart = 1, trybrute = true, eps = 1.0e-14) where {Tv, Ti} + # works for convex domains and simplices only ! xCellFaces::Adjacency{Ti} = CF.xCellFaces xFaceCells::Adjacency{Ti} = CF.xFaceCells xCellGeometries::GridEGTypes = CF.xCellGeometries - EG::GridEGTypes = CF.EG + EG = CF.EG cx::Vector{Tv} = CF.cx cEG::Int = 0 facetogo::Array{Array{Ti, 1}, 1} = CF.facetogo @@ -111,7 +110,7 @@ function gFindLocal!(xref, CF::CellFinder{Tv, Ti}, x; icellstart::Int = 1, trybr xreftest::Array{Tv, 1} = CF.xreftest L2G::L2GTransformer{Tv, Ti} = CF.L2G4EG[1] L2Gb::Vector{Tv} = L2G.b - + invA::Matrix{Tv} = CF.invA imin::Int = 0 @@ -124,7 +123,7 @@ function gFindLocal!(xref, CF::CellFinder{Tv, Ti}, x; icellstart::Int = 1, trybr # update local 2 global map L2G = CF.L2G4EG[cEG] - update_trafo!(L2G, icell) + update_trafo!(L2G, icell) # 1 allocation L2Gb = L2G.b # compute barycentric coordinates of node From 25de7a28341f0f1dd9e00297ac7d683f32ffcd9b Mon Sep 17 00:00:00 2001 From: chmerdon Date: Wed, 5 Nov 2025 08:41:51 +0100 Subject: [PATCH 2/2] formatting fix --- src/cellfinder.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cellfinder.jl b/src/cellfinder.jl index 1240d52b..0a2d7232 100644 --- a/src/cellfinder.jl +++ b/src/cellfinder.jl @@ -110,7 +110,7 @@ function gFindLocal!(xref, CF::CellFinder{Tv, Ti}, x; icellstart = 1, trybrute = xreftest::Array{Tv, 1} = CF.xreftest L2G::L2GTransformer{Tv, Ti} = CF.L2G4EG[1] L2Gb::Vector{Tv} = L2G.b - + invA::Matrix{Tv} = CF.invA imin::Int = 0