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

Implement EllipsisNotation where useful #189

Merged
merged 5 commits into from
Sep 21, 2020
Merged

Implement EllipsisNotation where useful #189

merged 5 commits into from
Sep 21, 2020

Conversation

efaulhaber
Copy link
Member

Resolve #179.

Steady-state integration residual should only be done for
HyperbolicDiffusionEquations2D and HyperbolicDiffusionEquations3D.
@codecov
Copy link

codecov bot commented Sep 19, 2020

Codecov Report

Merging #189 into master will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #189      +/-   ##
==========================================
+ Coverage   91.59%   91.60%   +0.01%     
==========================================
  Files          31       31              
  Lines        6993     6966      -27     
==========================================
- Hits         6405     6381      -24     
+ Misses        588      585       -3     
Impacted Files Coverage Δ
src/Trixi.jl 100.00% <ø> (ø)
src/io/io.jl 90.65% <100.00%> (+0.73%) ⬆️
src/run.jl 94.86% <100.00%> (-0.16%) ⬇️
src/timedisc/timedisc_euler_gravity.jl 90.65% <100.00%> (+0.30%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5a3aa26...1d4a5ae. Read the comment docs.

@efaulhaber
Copy link
Member Author

To make sure that these lines are only executed for HyperbolicDiffusionEquations I added a simple isa check, but I'm not sure if this is the most elegant solution.

# Check steady-state integration residual
if solver.equations isa HyperbolicDiffusionEquations2D ||
  solver.equations isa HyperbolicDiffusionEquations3D
  if maximum(abs, view(solver.elements.u_t, 1, ..)) <= solver.equations.resid_tol
    println()
    println("-"^80)
    println("  Steady state tolerance of ",solver.equations.resid_tol," reached at time ",time)
    println("-"^80)
    println()
    finalstep = true
  end
end

@sloede
Copy link
Member

sloede commented Sep 19, 2020

It is not, but it's what was there before. You could do a single check for the abstract type, though:

abstract type AbstractHyperbolicDiffusionEquations{NDIMS, NVARS} <: AbstractEquation{NDIMS, NVARS} end

@efaulhaber
Copy link
Member Author

Ah okay, I didn't see the abstract type before.

src/io/io.jl Outdated Show resolved Hide resolved
src/run.jl Outdated Show resolved Hide resolved
src/io/io.jl Outdated Show resolved Hide resolved
@efaulhaber
Copy link
Member Author

efaulhaber commented Sep 21, 2020

@sloede Is this as you intended?

Edit: Didn't see your approval.

@sloede sloede merged commit 1730b04 into trixi-framework:master Sep 21, 2020
@efaulhaber efaulhaber deleted the ellipsis-notation branch December 21, 2020 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Evaluate and implement EllipsisNotation.jl for dimension-agnostic code
2 participants