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

Documentation Overhaul #231

Merged
merged 43 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
9ed9bd5
Starting to fix docs
GeorgeR227 May 20, 2024
cc10512
Added back Cahn-Hilliard
GeorgeR227 May 20, 2024
0217e68
Use pagesonly kw instead
GeorgeR227 May 21, 2024
4d0dc44
Fixed navier-stokes nesting
GeorgeR227 May 21, 2024
5b780e0
Fixed navier_stokes file
GeorgeR227 May 21, 2024
a58145f
Edit Klausmeier
GeorgeR227 May 21, 2024
ab840db
Added DocInfo helper file
GeorgeR227 May 22, 2024
d38d117
Up Resolution of example Cahn-Hilliard
GeorgeR227 May 22, 2024
e0fcac4
Updated overview.md
GeorgeR227 May 24, 2024
5942d2a
Updated more docs
GeorgeR227 May 28, 2024
0e2bb55
Updated CISM
GeorgeR227 May 28, 2024
fb3cf7f
Updated ice_dynamics
GeorgeR227 May 28, 2024
85c70f1
General updates
GeorgeR227 May 29, 2024
f9d60dd
Move NHS into it's own folder
GeorgeR227 May 31, 2024
5c825b9
Fix NHS link
GeorgeR227 May 31, 2024
918641c
Added back Poiseuille
GeorgeR227 May 31, 2024
7a9846b
Added NHS special doc
GeorgeR227 May 31, 2024
45ebce6
Some fixes
GeorgeR227 May 31, 2024
3ce776f
More descriptive name
GeorgeR227 May 31, 2024
e06c393
Grigoriev fixes
GeorgeR227 May 31, 2024
35cc1ee
Added back operadic
GeorgeR227 May 31, 2024
dc4f696
Updates to Halmo
GeorgeR227 May 31, 2024
0709f9c
Other fixes.
GeorgeR227 May 31, 2024
02ad47f
Disable Halmo
GeorgeR227 Jun 1, 2024
49357f9
Fixed docs hanging
GeorgeR227 Jun 3, 2024
358828f
Few last fixes.
GeorgeR227 Jun 3, 2024
c6cfaf0
Separate all sims into folders
GeorgeR227 Jun 3, 2024
10ca1cb
Remove Halmo again
GeorgeR227 Jun 3, 2024
62e4916
Third time's the charm?
GeorgeR227 Jun 3, 2024
195e067
Fourth time?
GeorgeR227 Jun 3, 2024
b109fdb
Fifth time?
GeorgeR227 Jun 3, 2024
dee0043
Use draw_composition from DiagX in docs
lukem12345 Jun 4, 2024
ba54ba7
Clean up header
GeorgeR227 Jun 4, 2024
8d002ee
Sixth time?
Jun 4, 2024
409cf80
Fix BSH xlabel
GeorgeR227 Jun 5, 2024
e31ac51
Change halmo to remove hanging
GeorgeR227 Jun 5, 2024
23f37c0
Added link checking
GeorgeR227 Jun 5, 2024
7386e86
Fix Poiseuille link
lukem12345 Jun 6, 2024
da37889
Clarify Hal-Mo initial conditions
lukem12345 Jun 6, 2024
6bd1d2f
Remove vorticity gif causing FFMPEG issues
lukem12345 Jun 6, 2024
b211418
Fix typos in Poiseuille docs page
lukem12345 Jun 6, 2024
6cbc666
Final fixes
GeorgeR227 Jun 6, 2024
cd6e4c6
Unify mesh names
GeorgeR227 Jun 6, 2024
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
.vscode
.buildkite/toolbox/config.json
.buildkite/toolbox/username
docs/Manifest.toml
5 changes: 1 addition & 4 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[deps]
AlgebraicPetri = "4f99eebe-17bf-4e98-b6a1-2c4f205a959b"
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0"
Catlab = "134e5e36-593f-5add-ad60-77f754baafbe"
Expand All @@ -10,16 +9,14 @@ DiagrammaticEquations = "6f00c28b-6bed-4403-80fa-30e0dc12f317"
Distributed = "8ba89e20-285c-5b6f-9357-94700520ee1b"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
DynamicalSystems = "61744808-ddfa-5f27-97ff-6e42cc95d634"
FileIO = "5789e2e9-d7fb-5bc7-8068-2c6fae9b9549"
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
Interpolations = "a98d9a8b-a2ab-59e6-89dd-64a1c18fca59"
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
MLStyle = "d8e11817-5142-5d16-987a-aa16d5891078"
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
PrettyTables = "08abe8d2-0d0c-5749-adfa-8a2ac140af0d"
ProgressMeter = "92933f4c-e287-5a05-a399-4b506db050ca"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
28 changes: 28 additions & 0 deletions docs/docinfo.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
module DocInfo

