diff --git a/.gitignore b/.gitignore index 18845a5f..ca0c8d93 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,9 @@ *.outs *.log *.dat +*.tree +*.info +*.vtu *.eps *.png *.avi diff --git a/Manifest.toml b/Manifest.toml index 60e01a81..7e068dcc 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -39,9 +39,10 @@ deps = ["Markdown"] uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240" [[JLLWrappers]] -git-tree-sha1 = "a431f5f2ca3f4feef3bd7a5e94b8b8d4f2f647a0" +deps = ["Preferences"] +git-tree-sha1 = "642a199af8b68253517b80bd3bfd17eb4e84df6e" uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210" -version = "1.2.0" +version = "1.3.0" [[LibCURL]] deps = ["LibCURL_jll", "MozillaCACerts_jll"] @@ -99,6 +100,12 @@ uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908" deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"] uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" +[[Preferences]] +deps = ["TOML"] +git-tree-sha1 = "ea79e4c9077208cd3bc5d29631a26bc0cff78902" +uuid = "21216c6a-2e73-6563-6e65-726566657250" +version = "1.2.1" + [[Printf]] deps = ["Unicode"] uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7" @@ -151,9 +158,9 @@ uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5" [[WriteVTK]] deps = ["Base64", "CodecZlib", "FillArrays", "LightXML", "Random", "TranscodingStreams"] -git-tree-sha1 = "37eef911a9c5211e0ae4362dc0477cfe6c537ffa" +git-tree-sha1 = "2d559f58ff021c0f0f3d2394d2688a84a84257aa" uuid = "64499a7a-5c06-52f2-abe2-ccb03c286192" -version = "1.9.1" +version = "1.9.2" [[XML2_jll]] deps = ["Artifacts", "JLLWrappers", "Libdl", "Libiconv_jll", "Pkg", "Zlib_jll"] diff --git a/Project.toml b/Project.toml index 8f576e0f..00e80c79 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Batsrus" uuid = "e74ebddf-6ac1-4047-a0e5-c32c99e57753" authors = ["Hongyang Zhou "] -version = "0.2.6" +version = "0.2.7" [deps] FortranFiles = "c58ffaec-ab22-586d-bfc5-781a99fd0b10" diff --git a/src/io.jl b/src/io.jl index 837fe945..a1dd96b1 100644 --- a/src/io.jl +++ b/src/io.jl @@ -8,10 +8,16 @@ searchdir(path,key) = filter(x->occursin(key,x), readdir(path)) function Base.show(io::IO, s::Data) showhead(s) - println(io, "filesize = ", s.list.bytes, " bytes") - println(io, "snapshots = ", s.list.npictinfiles) - println(io, "x = ", s.x) - println(io, "w = ", s.w) + if s.list.bytes ≥ 1e9 + @info "filesize = $(s.list.bytes/1e9) GB" + elseif s.list.bytes ≥ 1e6 + @info "filesize = $(s.list.bytes/1e6) MB" + elseif s.list.bytes ≥ 1e3 + @info "filesize = $(s.list.bytes/1e3) KB" + else + @info "filesize = $(s.list.bytes) bytes" + end + @info "snapshots = $(s.list.npictinfiles)" end """ @@ -335,9 +341,9 @@ function getfilehead(fileID::IOStream, type::String) eqpar = parse.(Float64, split(readline(fileID))) end varname = readline(fileID) - elseif ftype ∈ ["real4","binary"] + elseif ftype ∈ ["real4", "binary"] skip(fileID, tag) # skip record start tag. - headline = String(read(fileID, lenstr)) + headline = rstrip(String(read(fileID, lenstr))) skip(fileID, 2*tag) # skip record end/start tags. it = read(fileID, Int32) t = read(fileID, Float32)