Skip to content

Commit

Permalink
Merge pull request #19 from marcelschurer/tests
Browse files Browse the repository at this point in the history
Tests
  • Loading branch information
marcelschurer authored Dec 16, 2024
2 parents 38d2ff0 + 85792cd commit 4400cda
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions test/preprocessing/preprocessing.jl
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
include("geometries/geometries.jl")
include("readvtk/readvtk.jl")
31 changes: 31 additions & 0 deletions test/preprocessing/readvtk/vtk2trixi.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
@testset verbose=true "vtk2trixi" begin
@testset verbose=true "Functionality Check - 2D" begin

# 'InitialCondition'-Files
saved_ic = RectangularShape(0.1, (2, 2),
(0, 0), density=1.5,
velocity=(1.0, 2.0), pressure=1000.0)
filename = "is_write_out"
file = trixi2vtk(saved_ic; filename=filename)

loaded_ic = vtk2trixi(joinpath("out", filename * ".vtu"))

@test saved_ic.coordinates == loaded_ic.coordinates
@test saved_ic.velocity == loaded_ic.velocity
@test saved_ic.density == loaded_ic.density
@test saved_ic.pressure == loaded_ic.pressure
@test saved_ic.mass == loaded_ic.mass

# 'Fluidsystem'-Files
state_equation = StateEquationCole(; sound_speed=1.0, reference_density=1.0,
exponent=1, clip_negative_pressure=false)
fluid_system = WeaklyCompressibleSPHSystem(saved_ic,
ContinuityDensity(), state_equation,
WendlandC2Kernel{2}(), 0.2)

trixi2vtk(saved_ic.velocity, saved_ic.coordinates, 0.0, fluid_system, nothing;)
# trixi2vtk(sol.u[end], semi, 0.0, iter=1, output_directory="output",
# prefix="solution")

end
end

0 comments on commit 4400cda

Please sign in to comment.