-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0f1ee79
commit ff5f16a
Showing
50 changed files
with
4,690 additions
and
3,668 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: format-check | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: '*' | ||
pull_request: | ||
|
||
jobs: | ||
check-format: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
julia-version: [1] | ||
julia-arch: [x86] | ||
os: [ubuntu-latest] | ||
steps: | ||
- uses: julia-actions/setup-julia@latest | ||
with: | ||
version: ${{ matrix.julia-version }} | ||
|
||
- uses: actions/checkout@v4 | ||
- name: Install JuliaFormatter and format | ||
run: | | ||
julia -e 'using Pkg; Pkg.add(PackageSpec(name = "JuliaFormatter", version="1.0.45"))' | ||
julia -e 'using JuliaFormatter; format(".")' | ||
- name: Format check | ||
run: | | ||
julia -e ' | ||
out = Cmd(`git diff --name-only`) |> read |> String | ||
if out == "" | ||
exit(0) | ||
else | ||
@error "Some files have not been formatted !!!" | ||
write(stdout, out) | ||
exit(1) | ||
end' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Use SciML style: https://github.com/SciML/SciMLStyle | ||
style = "sciml" | ||
|
||
# Python style alignment. See https://github.com/domluna/JuliaFormatter.jl/pull/732. | ||
yas_style_nesting = true | ||
|
||
# Align struct fields for better readability of large struct definitions | ||
align_struct_field = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,94 @@ | ||
module Analysis | ||
|
||
using LinearMaps: LinearMap, UniformScalingMap | ||
using LinearAlgebra: Diagonal, diag, diagm, mul!, lmul!, dot, norm, eigen, inv, svd, qr, pinv, eigsortby, I, rank, cond | ||
using JLD2: save, load, save_object, load_object | ||
using Plots: plot, savefig, plot!, scatter, text, annotate!, vline!, grid, theme_palette, twinx, @layout | ||
using LaTeXStrings: LaTeXString, latexstring | ||
using SparseArrays: sparse, blockdiag, kron! | ||
using OrdinaryDiffEq: OrdinaryDiffEqAlgorithm, ODESolution, ODEIntegrator, solve, RK4, step!, reinit! | ||
using StartUpDG: MeshData, vandermonde | ||
using RecipesBase | ||
using Printf | ||
using PrettyTables | ||
using Markdown | ||
using TimerOutputs | ||
using BenchmarkTools | ||
|
||
using ..ConservationLaws | ||
using ..SpatialDiscretizations | ||
using ..GridFunctions | ||
using ..Solvers | ||
using ..MatrixFreeOperators | ||
using ..File | ||
using ..Visualize | ||
|
||
export AbstractAnalysis, AbstractAnalysisResults, analyze, analyze_new, save_analysis, tabulate_analysis, tabulate_analysis_for_paper | ||
|
||
abstract type AbstractAnalysis end | ||
abstract type AbstractAnalysisResults end | ||
|
||
function save_analysis(analysis::AbstractAnalysis, | ||
results::AbstractAnalysisResults) | ||
save(string(analysis.analysis_path, "analysis.jld2"), | ||
Dict("analysis" => analysis, | ||
"results" => results)) | ||
end | ||
|
||
export ErrorAnalysis, AbstractNorm, QuadratureL2, QuadratureL2Normalized | ||
include("error.jl") | ||
|
||
export ConservationAnalysis, PrimaryConservationAnalysis, EnergyConservationAnalysis, EntropyConservationAnalysis, ConservationAnalysisResults, ConservationAnalysisResultsWithDerivative, evaluate_conservation, evaluate_conservation_residual | ||
include("conservation.jl") | ||
|
||
export RefinementAnalysis, RefinementErrorAnalysis, RefinementAnalysisResults, RefinementErrorAnalysisResults, run_refinement, get_tickslogscale | ||
include("refinement.jl") | ||
|
||
export scaling_test_euler_2d | ||
include("benchmark.jl") | ||
end | ||
using LinearMaps: LinearMap, UniformScalingMap | ||
using LinearAlgebra: | ||
Diagonal, | ||
diag, | ||
diagm, | ||
mul!, | ||
lmul!, | ||
dot, | ||
norm, | ||
eigen, | ||
inv, | ||
svd, | ||
qr, | ||
pinv, | ||
eigsortby, | ||
I, | ||
rank, | ||
cond | ||
using JLD2: save, load, save_object, load_object | ||
using Plots: | ||
plot, | ||
savefig, | ||
plot!, | ||
scatter, | ||
text, | ||
annotate!, | ||
vline!, | ||
grid, | ||
theme_palette, | ||
twinx, | ||
@layout | ||
using LaTeXStrings: LaTeXString, latexstring | ||
using SparseArrays: sparse, blockdiag, kron! | ||
using OrdinaryDiffEq: | ||
OrdinaryDiffEqAlgorithm, ODESolution, ODEIntegrator, solve, RK4, | ||
step!, reinit! | ||
using StartUpDG: MeshData, vandermonde | ||
using RecipesBase | ||
using Printf | ||
using PrettyTables | ||
using Markdown | ||
using TimerOutputs | ||
using BenchmarkTools | ||
|
||
using ..ConservationLaws | ||
using ..SpatialDiscretizations | ||
using ..GridFunctions | ||
using ..Solvers | ||
using ..MatrixFreeOperators | ||
using ..File | ||
using ..Visualize | ||
|
||
export AbstractAnalysis, | ||
AbstractAnalysisResults, | ||
analyze, | ||
analyze_new, | ||
save_analysis, | ||
tabulate_analysis, | ||
tabulate_analysis_for_paper | ||
|
||
abstract type AbstractAnalysis end | ||
abstract type AbstractAnalysisResults end | ||
|
||
function save_analysis(analysis::AbstractAnalysis, results::AbstractAnalysisResults) | ||
save(string(analysis.analysis_path, "analysis.jld2"), | ||
Dict("analysis" => analysis, "results" => results)) | ||
end | ||
|
||
export ErrorAnalysis, AbstractNorm, QuadratureL2, QuadratureL2Normalized | ||
include("error.jl") | ||
|
||
export ConservationAnalysis, | ||
PrimaryConservationAnalysis, | ||
EnergyConservationAnalysis, | ||
EntropyConservationAnalysis, | ||
ConservationAnalysisResults, | ||
ConservationAnalysisResultsWithDerivative, | ||
evaluate_conservation, | ||
evaluate_conservation_residual | ||
include("conservation.jl") | ||
|
||
export RefinementAnalysis, | ||
RefinementErrorAnalysis, | ||
RefinementAnalysisResults, | ||
RefinementErrorAnalysisResults, | ||
run_refinement, | ||
get_tickslogscale | ||
include("refinement.jl") | ||
|
||
export scaling_test_euler_2d | ||
include("benchmark.jl") | ||
end |
Oops, something went wrong.