Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add open boundaries #442

Merged
merged 151 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
151 commits
Select commit Hold shift + click to select a range
2255b4a
implement `ExtrudeFace`
LasNikas Feb 5, 2024
48a753d
Merge branch 'main' into extrude-shape
LasNikas Feb 7, 2024
e299960
use `sample_face` in `interpolate_plane_3d`
LasNikas Feb 7, 2024
68b3546
add docs
LasNikas Feb 7, 2024
198eadd
add tests
LasNikas Feb 7, 2024
6c7cbde
Merge branch 'main' into extrude-shape
LasNikas Feb 7, 2024
4fe0358
fix bug
LasNikas Feb 7, 2024
c8e08f4
create `OpenBoundarySPHSystem`
LasNikas Feb 7, 2024
c915663
export OpenBoundarySPHSystem
LasNikas Feb 8, 2024
a509489
fix bug
LasNikas Feb 8, 2024
07dbc42
Merge branch 'extrude-shape' into rework-open-boundaries
LasNikas Feb 8, 2024
1d5d99c
add `tlsph=true`
LasNikas Feb 8, 2024
f82d0a7
Merge branch 'extrude-shape' into rework-open-boundaries
LasNikas Feb 8, 2024
2b472c9
fix tuple bug
LasNikas Feb 8, 2024
19fdc26
Merge branch 'extrude-shape' into rework-open-boundaries
LasNikas Feb 8, 2024
8d3c622
fix typo
LasNikas Feb 8, 2024
b83fd26
Merge branch 'extrude-shape' into rework-open-boundaries
LasNikas Feb 8, 2024
a5e2f1c
fix again
LasNikas Feb 8, 2024
3177542
Merge branch 'extrude-shape' into rework-open-boundaries
LasNikas Feb 8, 2024
2aa9696
fix for tests
LasNikas Feb 8, 2024
bde240d
fix layers
LasNikas Feb 8, 2024
bef4605
Merge branch 'extrude-shape' into rework-open-boundaries
LasNikas Feb 8, 2024
b3a979b
calculate particle spacing differently
LasNikas Feb 9, 2024
284c474
Merge branch 'extrude-shape' into rework-open-boundaries
LasNikas Feb 9, 2024
3521b0d
Merge branch 'main' into extrude-shape
LasNikas Feb 9, 2024
e6abe8f
Merge branch 'main' into rework-open-boundaries
LasNikas Feb 9, 2024
4c6bcf9
add show-tests
LasNikas Feb 9, 2024
33f4fc9
add `within_boundary_zone`
LasNikas Feb 9, 2024
f4cd243
change `floor` to `ceil`
LasNikas Feb 9, 2024
7e01ecc
Merge branch 'main' into extrude-shape
LasNikas Feb 12, 2024
a6b16d8
Merge branch 'main' into rework-open-boundaries
LasNikas Feb 12, 2024
b74772d
Merge branch 'extrude-shape' into rework-open-boundaries
LasNikas Feb 12, 2024
6c6a464
boundary zone tests
LasNikas Feb 12, 2024
99645bb
add `evaluate_characteristics`
LasNikas Feb 13, 2024
2284733
add tests
LasNikas Feb 13, 2024
59bdaef
add reference functions
LasNikas Feb 13, 2024
e270102
add `update_quantities!`
LasNikas Feb 13, 2024
129c786
add buffer
LasNikas Feb 13, 2024
03dce7e
add `SystemBuffer` tests
LasNikas Feb 13, 2024
bd5fe1d
cosmetic change in tests
LasNikas Feb 13, 2024
199678b
change `round` to `isapprox`
LasNikas Feb 13, 2024
19523e8
Merge branch 'extrude-shape' into rework-open-boundaries
LasNikas Feb 13, 2024
4d3ea48
add update callback
LasNikas Feb 15, 2024
a5f3149
add `UpdateCallback`
LasNikas Feb 15, 2024
68fadad
add `update_open_boundaries`
LasNikas Feb 15, 2024
5be7af8
fix bugs
LasNikas Feb 15, 2024
b1fac9d
add timers
LasNikas Feb 15, 2024
8ed0966
write prescribed quantities
LasNikas Feb 16, 2024
dbd45a8
Merge branch 'main' into rework-open-boundaries
LasNikas Feb 16, 2024
faad377
improve dispatching
LasNikas Feb 16, 2024
c656604
add example `pipe_flow_2d.jl`
LasNikas Feb 16, 2024
b19577f
add docs `UpdateCallback`
LasNikas Feb 16, 2024
bdac960
Merge branch 'main' into rework-open-boundaries
LasNikas Feb 22, 2024
38902d9
add `UpdateCallback`
LasNikas Feb 22, 2024
cc3477c
fix typo
LasNikas Feb 22, 2024
47950d2
Merge branch 'main' into rework-open-boundaries
LasNikas Mar 5, 2024
77b120b
Merge branch 'main' into update-callback
LasNikas Mar 5, 2024
983080a
Merge branch 'main' into update-callback
LasNikas Mar 5, 2024
c6c0b11
apply formatter
LasNikas Mar 5, 2024
0fce642
Merge branch 'main' into rework-open-boundaries
LasNikas Mar 7, 2024
862a817
modify system buffer
LasNikas Mar 7, 2024
d55eb27
add docstring
LasNikas Mar 7, 2024
d6d80ff
add docs
LasNikas Mar 7, 2024
5eeecd5
fix tests
LasNikas Mar 7, 2024
cba3cff
fix typos
LasNikas Mar 7, 2024
9f52875
apply formatter
LasNikas Mar 7, 2024
96b15c6
fix tests
LasNikas Mar 7, 2024
84d5828
add comment
LasNikas Mar 7, 2024
ed9c86c
fix tests
LasNikas Mar 8, 2024
e3d72a9
Merge branch 'main' into update-callback
LasNikas Mar 16, 2024
f1a7758
Merge branch 'main' into update-callback
LasNikas Apr 2, 2024
b8e877e
Merge branch 'main' into rework-open-boundaries
LasNikas Apr 2, 2024
b73b5a4
Merge branch 'main' into update-callback
LasNikas Apr 5, 2024
d5bb8f9
Merge branch 'main' into rework-open-boundaries
LasNikas Apr 5, 2024
66f863b
Merge branch 'main' into update-callback
LasNikas Apr 19, 2024
08b47f2
remove update bool
LasNikas Apr 19, 2024
8769c85
Merge branch 'main' into rework-open-boundaries
LasNikas Apr 19, 2024
defe2e0
Merge branch 'update-callback' into rework-open-boundaries
LasNikas Apr 19, 2024
c240b47
adapt docstring
LasNikas Apr 19, 2024
824895a
Merge branch 'main' into update-callback
LasNikas Apr 26, 2024
896bcf4
implement suggestions
LasNikas Apr 26, 2024
75594d4
Merge branch 'main' into rework-open-boundaries
LasNikas Apr 26, 2024
00212fe
Merge branch 'update-callback' into rework-open-boundaries
LasNikas Apr 26, 2024
0346b00
Merge branch 'main' into rework-open-boundaries
LasNikas May 6, 2024
d15ba7a
fix test
LasNikas May 6, 2024
58baa9c
Merge branch 'main' into rework-open-boundaries
LasNikas May 14, 2024
fac85ad
add check if callback is used
LasNikas May 14, 2024
92d2fe9
add comments in example file
LasNikas May 14, 2024
3adbb7b
generic types
LasNikas May 14, 2024
81e0875
merge main
LasNikas May 21, 2024
27e71ab
undo combining compact support with DEM
LasNikas May 21, 2024
0203a3a
remove density and pressure setter
LasNikas May 21, 2024
d8a06e7
implement suggestions
LasNikas May 21, 2024
118ac97
fix tests
LasNikas May 21, 2024
8de1cc3
Merge branch 'main' into rework-open-boundaries
LasNikas May 21, 2024
b8831a4
Merge branch 'main' into rework-open-boundaries
LasNikas May 24, 2024
c77a71a
Revert "remove density and pressure setter"
LasNikas May 24, 2024
5a5b007
implement suggestions
LasNikas May 24, 2024
61b5ebb
Merge branch 'main' into rework-open-boundaries
LasNikas May 25, 2024
b12bc5e
rework in- and outflow
LasNikas May 25, 2024
147a18d
rename setter functions
LasNikas May 27, 2024
75615f2
rename function
LasNikas May 27, 2024
a3adf1d
adapt tests
LasNikas May 27, 2024
9401be9
add docs
LasNikas May 27, 2024
d55d084
Merge branch 'rework-inflow-outflow' into rework-open-boundaries
LasNikas May 27, 2024
1533a91
rename function
LasNikas May 27, 2024
a9e91ce
apply formatter
LasNikas May 27, 2024
38f5034
fix tests
LasNikas May 27, 2024
e293001
fix bug in plot recipes
LasNikas May 27, 2024
e2dcc01
apply formatter
LasNikas May 27, 2024
d191840
Merge branch 'main' into rework-open-boundaries
LasNikas May 29, 2024
b948fd5
Merge branch 'main' into rework-open-boundaries
LasNikas Jun 3, 2024
9de2c48
implement suggestions for `boundary_zone.jl`
LasNikas Jun 3, 2024
38c05ef
rename kwarg
LasNikas Jun 3, 2024
032e7da
implement suggestions
LasNikas Jun 4, 2024
e341098
implement suggestions
LasNikas Jun 5, 2024
4aa2a89
modify `check_domain!`
LasNikas Jun 5, 2024
d23f53e
add comments and check for fluid system with buffer
LasNikas Jun 6, 2024
6f3ed3e
modify error message
LasNikas Jun 6, 2024
39fe9f0
fix tests
LasNikas Jun 6, 2024
e1ed3fc
fix `callback_used`
LasNikas Jun 6, 2024
a17161a
using Measurements
LasNikas Jun 6, 2024
fb162a5
fix tests
LasNikas Jun 6, 2024
2dbc8bb
sqrt(eps())
LasNikas Jun 6, 2024
0495ab9
fix tests again
LasNikas Jun 6, 2024
079d5e1
add doc to `boundary.md`
LasNikas Jun 6, 2024
421743d
link single fluid system
LasNikas Jun 6, 2024
1b970e5
fix tests
LasNikas Jun 6, 2024
db97c6c
implement suggestions
LasNikas Jun 7, 2024
c12d8de
fix tests
LasNikas Jun 7, 2024
5647c20
change the order of functions
LasNikas Jun 7, 2024
b2f7ace
modify example
LasNikas Jun 7, 2024
2f32f91
fix tests
LasNikas Jun 7, 2024
6799dc7
fix test again
LasNikas Jun 7, 2024
172da98
implement doc suggestions
LasNikas Jun 7, 2024
19c3089
modify dos
LasNikas Jun 7, 2024
f340064
fix typos
LasNikas Jun 7, 2024
992cda3
implement suggestions
LasNikas Jun 17, 2024
cfcd470
Merge branch 'main' into rework-open-boundaries
LasNikas Jun 17, 2024
ed69a40
implement suggestions
LasNikas Jun 18, 2024
ad46679
Merge branch 'main' into rework-open-boundaries
LasNikas Jun 18, 2024
01819b4
add EDAC to the example
LasNikas Jun 18, 2024
417a5b3
implement suggestions
LasNikas Jun 19, 2024
9a0c81e
Merge branch 'main' into rework-open-boundaries
LasNikas Jun 19, 2024
b0f076e
modify tests
LasNikas Jun 19, 2024
7a45ddf
adapt docs
LasNikas Jun 19, 2024
aafb4b8
Merge branch 'main' into rework-open-boundaries
LasNikas Jun 19, 2024
57e2639
add `initial_callback_flag`
LasNikas Jun 19, 2024
9c80e3f
add to `NEWS.md` and `README.md`
LasNikas Jun 19, 2024
4fed7ad
implement suggestions
LasNikas Jun 19, 2024
b0d6563
fix typo
LasNikas Jun 19, 2024
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
10 changes: 7 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Changelog

