Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/CellData/CellFields.jl
Original file line number Diff line number Diff line change
Expand Up @@ -243,14 +243,8 @@ end
get_data(f::GenericCellField) = f.cell_field
get_triangulation(f::GenericCellField) = f.trian
DomainStyle(::Type{GenericCellField{DS}}) where DS = DS()

(a::CellField)(x) = evaluate(a,x)

function evaluate!(cache,f::CellField,x::CellPoint)
_f, _x = _to_common_domain(f,x)
cell_field = get_data(_f)
cell_point = get_data(_x)
lazy_map(evaluate,cell_field,cell_point)
function similar_cell_field(f::GenericCellField,cell_data,trian,ds)
GenericCellField(cell_data,trian,ds)
end

function _to_common_domain(f::CellField,x::CellPoint)
Expand Down Expand Up @@ -689,3 +683,5 @@ function (a::SkeletonPair{<:CellField})(x)
Evaluating `n(x)` is not allowed. You need to call either `n.⁺(x)` or `n.⁻(x)`.
"""
end

# Interpolable struct
9 changes: 7 additions & 2 deletions src/CellData/Interpolation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@
# Interpolable struct
struct KDTreeSearch{T}
num_nearest_vertices::Int
accept_points_outside::Bool
tol::T
function KDTreeSearch(; num_nearest_vertices=1, tol=1.e-10)
function KDTreeSearch(; num_nearest_vertices=1,accept_points_outside=false, tol=1.e-10)
T = typeof(tol)
new{T}(num_nearest_vertices, tol)
new{T}(num_nearest_vertices,accept_points_outside, tol)
end
end

Expand Down Expand Up @@ -150,6 +151,10 @@ function _point_to_cell!(cache, x::Point)
(dist < tol) && return cell
end

if searchmethod.accept_points_outside == true
return nothing
end

# Output error message if cell not found
@check false "Point $x is not inside any active cell"
end
Expand Down
2 changes: 1 addition & 1 deletion src/ODEs/ODESolvers/RungeKuttaIMEX.jl
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ function ode_march!(

x = ex_slopes[i]
sysslvrcache = solve!(x, sysslvr, ex_stageop, sysslvrcache)
sysslvrcaches = _setindex_all!(sysslvrcaches, sysslvrcache, i)
sysslvrcaches = _setindex_all!(sysslvrcaches, sysslvrcache, 1)
end

# Update state
Expand Down