CliMA / CliMA/ClimaCore.jl

Iteration over a slab

Open
#463 1 comment 0 reactions 0 assignees View on GitHub
API enhancement
Dominant language
Julia
Stars
117
Forks
19
Avg merge
3d 5h
Merged PRs (30d)
36

Description

I've found a couple of use cases (in #426) in which it would be handy to be able to iterate over a slab.

For instance, we slice a field over the elements to perform some element computation and want to check that the field satisfies a certain condition over each quadrature point of the slab (where the values we want to check against are different on each element).

Two non-working attempts

```
for e in 1:n_elems
field_e_mass[e] = sum(Fields.slab(ρstar, e))
if Fields.slab(field, e) <= field_e_mass[e]
@show "condition satisfied"
end
end
```

```
for e in 1:n_elems
field_e_mass[e] = sum(Fields.slab(ρstar, e))
all(x -> x <= field_e_mass[e], Fields.slab(field, e))
end
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.