TrixiParticles.jl follows the interpretation of [semantic versioning (semver)](https://julialang.github.io/Pkg.jl/dev/compatibility/#Version-specifier-format-1)
used in the Julia ecosystem. Notable changes will be documented in this file for human readability.
We aim at 3 to 4 month between major release versions and about 2 weeks between minor versions.
used in the Julia ecosystem. Notable changes will be documented in this file for human readability.
We aim at 3 to 4 month between major release versions and about 2 weeks between minor versions.

## Version 0.2.x

Expand All @@ -14,11 +14,15 @@ We aim at 3 to 4 month between major release versions and about 2 weeks between

### Deprecated

## Version 0.1.3

### Added
Open boundaries using the method of characteristics based on the work of Lastiwka et al., "Permeable and non-reflecting boundary conditions in SPH" (2009) was added for WCSPH and EDAC.
LasNikas marked this conversation as resolved.
Show resolved Hide resolved

## Version 0.1.2

### Added
A surface tension and adhesion model based on the work by Akinci et al., "Versatile Surface Tension and Adhesion for SPH Fluids" (2013) was added to WCSPH
A surface tension and adhesion model based on the work by Akinci et al., "Versatile Surface Tension and Adhesion for SPH Fluids" (2013) was added to WCSPH.

## Version 0.1.1

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Its features include:
## Features
- Incompressible Navier-Stokes
- Methods: Weakly Compressible Smoothed Particle Hydrodynamics (WCSPH), Entropically Damped Artificial Compressibility (EDAC)
- Models: Surface Tension
- Models: Surface Tension, Open Boundaries
- Solid-body mechanics
- Methods: Total Lagrangian SPH (TLSPH), Discrete Element Method (DEM)
- Fluid-Structure Interaction
Expand Down
6 changes: 6 additions & 0 deletions src/general/semidiscretization.jl
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,9 @@ function semidiscretize(semi, tspan; reset_threads=true, data_type=nothing)

# Initialize this system
initialize!(system, neighborhood_search)

# Only for systems requiring a mandatory callback
initial_callback_flag!(system)
end
end

Expand Down Expand Up @@ -355,6 +358,9 @@ function restart_with!(semi, sol; reset_threads=true)
u = wrap_u(sol.u[end].x[2], system, semi)

restart_with!(system, v, u)

# Only for systems requiring a mandatory callback
initial_callback_flag!(system)
end

return semi
Expand Down
3 changes: 3 additions & 0 deletions src/general/system.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,6 @@ end
function update_final!(system, v, u, v_ode, u_ode, semi, t; update_from_callback=false)
return system
end

# Only for systems requiring a mandatory callback
initial_callback_flag!(system) = system
20 changes: 10 additions & 10 deletions src/schemes/boundary/open_boundary/boundary_zones.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ The specified plane (line in 2D or rectangle in 3D) will be extruded in upstream
direction (the direction opposite to `flow_direction`) to create a box for the boundary zone.
There are three ways to specify the actual shape of the inflow:
1. Don't pass `initial_condition` or `extrude_geometry`. The boundary zone box will then
be filled with inflow particles.
2. Pass a 1D shape in 2D or a 2D shape in 3D, which is then extruded in upstream direction
to create the inflow particles.
be filled with inflow particles (default).
2. Specify `extrude_geometry` by passing a 1D shape in 2D or a 2D shape in 3D,
which is then extruded in upstream direction to create the inflow particles.
- In 2D, the shape must be either an initial condition with 2D coordinates, which lies
on the line specified by `plane`, or an initial condition with 1D coordinates, which lies
on the line specified by `plane` when a y-coordinate of `0` is added.
- In 3D, the shape must be either an initial condition with 3D coordinates, which lies
in the rectangle specified by `plane`, or an initial condition with 2D coordinates,
which lies in the rectangle specified by `plane` when a z-coordinate of `0` is added.
3. Pass a 2D initial condition in 2D or a 3D initial condition in 3D, which will be used
for the inflow particles.
3. Specify `initial_condition` by passing a 2D initial condition in 2D or a 3D initial condition in 3D,
which will be used for the inflow particles.

!!! note "Note"
Particles outside the boundary zone box will be removed.
Expand Down Expand Up @@ -145,17 +145,17 @@ The specified plane (line in 2D or rectangle in 3D) will be extruded in downstre
direction (the direction in `flow_direction`) to create a box for the boundary zone.
There are three ways to specify the actual shape of the outflow:
1. Don't pass `initial_condition` or `extrude_geometry`. The boundary zone box will then
be filled with outflow particles.
2. Pass a 1D shape in 2D or a 2D shape in 3D, which is then extruded in downstream direction
to create the outflow particles.
be filled with outflow particles (default).
2. Specify `extrude_geometry` by passing a 1D shape in 2D or a 2D shape in 3D,
which is then extruded in downstream direction to create the outflow particles.
- In 2D, the shape must be either an initial condition with 2D coordinates, which lies
on the line specified by `plane`, or an initial condition with 1D coordinates, which lies
on the line specified by `plane` when a y-coordinate of `0` is added.
- In 3D, the shape must be either an initial condition with 3D coordinates, which lies
in the rectangle specified by `plane`, or an initial condition with 2D coordinates,
which lies in the rectangle specified by `plane` when a z-coordinate of `0` is added.
3. Pass a 2D initial condition in 2D or a 3D initial condition in 3D, which will be used
for the outflow particles.
3. Specify `initial_condition` by passing a 2D initial condition in 2D or a 3D initial condition in 3D,
which will be used for the outflow particles.

!!! note "Note"
Particles outside the boundary zone box will be removed.
Expand Down
6 changes: 6 additions & 0 deletions src/schemes/boundary/open_boundary/system.jl
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,12 @@ function Base.show(io::IO, ::MIME"text/plain", system::OpenBoundarySPHSystem)
end
end

function initial_callback_flag!(system::OpenBoundarySPHSystem)
LasNikas marked this conversation as resolved.
Show resolved Hide resolved
system.update_callback_used[] = false

return system
end

update_callback_used!(system::OpenBoundarySPHSystem) = system.update_callback_used[] = true

@inline source_terms(system::OpenBoundarySPHSystem) = nothing
Expand Down
1 change: 0 additions & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ GLM = "38e38edf-8417-5370-95a0-9cbb8c7f171a"
Glob = "c27321d9-0574-5035-807b-f59d2c89b15c"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
Measurements = "eff96d63-e80a-5855-80a2-b1b0885c5ab7"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Polyester = "f517fe37-dbe3-4b94-8317-1923a5111588"
Expand Down
68 changes: 34 additions & 34 deletions test/schemes/boundary/open_boundary/boundary_zone.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
plane_points_1 = [[0.0, 0.0], [0.5, -0.5], [1.0, 0.5]]
plane_points_2 = [[0.0, 1.0], [0.2, 2.0], [2.3, 0.5]]

@testset "Points $(i)" for i in eachindex(plane_points_1)
@testset verbose=true "Points $(i)" for i in eachindex(plane_points_1)
point_1 = plane_points_1[i]
point_2 = plane_points_2[i]

Expand All @@ -17,7 +17,7 @@
-normalize([-plane_size[2], plane_size[1]]),
]