using Dates

mutable struct Info
start_time::DateTime
finish_time::DateTime
end

function Info()
Info(now(), now())
end

function get_elapsed(info::Info)
info.finish_time - info.start_time
end

function get_report(info::Info)
info.finish_time = now()
elapsed = get_elapsed(info)
elapsed_sec = round(elapsed, Dates.Second(1))
@info "Page built in $(elapsed_sec)."
@info "This page was last built at $(info.finish_time)."
end

draw(deca) = to_graphviz(deca, box_labels=:name, junction_labels=:variable, prog="circo")
lukem12345 marked this conversation as resolved.
Show resolved Hide resolved

end
24 changes: 11 additions & 13 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ using Distributed
using Decapodes
using Catlab
using Catlab.WiringDiagrams
using AlgebraicPetri
using CairoMakie

# Set Literate.jl config if not being compiled on recognized service.
Expand Down Expand Up @@ -43,24 +42,23 @@ makedocs(
sitename = "Decapodes.jl",
doctest = false,
checkdocs = :none,
pagesonly = true,
pages = Any[
"Decapodes.jl" => "index.md",
"Vortices" => "navier_stokes/ns.md",
"Halfar-NS" => "halmo.md",
"Overview" => "overview.md",
"Klausmeier" => "klausmeier.md",
"Equations" => "equations.md",
"Vortices" => "navier_stokes/ns.md",
"Cahn-Hilliard" => "ch/cahn-hilliard.md",
"Klausmeier" => "klausmeier/klausmeier.md",
"CISM v2.1" => "cism/cism.md",
"Glacial Flow" => "ice_dynamics.md",
"Grigoriev Ice Cap" => "grigoriev.md",
"Grigoriev Ice Cap" => "grigoriev/grigoriev.md",
"Budyko-Sellers-Halfar" => "budyko_sellers_halfar.md",
"CISM v2.1" => "cism.md",
"NHS" => "nhs.md",
"Equations" => "equations.md",
"ASCII Operators" => "ascii.md",
"Misc Features" => "bc_debug.md",
# "Halfar-NS" => "halmo.md", # TODO: Remove since results are not interesting?
GeorgeR227 marked this conversation as resolved.
Show resolved Hide resolved
# "NHS" => "nhs/nhs.md", # TODO: Simulation is too large/hard
"Pipe Flow" => "poiseuille.md",
# "Examples" => Any[
# "examples/cfd_example.md"
# ],
"Misc Features" => "bc_debug.md",
"ASCII Operators" => "ascii.md",
"Canonical Models" => "canon.md",
"Library Reference" => "api.md"
]
Expand Down
1 change: 1 addition & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Library Reference

## Decapodes

```@autodocs
Modules = [ Decapodes ]
Private = false
Expand Down
1 change: 0 additions & 1 deletion docs/src/ascii.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,3 @@ Some users may have trouble entering unicode characters like ⋆ or ∂ in their
| ∇ᵈ | ∘(⋆,d,⋆) | \nabla \<tab\> \\^d \<tab\> |
| ∇x | ∘(d,⋆) | \nabla \<tab\> x |
| adv(X,Y) | ∘(⋆,d,⋆)(X∧Y) | adv |

38 changes: 18 additions & 20 deletions docs/src/bc_debug.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
# Simulation Setup

```@setup INFO
include(joinpath(Base.@__DIR__, "..", "docinfo.jl"))
info = DocInfo.Info()
```

This tutorial showcases some of the other features included in the Decapodes.jl
package. Currently, these features are the treatment of boundary conditions and
the simulation debugger interface. To begin, we set up the same
advection-diffusion problem presented in the Overview section.
advection-diffusion problem presented in the [Overview](overview.md) section.
As before, we define the Diffusion, Advection, and Superposition components,
and now include a BC (Bounday Condition) component. Decapodes.jl interprets any
`Hom` which begins with a `∂` as a boundary condition. These boundary
conditions recieve special treatment at the scheduling step. Below we show the
and now include a Boundary Condition (BC) component. By convention, BCs are encoded in Decapodes by using a `∂` symbol. Below we show the
graphical rendering of this boundary condition diagram, which we will use to
impose a Dirichlet condition on the time derivative of concentration at the
impose a [Dirichlet condition](https://en.wikipedia.org/wiki/Dirichlet_boundary_condition) on the time derivative of concentration at the
mesh boundary.

```@example Debug
using Catlab
using Catlab.Graphics
using DiagrammaticEquations
using DiagrammaticEquations.Deca
using Decapodes

Diffusion = @decapode begin
Expand Down Expand Up @@ -58,7 +59,6 @@ to_graphviz(BoundaryConditions)

As before, we compose these physics components over our wiring diagram.


```@example Debug
compose_diff_adv = @relation (C, V) begin
diffusion(C, ϕ₁)
Expand Down Expand Up @@ -87,11 +87,10 @@ ensures that this boundary condition holds true for any variables dependent on
this variable, though also means that the boundary conditions on a variable
have no immediate impact on the variables this variable is dependent on.

In the visualization below, wee see that the final operation
In the visualization below, we see that the final operation
executed on the data is the boundary condition we are enforcing on the change
in concentration.


```@example Debug
to_graphviz(DiffusionAdvection)
```
Expand All @@ -101,16 +100,15 @@ boundary conditions and so we will use the `plot_mesh` from the previous
example instead of the mesh with periodic boundary conditions. Because the mesh
is only a primal mesh, we also generate and subdivide the dual mesh.

`Rectangle_30x10` is a default mesh that is downloaded via `Artifacts.jl` when a user installs Decapodes. Via CombinatorialSpaces.jl, we can instantiate any `.obj` file of triangulated faces as a simplicial set.
lukem12345 marked this conversation as resolved.
Show resolved Hide resolved

```@example Debug
using CombinatorialSpaces, CombinatorialSpaces.DiscreteExteriorCalculus
using CombinatorialSpaces
using CairoMakie

plot_mesh = loadmesh(Rectangle_30x10())

# Generate the dual mesh
plot_mesh_dual = EmbeddedDeltaDualComplex2D{Bool, Float64, Point3{Float64}}(plot_mesh)

# Calculate distances and subdivisions for the dual mesh
subdivide_duals!(plot_mesh_dual, Circumcenter())

Expand All @@ -131,8 +129,7 @@ modified initial condition is shown below:
using LinearAlgebra
using ComponentArrays
using MLStyle
using CombinatorialSpaces.DiscreteExteriorCalculus: ∧
include("../../examples/boundary_helpers.jl")
include("boundary_helpers.jl") # TODO: Remove this file

function generate(sd, my_symbol; hodge=GeometricHodge())
op = @match my_symbol begin
Expand All @@ -142,12 +139,9 @@ function generate(sd, my_symbol; hodge=GeometricHodge())
x[boundary] .= 0
x
end
:∧₀₁ => (x,y) -> begin
∧(Tuple{0,1}, sd, x,y)
end
x => error("Unmatched operator $my_symbol")
end
return (args...) -> op(args...)
return op
end

using Distributions
Expand Down Expand Up @@ -194,4 +188,8 @@ record(fig, "diff_adv_right.gif", range(0.0, 100.0; length=150); framerate = 30)
end
```

![](diff_adv_right.gif)
![Your first BC Decapode!](diff_adv_right.gif)
GeorgeR227 marked this conversation as resolved.
Show resolved Hide resolved

```@example INFO
DocInfo.get_report(info) # hide
```
File renamed without changes.
Loading
Loading