Packages

A configurable spherical geodesic grid data model designed for simulations GEOF Planet offers an ideal data model for simulations of 2½D spherical phenomena like oceanography and climate. It is ported from the JavaScript project g-e-o-f/peels.

Current section

Files

Jump to
geof_planet test sphere_test.exs
Raw

test/sphere_test.exs

defmodule GEOF.Planet.SphereTest do
use ExUnit.Case
import GEOF.Planet.Sphere
doctest GEOF.Planet.Sphere
test "iterates through indexes properly" do
d = 7
n_fields =
for_all_fields(0, d, fn acc, _ ->
acc + 1
end)
assert n_fields == 10 * d * d + 2
n_nonpolar_fields =
for_all_fields(0, d, fn
acc, {:sxy, _, _, _} -> acc + 1
acc, _ -> acc
end)
assert n_nonpolar_fields == 10 * d * d
end
end