@testset "Flow Direction $(j)" for j in eachindex(flow_directions)
@testset verbose=true "Flow Direction $(j)" for j in eachindex(flow_directions)
inflow = InFlow(; plane=(point_1, point_2), particle_spacing,
flow_direction=flow_directions[j], density=1.0,
open_boundary_layers)
Expand All @@ -30,17 +30,18 @@
outflow,
]

@testset "$boundary_zone" for boundary_zone in boundary_zones
@testset verbose=true "$(nameof(typeof(boundary_zone)))" for boundary_zone in boundary_zones
zone_width = open_boundary_layers *
boundary_zone.initial_condition.particle_spacing
sign_ = (boundary_zone isa InFlow) ? -1 : 1

@test plane_points_1[i] == boundary_zone.zone_origin
@test plane_points_2[i] - boundary_zone.zone_origin ==
boundary_zone.spanning_set[2]
@test sign_ * flow_directions[j] ≈
normalize(boundary_zone.spanning_set[1])
@test zone_width ≈ norm(boundary_zone.spanning_set[1])
@test isapprox(sign_ * flow_directions[j],
normalize(boundary_zone.spanning_set[1]), atol=1e-14)
@test isapprox(zone_width, norm(boundary_zone.spanning_set[1]),
atol=1e-14)
end
end
end
Expand All @@ -63,7 +64,7 @@
[0.3113730847835541, 0.25057315826416016, -0.02374829351902008],
]

