Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Throw error in trixi_include when assignment is not found #1737

Merged
merged 21 commits into from
Nov 18, 2023
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions src/auxiliary/special_elixirs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -290,14 +290,25 @@ function extract_initial_resolution(elixir, kwargs)
return initial_refinement_level
end
catch e
# If `initial_refinement_level` is not found, we will get an `ArgumentError`
if isa(e, ArgumentError)
# get cells_per_dimension from the elixir
cells_per_dimension = eval(find_assignment(expr, :cells_per_dimension))

if haskey(kwargs, :cells_per_dimension)
return kwargs[:cells_per_dimension]
else
return cells_per_dimension
try
# get cells_per_dimension from the elixir
cells_per_dimension = eval(find_assignment(expr, :cells_per_dimension))

if haskey(kwargs, :cells_per_dimension)
return kwargs[:cells_per_dimension]
else
return cells_per_dimension
end
catch e2
# If `cells_per_dimension` is not found either
if isa(e2, ArgumentError)
throw(ArgumentError("`convergence_test` requires the elixir to define " *
"`initial_refinement_level` or `cells_per_dimension`"))
else
throw(e2)
efaulhaber marked this conversation as resolved.
Show resolved Hide resolved
end
end
else
throw(e)
efaulhaber marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
Loading