Skip to content

Commit

Permalink
Add back Catlab plus updated sources
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeR227 authored and jpfairbanks committed Jan 10, 2025
1 parent 19473fe commit 6192936
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions examples/chemistry/gray_scott.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using Catlab
using CombinatorialSpaces
using DiagrammaticEquations
using Decapodes
Expand All @@ -12,9 +13,10 @@ using GeometryBasics: Point2, Point3
Point2D = Point2{Float64}
Point3D = Point3{Float64}

# We use the model equations as stated here and use the initial conditions for
# f, k, rᵤ, rᵥ as listed for experiment 4.
# https://groups.csail.mit.edu/mac/projects/amorphous/GrayScott/
# We use the model equations as stated here:
# https://github.com/JuliaParallel/julia-hpc-tutorial-sc24/blob/main/parts/gpu/gray-scott.ipynb
# Initial conditions were based off those given here:
# https://itp.uni-frankfurt.de/~gros/StudentProjects/Projects_2020/projekt_schulz_kaefer/#header
GrayScott = @decapode begin
(U, V)::Form0
(UV2)::Form0
Expand All @@ -33,15 +35,16 @@ GrayScott = @decapode begin
end

n = 100
h = 1

s = triangulated_grid(n,n,0.8,0.8,Point3D);
s = triangulated_grid(n,n,h,h,Point3D);
sd = EmbeddedDeltaDualComplex2D{Bool,Float64,Point2D}(s);
subdivide_duals!(sd, Circumcenter());

sim = eval(gensim(GrayScott))

left_wall_idxs = findall(x -> x[1] <= 1.0, s[:point])
right_wall_idxs = findall(x -> x[1] >= n - 1.0, s[:point])
left_wall_idxs = findall(x -> x[1] <= h, s[:point])
right_wall_idxs = findall(x -> x[1] >= n - h, s[:point])
top_wall_idxs = findall(y -> y[2] == 0.0, s[:point])
bot_wall_idxs = findall(y -> y[2] == n, s[:point])

Expand Down

0 comments on commit 6192936

Please sign in to comment.