@testset "Points $(i)" for i in eachindex(plane_points_1)
@testset verbose=true "Points $(i)" for i in eachindex(plane_points_1)
LasNikas marked this conversation as resolved.
Show resolved Hide resolved
point_1 = plane_points_1[i]
point_2 = plane_points_2[i]
point_3 = plane_points_3[i]
Expand All @@ -76,7 +77,7 @@
-normalize(cross(edge1, edge2)),
]

@testset "Flow Direction $(j)" for j in eachindex(flow_directions)
@testset verbose=true "Flow Direction $(j)" for j in eachindex(flow_directions)
LasNikas marked this conversation as resolved.
Show resolved Hide resolved
inflow = InFlow(; plane=(point_1, point_2, point_3), particle_spacing,
flow_direction=flow_directions[j], density=1.0,
open_boundary_layers)
Expand All @@ -89,7 +90,7 @@
outflow,
]

@testset "$boundary_zone" for boundary_zone in boundary_zones
@testset verbose=true "$(nameof(typeof(boundary_zone)))" for boundary_zone in boundary_zones
zone_width = open_boundary_layers *
boundary_zone.initial_condition.particle_spacing
sign_ = (boundary_zone isa InFlow) ? -1 : 1
Expand All @@ -99,9 +100,10 @@
boundary_zone.spanning_set[2]
@test plane_points_3[i] - boundary_zone.zone_origin ==
boundary_zone.spanning_set[3]
@test sign_ * flow_directions[j] ≈
normalize(boundary_zone.spanning_set[1])
@test zone_width ≈ norm(boundary_zone.spanning_set[1])
@test isapprox(sign_ * flow_directions[j],
normalize(boundary_zone.spanning_set[1]), atol=1e-14)
@test isapprox(zone_width, norm(boundary_zone.spanning_set[1]),
atol=1e-14)
end
end
end
Expand All @@ -123,26 +125,25 @@
outflow,
]

