From cb4438575c4215bc16a802acf8ba60d20f702ace Mon Sep 17 00:00:00 2001 From: LasNikas Date: Tue, 16 Jul 2024 14:00:56 +0200 Subject: [PATCH] fix show box --- test/systems/open_boundary_system.jl | 43 +++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 7 deletions(-) diff --git a/test/systems/open_boundary_system.jl b/test/systems/open_boundary_system.jl index 1158aaff0..64f1b10dc 100644 --- a/test/systems/open_boundary_system.jl +++ b/test/systems/open_boundary_system.jl @@ -16,8 +16,11 @@ reference_velocity = 1.0 @test_throws ArgumentError(error_str) OpenBoundarySPHSystem(inflow; sound_speed=1.0, + boundary_model=BoundaryModelLastiwka(), buffer_size=0, fluid_system=FluidSystemMock2(), + reference_density=0, + reference_pressure=0, reference_velocity) error_str = "`reference_pressure` must be either a function mapping " * @@ -26,8 +29,14 @@ reference_pressure = [1.0, 1.0] @test_throws ArgumentError(error_str) OpenBoundarySPHSystem(inflow; sound_speed=1.0, + boundary_model=BoundaryModelLastiwka(), buffer_size=0, fluid_system=FluidSystemMock2(), + reference_density=0, + reference_velocity=[ + 1.0, + 1.0, + ], reference_pressure) error_str = "`reference_density` must be either a function mapping " * @@ -36,14 +45,28 @@ reference_density = [1.0, 1.0] @test_throws ArgumentError(error_str) OpenBoundarySPHSystem(inflow; sound_speed=1.0, + boundary_model=BoundaryModelLastiwka(), buffer_size=0, fluid_system=FluidSystemMock2(), - reference_density) + reference_density, + reference_velocity=[ + 1.0, + 1.0, + ], + reference_pressure=0) end @testset "`show`" begin + f1(pos, t) = SVector(0.0, 0.0) + f2(pos, t) = 0.0 + f3(pos, t) = 0.0 + inflow = InFlow(; plane=([0.0, 0.0], [0.0, 1.0]), particle_spacing=0.05, flow_direction=(1.0, 0.0), density=1.0, open_boundary_layers=4) system = OpenBoundarySPHSystem(inflow; sound_speed=1.0, buffer_size=0, + boundary_model=BoundaryModelLastiwka(), + reference_density=f1, + reference_pressure=f2, + reference_velocity=f3, fluid_system=FluidSystemMock2()) show_compact = "OpenBoundarySPHSystem{2}(InFlow) with 80 particles" @@ -55,11 +78,12 @@ │ #particles: ………………………………………………… 80 │ │ #buffer_particles: ……………………………… 0 │ │ fluid system: …………………………………………… FluidSystemMock2 │ + │ boundary model: ……………………………………… BoundaryModelLastiwka │ │ boundary: ……………………………………………………… InFlow │ │ flow direction: ……………………………………… [1.0, 0.0] │ - │ prescribed velocity: ………………………… constant_vector │ - │ prescribed pressure: ………………………… constant_scalar │ - │ prescribed density: …………………………… constant_scalar │ + │ prescribed velocity: ………………………… #f3 │ + │ prescribed pressure: ………………………… #f2 │ + │ prescribed density: …………………………… #f1 │ │ width: ……………………………………………………………… 0.2 │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘""" @test repr("text/plain", system) == show_box @@ -67,6 +91,10 @@ outflow = OutFlow(; plane=([0.0, 0.0], [0.0, 1.0]), particle_spacing=0.05, flow_direction=(1.0, 0.0), density=1.0, open_boundary_layers=4) system = OpenBoundarySPHSystem(outflow; sound_speed=1.0, buffer_size=0, + boundary_model=BoundaryModelLastiwka(), + reference_density=f1, + reference_pressure=f2, + reference_velocity=f3, fluid_system=FluidSystemMock2()) show_compact = "OpenBoundarySPHSystem{2}(OutFlow) with 80 particles" @@ -78,11 +106,12 @@ │ #particles: ………………………………………………… 80 │ │ #buffer_particles: ……………………………… 0 │ │ fluid system: …………………………………………… FluidSystemMock2 │ + │ boundary model: ……………………………………… BoundaryModelLastiwka │ │ boundary: ……………………………………………………… OutFlow │ │ flow direction: ……………………………………… [1.0, 0.0] │ - │ prescribed velocity: ………………………… constant_vector │ - │ prescribed pressure: ………………………… constant_scalar │ - │ prescribed density: …………………………… constant_scalar │ + │ prescribed velocity: ………………………… #f3 │ + │ prescribed pressure: ………………………… #f2 │ + │ prescribed density: …………………………… #f1 │ │ width: ……………………………………………………………… 0.2 │ └──────────────────────────────────────────────────────────────────────────────────────────────────┘""" @test repr("text/plain", system) == show_box