/WaveSim.jl

Example code and helpful functionality for the BYU Scientific Computing Course's semester long project

Primary LanguageJuliaCreative Commons Zero v1.0 UniversalCC0-1.0

WaveSim.jl

WaveSim.jl is a package that's meant to make life easier for students of BYU's Scientific Computing Course. It serves to make debugging some phases of the project easier, and is used as example and base code for others.

Install

Open the Julia package manager and run:

pkg> add https://github.com/BYUHPC/WaveSim.jl.git

WaveSim.jl can be removed with:

pkg> remove WaveSim

Usage Example

The WaveSim package can be used to interactively check your assignment output files--for example, given an input file in.wo, you can see if your C++ code compiled to wavesim_serial is correct, and figure out what's wrong if not:

shell> ./wavesim_serial in.wo out.wo

julia> using WaveSim

julia> wgood = WaveOrthotope(open("in.wo"));

julia> solve!(wgood)

julia> wtest = WaveOrthotope(open("out.wo"));

julia> if !isapprox(wgood, wtest)
           println("out.wo is incorrect")
           println("Damping coefficients: $(dampingcoef(wgood)), $(dampingcoef(wtest))")
           println("Simulation times:     $(simtime(wgood)), $(simtime(wtest))")
           println("Max u difference:     $(max(abs.(wgood.u - wtest.u))...)")
           println("Max v difference:     $(max(abs.(wgood.v - wtest.v))...)")
       end

Easy wavefiles.tar.gz Access

wavefiles.tar.gz is provided as a lazily loaded artifact. You can use the provided wavefiles function to access files therein:

small2din = WaveOrthotope(wavefiles(2, :small, :in)) # small-2d-in.wo
tiny3dout = WaveOrthotope(wavefiles("3d-tiny-out.wo"))
wavediffbinary = wavefiles("wavediff")