@testset "$(nameof(typeof(boundary_zone)))" for boundary_zone in boundary_zones
perturb_ = boundary_zone isa InFlow ? eps() : -eps()
@testset verbose=true "$(nameof(typeof(boundary_zone)))" for boundary_zone in boundary_zones
perturb_ = boundary_zone isa InFlow ? sqrt(eps()) : -sqrt(eps())

point_3 = boundary_zone.spanning_set[1] + boundary_zone.zone_origin
point1 = plane_points[1]
point2 = plane_points[2]
point3 = boundary_zone.spanning_set[1] + boundary_zone.zone_origin

query_points = Dict(
"Behind" => ([-1.0, -1.0], false),
"Before" => ([2.0, 2.0], false),
"On Point 1" => (plane_points[1], true),
"On Point 2" => (plane_points[2], true),
"On Point 3" => (point_3, true),
"Closely On Point 1" => (plane_points[1] .+ perturb_ * flow_direction,
false))
"Closely On Point 1" => (point1 + perturb_ * flow_direction, false),
"Closely On Point 2" => (point2 + perturb_ * flow_direction, false),
"Closely On Point 3" => (point3 - perturb_ * flow_direction, false))

@testset "$k" for k in keys(query_points)
@testset verbose=true "$k" for k in keys(query_points)
(particle_position, evaluation) = query_points[k]

