Skip to content

Commit

Permalink
Make backwards compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskawczynski committed Jan 13, 2025
1 parent d687a72 commit 5ae4fd7
Showing 1 changed file with 27 additions and 13 deletions.
40 changes: 27 additions & 13 deletions src/InputOutput/readers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -250,21 +250,35 @@ function read_mesh_new(reader::HDF5Reader, name::AbstractString)
if type == "IntervalMesh"
domain = read_domain(reader, attrs(group)["domain"])
nelements = attrs(group)["nelements"]
stretch_type = attrs(group)["stretch_type"]
if stretch_type == "Uniform"
return Meshes.IntervalMesh(
domain,
Meshes.Uniform();
nelems = nelements,
)
if haskey(attrs(group), "faces_type")
faces_type = attrs(group)["faces_type"]
if faces_type == "Range"
return Meshes.IntervalMesh(
domain,
Meshes.Uniform(),
nelems = nelements,
)
else
CT = Domains.coordinate_type(domain)
faces = [CT(coords) for coords in attrs(group)["faces"]]
return Meshes.IntervalMesh(domain, faces)
end
else
stretch_type = attrs(group)["stretch_type"]
stretch_params = attrs(group)["stretch_params"]
CT = Domains.coordinate_type(domain)
stretch =
getproperty(Meshes, Symbol(stretch_type))(stretch_params...)
mesh = Meshes.IntervalMesh(domain, stretch; nelems = nelements)
return mesh
if stretch_type == "Uniform"
return Meshes.IntervalMesh(
domain,
Meshes.Uniform();
nelems = nelements,
)
else
stretch_type = attrs(group)["stretch_type"]
stretch_params = attrs(group)["stretch_params"]
CT = Domains.coordinate_type(domain)
stretch =
getproperty(Meshes, Symbol(stretch_type))(stretch_params...)
return Meshes.IntervalMesh(domain, stretch; nelems = nelements)
end
end
elseif type == "RectilinearMesh"
intervalmesh1 = read_mesh(reader, attrs(group)["intervalmesh1"])
Expand Down

0 comments on commit 5ae4fd7

Please sign in to comment.