From 0ce7d77bcdf546acb26d246df21cff6c74a8beb8 Mon Sep 17 00:00:00 2001 From: benedict-96 Date: Sat, 16 Mar 2024 14:05:37 +0100 Subject: [PATCH 01/15] Added option to generate the docs with mac (if we don't have pdftocairo). --- docs/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/docs/Makefile b/docs/Makefile index 6e5a9df..b7556ca 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -3,6 +3,8 @@ all: images install_gml precompile documenter remove_gml +mac: images_mac install_gml precompile documenter remove_gml + precompile: cd .. ; julia --project=docs -e '; \ using Pkg; \ @@ -40,6 +42,11 @@ images: $(MAKE) all -C src/images $(MAKE) clean -C src/images +images_mac: + $(MAKE) pdf -C src/images + $(MAKE) convert_with_sips -C src/images + $(MAKE) clean -C src/images + clean: $(MAKE) empty -C src/images rm -Rf build From 7a3339edd0b81a5528a2e81aedd1bb725a491af6 Mon Sep 17 00:00:00 2001 From: benedict-96 Date: Sat, 16 Mar 2024 14:06:05 +0100 Subject: [PATCH 02/15] Added PyPlot for the rigid body plot. --- docs/Project.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/Project.toml b/docs/Project.toml index 5a7ba84..ddfbbcb 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -6,3 +6,4 @@ GeometricIntegrators = "dcce2d33-59f6-5b8d-9047-0defad88ae06" GeometricProblems = "18cb22b4-ad41-5c80-9c5f-710df63fbdc9" GeometricSolutions = "7843afe4-64f4-4df4-9231-049495c56661" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" +PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee" From 8f6623ca997186a3f6eb57743f207a29e4fa1dab Mon Sep 17 00:00:00 2001 From: benedict-96 Date: Sat, 16 Mar 2024 14:06:48 +0100 Subject: [PATCH 03/15] Added rigid body. --- docs/make.jl | 1 + docs/src/index.md | 1 + docs/src/rigid_body.md | 41 ++++++++++++++++++++++++++++++++ src/GeometricProblems.jl | 1 + src/rigid_body.jl | 51 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 95 insertions(+) create mode 100644 docs/src/rigid_body.md create mode 100644 src/rigid_body.jl diff --git a/docs/make.jl b/docs/make.jl index 7d7be9f..64a0631 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -34,6 +34,7 @@ makedocs(; "Point Vortices" => "point_vortices.md", "Inner Solar System" => "inner_solar_system.md", "Outer Solar System" => "outer_solar_system.md", + "Rigid body" => "rigid_body.md", "Toda Lattice" => "toda_lattice.md", ] ) diff --git a/docs/src/index.md b/docs/src/index.md index 1cba9e8..13c3c68 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -38,6 +38,7 @@ Pages = [ "point_vortices.md", "inner_solar_system.md", "outer_solar_system.md", +"rigid_body.md", "toda_lattice.md" ] Depth = 1 diff --git a/docs/src/rigid_body.md b/docs/src/rigid_body.md new file mode 100644 index 0000000..e6a2f09 --- /dev/null +++ b/docs/src/rigid_body.md @@ -0,0 +1,41 @@ +# The rigid body + +```@example +using GeometricProblems.RigidBody: odeproblem +using GeometricIntegrators: integrate, ImplicitMidpoint +using Plots; pyplot() + +sol = integrate(odeproblem(), ImplicitMidpoint()) + +function sphere(r, C) # r: radius; C: center [cx,cy,cz] + n = 100 + u = range(-π, π; length = n) + v = range(0, π; length = n) + x = C[1] .+ r*cos.(u) * sin.(v)' + y = C[2] .+ r*sin.(u) * sin.(v)' + z = C[3] .+ r*ones(n) * cos.(v)' + return x, y, z + end + +surface(sphere(1., [0., 0., 0.]), alpha = .2, legend = false) + +plot!(sol.q[:, 1], sol.q[:, 2], sol.q[:, 3], color = 1, label = "trajectory") +``` + + +## Library functions + +```@docs +GeometricProblems.RigidBody +``` + +```@autodocs +Modules = [GeometricProblems.RigidBody] +Order = [:constant, :type, :macro, :function] +``` + +```@bibliography +Pages = [] + +bajars2023locally +``` \ No newline at end of file diff --git a/src/GeometricProblems.jl b/src/GeometricProblems.jl index 857e7a9..2755909 100644 --- a/src/GeometricProblems.jl +++ b/src/GeometricProblems.jl @@ -31,6 +31,7 @@ module GeometricProblems include("pendulum.jl") include("point_vortices.jl") include("point_vortices_linear.jl") + include("rigid_body.jl") include("toda_lattice.jl") end diff --git a/src/rigid_body.jl b/src/rigid_body.jl new file mode 100644 index 0000000..5a61d52 --- /dev/null +++ b/src/rigid_body.jl @@ -0,0 +1,51 @@ +@doc raw""" +# Rigid body + +```math +\begin{aligned} + \dot{x} = Ayz \\ + \dot{y} = Bxz \\ + \dot{z} = Cxy +\end{aligned}, +``` + +where ``A = (I_2 - I_3)/(I_2I_3)``, ``B = (I_3 - I_1)/(I_3I_1)`` and ``C = (I_1 - I_2)/(I_1I_2)``; ``I_{\cdot}`` are the *principal components of inertia*. + +The initial condition and the default parameters are taken from [bajars2023locally](@cite). +""" +module RigidBody + + using GeometricEquations + using GeometricSolutions + using Parameters + + export odeproblem, q₀, default_parameters, tspan, tstep + + const tspan = (0.0, 100.0) + const tstep = 0.1 + + const default_parameters = ( + I₁ = 2., + I₂ = 1., + I₃ = 2. / 3. + ) + + const q₀ = (q = [cos(1.1), 0., sin(1.1)], ) + + function rigid_body_v(v, t, q, params) + @unpack I₁, I₂, I₃ = params + A = (I₂ - I₃) / (I₂ * I₃) + B = (I₃ - I₁) / (I₃ * I₁) + C = (I₁ - I₂) / (I₁ * I₂) + v[1] = A * q[2] * q[3] + v[2] = B * q[1] * q[3] + v[3] = C * q[1] * q[2] + + nothing + end + + function odeproblem(q₀ = q₀; tspan = tspan, tstep = tstep, parameters = default_parameters) + ODEProblem(rigid_body_v, tspan, tstep, q₀; parameters = parameters) + end + +end \ No newline at end of file From 10a9a1a2d1bc4f7e5f2ac21780f982b004d97847 Mon Sep 17 00:00:00 2001 From: benedict-96 Date: Sat, 16 Mar 2024 14:07:23 +0100 Subject: [PATCH 04/15] Added reference for rigid body (mainly initial conditions. --- docs/src/GeometricProblems.bib | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/src/GeometricProblems.bib b/docs/src/GeometricProblems.bib index fc62451..2cfd153 100644 --- a/docs/src/GeometricProblems.bib +++ b/docs/src/GeometricProblems.bib @@ -25,4 +25,14 @@ @book{hairer2006geometric year={2006}, publisher={Springer}, address={Berlin} -} \ No newline at end of file +} + +@article{bajars2023locally, + title={Locally-symplectic neural networks for learning volume-preserving dynamics}, + author={Baj{\=a}rs, J{\=a}nis}, + journal={Journal of Computational Physics}, + volume={476}, + pages={111911}, + year={2023}, + publisher={Elsevier} +} From 26930e7e4c868d2c55184c7105964d760168cb60 Mon Sep 17 00:00:00 2001 From: benedict-96 Date: Sat, 16 Mar 2024 14:08:01 +0100 Subject: [PATCH 05/15] Added option to convert to png using sips. --- docs/src/images/Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs/src/images/Makefile b/docs/src/images/Makefile index ecd0033..f4b005e 100644 --- a/docs/src/images/Makefile +++ b/docs/src/images/Makefile @@ -10,6 +10,18 @@ png: pdftocairo -png -r 250 -transp -singlefile coupled_harmonic_oscillator.pdf coupled_harmonic_oscillator pdftocairo -png -r 250 -transp -singlefile coupled_harmonic_oscillator_dark.pdf coupled_harmonic_oscillator_dark +MYDIR := . +convert_with_sips: $(MYDIR)/*.pdf + for file in $^ ; do \ + sips --setProperty format png --resampleHeightWidthMax 600 $${file} --out $${file%.*}.png ; \ + done + +# this is converting pdfs to pngs using pdftocairo (linux version) +convert_with_pdftocairo: $(MYDIR)/*.pdf + for file in $^ ; do \ + pdftocairo -png -r 250 -transp -singlefile $${file} $${file%.*} ; \ + done + clean: rm -f *.aux rm -f *.fdb_latexmk From 84ea45445baf996eedf426133bd77f4e0188dc27 Mon Sep 17 00:00:00 2001 From: benedict-96 Date: Sat, 16 Mar 2024 17:30:08 +0100 Subject: [PATCH 06/15] Added more trajectories for visualization. --- docs/src/rigid_body.md | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/docs/src/rigid_body.md b/docs/src/rigid_body.md index e6a2f09..3520e4a 100644 --- a/docs/src/rigid_body.md +++ b/docs/src/rigid_body.md @@ -1,11 +1,27 @@ # The rigid body ```@example -using GeometricProblems.RigidBody: odeproblem +using GeometricProblems.RigidBody: odeproblem, tspan, tstep, default_parameters using GeometricIntegrators: integrate, ImplicitMidpoint +using GeometricEquations: EnsembleProblem +using GeometricSolutions: GeometricSolution using Plots; pyplot() -sol = integrate(odeproblem(), ImplicitMidpoint()) +ics = [ + (q = [sin(1.1), 0., cos(1.1)], ), + (q = [sin(2.1), 0., cos(2.1)], ), + (q = [sin(2.2), 0., cos(2.2)], ), + (q = [0., sin(1.1), cos(1.1)], ), + (q = [0., sin(1.5), cos(1.5)], ), + (q = [0., sin(1.6), cos(1.6)], ) +] + +ensemble_problem = EnsembleProblem(odeproblem().equation, tspan, tstep, ics, default_parameters) +ensemble_solution = integrate(ensemble_problem, ImplicitMidpoint()) + +function plot_geometric_solution!(p::Plots.Plot, solution::GeometricSolution; kwargs...) + plot!(p, solution.q[:, 1], solution.q[:, 2], solution.q[:, 3]; kwargs...) +end function sphere(r, C) # r: radius; C: center [cx,cy,cz] n = 100 @@ -17,9 +33,13 @@ function sphere(r, C) # r: radius; C: center [cx,cy,cz] return x, y, z end -surface(sphere(1., [0., 0., 0.]), alpha = .2, legend = false) +p = surface(sphere(1., [0., 0., 0.]), alpha = .2, colorbar = false) + +for (i, solution) in zip(1:length(ensemble_solution), ensemble_solution) + plot_geometric_solution!(p, solution; color = i, label = "trajectory "*string(i)) +end -plot!(sol.q[:, 1], sol.q[:, 2], sol.q[:, 3], color = 1, label = "trajectory") +p ``` From 379dbffac2d4adfc54ddfc5e35f2cf3e3dd90f32 Mon Sep 17 00:00:00 2001 From: benedict-96 Date: Sat, 16 Mar 2024 17:30:24 +0100 Subject: [PATCH 07/15] Gave individual steps in workflow a name. --- .github/workflows/Documenter.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml index 673ba1c..2f7fa24 100644 --- a/.github/workflows/Documenter.yml +++ b/.github/workflows/Documenter.yml @@ -15,12 +15,13 @@ jobs: steps: - uses: actions/checkout@v3 - uses: julia-actions/setup-julia@latest - - name: Configure doc environment + - name: Install GML and precompile run: | - cd docs make install_gml make precompile - cd .. + working-directory: docs + - name: Install poppler-utils and texlive + run: | sudo apt-get install imagemagick sudo apt-get install poppler-utils sudo apt-get install texlive-xetex From 4373421a98f8be11be95571c5a3505c22305305d Mon Sep 17 00:00:00 2001 From: benedict-96 Date: Fri, 22 Mar 2024 14:05:45 +0100 Subject: [PATCH 08/15] Replaced Pyplot with Makie. --- docs/Project.toml | 2 +- docs/src/rigid_body.md | 40 ++++++++++++++++++++-------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/Project.toml b/docs/Project.toml index ddfbbcb..c34e1a0 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,9 +1,9 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244" +GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a" GeometricEquations = "c85262ba-a08a-430a-b926-d29770767bf2" GeometricIntegrators = "dcce2d33-59f6-5b8d-9047-0defad88ae06" GeometricProblems = "18cb22b4-ad41-5c80-9c5f-710df63fbdc9" GeometricSolutions = "7843afe4-64f4-4df4-9231-049495c56661" Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" -PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee" diff --git a/docs/src/rigid_body.md b/docs/src/rigid_body.md index 3520e4a..02da4a2 100644 --- a/docs/src/rigid_body.md +++ b/docs/src/rigid_body.md @@ -1,45 +1,45 @@ # The rigid body ```@example -using GeometricProblems.RigidBody: odeproblem, tspan, tstep, default_parameters +using GeometricProblems.RigidBody: odeensemble using GeometricIntegrators: integrate, ImplicitMidpoint using GeometricEquations: EnsembleProblem using GeometricSolutions: GeometricSolution -using Plots; pyplot() +using GLMakie ics = [ - (q = [sin(1.1), 0., cos(1.1)], ), - (q = [sin(2.1), 0., cos(2.1)], ), - (q = [sin(2.2), 0., cos(2.2)], ), - (q = [0., sin(1.1), cos(1.1)], ), - (q = [0., sin(1.5), cos(1.5)], ), - (q = [0., sin(1.6), cos(1.6)], ) -] - -ensemble_problem = EnsembleProblem(odeproblem().equation, tspan, tstep, ics, default_parameters) + [sin(1.1), 0., cos(1.1)], + [sin(2.1), 0., cos(2.1)], + [sin(2.2), 0., cos(2.2)], + [0., sin(1.1), cos(1.1)], + [0., sin(1.5), cos(1.5)], + [0., sin(1.6), cos(1.6)] + ] + +ensemble_problem = odeensemble(ics) ensemble_solution = integrate(ensemble_problem, ImplicitMidpoint()) -function plot_geometric_solution!(p::Plots.Plot, solution::GeometricSolution; kwargs...) - plot!(p, solution.q[:, 1], solution.q[:, 2], solution.q[:, 3]; kwargs...) +function plot_geometric_solution!(p, solution::GeometricSolution; kwargs...) + lines!(p, solution.q[:, 1].parent, solution.q[:, 2].parent, solution.q[:, 3].parent; kwargs...) end function sphere(r, C) # r: radius; C: center [cx,cy,cz] n = 100 u = range(-π, π; length = n) v = range(0, π; length = n) - x = C[1] .+ r*cos.(u) * sin.(v)' - y = C[2] .+ r*sin.(u) * sin.(v)' - z = C[3] .+ r*ones(n) * cos.(v)' + x = C[1] .+ r * cos.(u) * sin.(v)' + y = C[2] .+ r * sin.(u) * sin.(v)' + z = C[3] .+ r * ones(n) * cos.(v)' return x, y, z end -p = surface(sphere(1., [0., 0., 0.]), alpha = .2, colorbar = false) +fig, ax, plt = surface(sphere(1., [0., 0., 0.])..., alpha = .6) -for (i, solution) in zip(1:length(ensemble_solution), ensemble_solution) - plot_geometric_solution!(p, solution; color = i, label = "trajectory "*string(i)) +for (i, solution) in zip(1:length(ensemble_solution), ensemble_solution.s) + plot_geometric_solution!(ax, solution; label = "trajectory "*string(i), linewidth=2) end -p +ax ``` From 66b3b2127ad9b5f9c59b9053507266126ccb04b5 Mon Sep 17 00:00:00 2001 From: benedict-96 Date: Fri, 22 Mar 2024 14:08:10 +0100 Subject: [PATCH 09/15] Fixed naming. --- .github/workflows/Documenter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml index f2e535f..423b7e3 100644 --- a/.github/workflows/Documenter.yml +++ b/.github/workflows/Documenter.yml @@ -15,7 +15,7 @@ jobs: steps: - uses: actions/checkout@v3 - uses: julia-actions/setup-julia@latest - - name: Install GML and precompile + - name: Install imagemagick, poppler-utils and texlive run: | sudo apt-get install imagemagick sudo apt-get install poppler-utils From 47a5f35f2d99cefe42978292e3a08f09b70bd1a8 Mon Sep 17 00:00:00 2001 From: benedict-96 Date: Fri, 22 Mar 2024 14:56:55 +0100 Subject: [PATCH 10/15] Exporting odeensemble. --- src/rigid_body.jl | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/rigid_body.jl b/src/rigid_body.jl index 5a61d52..2425287 100644 --- a/src/rigid_body.jl +++ b/src/rigid_body.jl @@ -19,7 +19,7 @@ module RigidBody using GeometricSolutions using Parameters - export odeproblem, q₀, default_parameters, tspan, tstep + export odeproblem, odeensemble const tspan = (0.0, 100.0) const tstep = 0.1 @@ -30,7 +30,9 @@ module RigidBody I₃ = 2. / 3. ) - const q₀ = (q = [cos(1.1), 0., sin(1.1)], ) + const q₀ = [cos(1.1), 0., sin(1.1)] + const q₁ = [cos(2.1), 0., sin(2.1)] + const q₂ = [cos(2.2), 0., sin(2.2)] function rigid_body_v(v, t, q, params) @unpack I₁, I₂, I₃ = params @@ -48,4 +50,8 @@ module RigidBody ODEProblem(rigid_body_v, tspan, tstep, q₀; parameters = parameters) end + function odeensemble(samples = [q₀, q₁, q₂]; parameters = default_parameters, tspan = tspan, tstep = tstep) + ODEEnsemble(rigid_body_v, tspan, tstep, samples; parameters = parameters) + end + end \ No newline at end of file From 594fa2a037fd7d7d75c4ef293d86824aff198409 Mon Sep 17 00:00:00 2001 From: benedict-96 Date: Fri, 22 Mar 2024 16:19:45 +0100 Subject: [PATCH 11/15] Installing packages needed for Makie. Taken from https://github.com/MakieOrg/Makie.jl/blob/3e4ae3227f3eb4bb507627cd8e41a0850a515f44/.github/workflows/glmakie.yaml . --- .github/workflows/Documenter.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml index 423b7e3..0a48c60 100644 --- a/.github/workflows/Documenter.yml +++ b/.github/workflows/Documenter.yml @@ -15,11 +15,12 @@ jobs: steps: - uses: actions/checkout@v3 - uses: julia-actions/setup-julia@latest - - name: Install imagemagick, poppler-utils and texlive + - name: Install imagemagick, poppler-utils and packages needed for Makie run: | sudo apt-get install imagemagick sudo apt-get install poppler-utils sudo apt-get install texlive-xetex + sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev - name: Generate Images run: | make all -C src/images From 945101ecbc60956bfd203c35c53a479c685d72a2 Mon Sep 17 00:00:00 2001 From: benedict-96 Date: Fri, 22 Mar 2024 16:38:45 +0100 Subject: [PATCH 12/15] Now using CairoMakie instead of GLMakie. --- .github/workflows/Documenter.yml | 3 +-- docs/Project.toml | 2 +- docs/src/rigid_body.md | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml index 0a48c60..423b7e3 100644 --- a/.github/workflows/Documenter.yml +++ b/.github/workflows/Documenter.yml @@ -15,12 +15,11 @@ jobs: steps: - uses: actions/checkout@v3 - uses: julia-actions/setup-julia@latest - - name: Install imagemagick, poppler-utils and packages needed for Makie + - name: Install imagemagick, poppler-utils and texlive run: | sudo apt-get install imagemagick sudo apt-get install poppler-utils sudo apt-get install texlive-xetex - sudo apt-get install -y xorg-dev mesa-utils xvfb libgl1 freeglut3-dev libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev - name: Generate Images run: | make all -C src/images diff --git a/docs/Project.toml b/docs/Project.toml index c34e1a0..1fc109b 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,7 +1,7 @@ [deps] +CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" DocumenterCitations = "daee34ce-89f3-4625-b898-19384cb65244" -GLMakie = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a" GeometricEquations = "c85262ba-a08a-430a-b926-d29770767bf2" GeometricIntegrators = "dcce2d33-59f6-5b8d-9047-0defad88ae06" GeometricProblems = "18cb22b4-ad41-5c80-9c5f-710df63fbdc9" diff --git a/docs/src/rigid_body.md b/docs/src/rigid_body.md index 02da4a2..f040539 100644 --- a/docs/src/rigid_body.md +++ b/docs/src/rigid_body.md @@ -5,7 +5,7 @@ using GeometricProblems.RigidBody: odeensemble using GeometricIntegrators: integrate, ImplicitMidpoint using GeometricEquations: EnsembleProblem using GeometricSolutions: GeometricSolution -using GLMakie +using CairoMakie ics = [ [sin(1.1), 0., cos(1.1)], @@ -39,7 +39,7 @@ for (i, solution) in zip(1:length(ensemble_solution), ensemble_solution.s) plot_geometric_solution!(ax, solution; label = "trajectory "*string(i), linewidth=2) end -ax +fig ``` From 1d93b74750264ec47ec37c24b4267ac7a395164e Mon Sep 17 00:00:00 2001 From: benedict-96 Date: Tue, 9 Apr 2024 09:47:52 +0200 Subject: [PATCH 13/15] Got rid of special image generation for mac. --- docs/Makefile | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/Makefile b/docs/Makefile index 23bd39b..7efb7dd 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -20,12 +20,7 @@ documenter: images: $(MAKE) all -C src/images $(MAKE) clean -C src/images - -images_mac: - $(MAKE) pdf -C src/images - $(MAKE) convert_with_sips -C src/images - $(MAKE) clean -C src/images - + clean: $(MAKE) empty -C src/images rm -Rf build From e37054ac52be66fd5df7aea9f3f6b30609f82403 Mon Sep 17 00:00:00 2001 From: benedict-96 Date: Tue, 9 Apr 2024 09:48:58 +0200 Subject: [PATCH 14/15] Added test for rigid body. --- test/rigid_body_test.jl | 5 +++++ test/runtests.jl | 1 + 2 files changed, 6 insertions(+) create mode 100644 test/rigid_body_test.jl diff --git a/test/rigid_body_test.jl b/test/rigid_body_test.jl new file mode 100644 index 0000000..ffad3d3 --- /dev/null +++ b/test/rigid_body_test.jl @@ -0,0 +1,5 @@ +using GeometricProblem: RigidBody +using Test + +@test_nowarn odeproblem() +@test_nowarn odeensemble() \ No newline at end of file diff --git a/test/runtests.jl b/test/runtests.jl index 6a56200..ed4d979 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -14,3 +14,4 @@ using SafeTestsets @safetestset "Lotka-Volterra 4D (Lagrangian) " begin include("lotka_volterra_4d_lagrangian_tests.jl") end @safetestset "Point Vortices " begin include("point_vortices_tests.jl") end @safetestset "Point Vortices (linear) " begin include("point_vortices_linear_tests.jl") end +@safetestset "Rigid Body " begin include("rigid_body_test.jl") end From 94086085cbc40ba964c05d349ed91bcd92cd25f9 Mon Sep 17 00:00:00 2001 From: benedict-96 Date: Tue, 9 Apr 2024 10:05:51 +0200 Subject: [PATCH 15/15] Fixed typo. --- test/rigid_body_test.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/rigid_body_test.jl b/test/rigid_body_test.jl index ffad3d3..daae6aa 100644 --- a/test/rigid_body_test.jl +++ b/test/rigid_body_test.jl @@ -1,4 +1,4 @@ -using GeometricProblem: RigidBody +using GeometricProblems.RigidBody using Test @test_nowarn odeproblem()