@test evaluation ==
TrixiParticles.is_in_boundary_zone(boundary_zone,
particle_position .± eps())
TrixiParticles.is_in_boundary_zone(boundary_zone, particle_position)
end
end
end
Expand All @@ -164,24 +165,23 @@
outflow,
]

@testset "$(nameof(typeof(boundary_zone)))" for boundary_zone in boundary_zones
@testset verbose=true "$(nameof(typeof(boundary_zone)))" for boundary_zone in boundary_zones
perturb_ = boundary_zone isa InFlow ? eps() : -eps()
point4 = boundary_zone.spanning_set[1] + boundary_zone.zone_origin

query_points = Dict(
"Behind" => ([-1.0, -1.0, 1.2], false),
"Before" => ([2.0, 2.0, -1.2], false),
"On Point 1" => (point1, true),
"On Point 2" => (point2, true),
"On Point 3" => (point3, true),
"On Point 4" => (boundary_zone.spanning_set[1] + boundary_zone.zone_origin,
true),
"Closely On Point 1" => (point1 .+ perturb_ * flow_direction, false))

@testset "$k" for k in keys(query_points)
"Closely On Point 1" => (point1 + perturb_ * flow_direction, false),
"Closely On Point 2" => (point2 + perturb_ * flow_direction, false),
"Closely On Point 3" => (point3 + perturb_ * flow_direction, false),
"Closely On Point 4" => (point4 - perturb_ * flow_direction, false))

@testset verbose=true "$k" for k in keys(query_points)
(particle_position, evaluation) = query_points[k]

@test evaluation ==
TrixiParticles.is_in_boundary_zone(boundary_zone,
particle_position .± eps())
TrixiParticles.is_in_boundary_zone(boundary_zone, particle_position)
end
end
end
Expand Down
1 change: 0 additions & 1 deletion test/test_util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ using DataFrames: DataFrame
using JSON: JSON
using QuadGK: quadgk # For integration in smoothing kernel tests
using Random: Random # For rectangular patch
using Measurements: ±
using Polyester: disable_polyester_threads # For `count_rhs_allocations`

"""
Expand Down