Skip to content

Commit fcdecfb

Browse files
committed
Fix getbc not passing args for discrete BC functions
1 parent a7b90b2 commit fcdecfb

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/BoundaryConditions/discrete_boundary_function.jl

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ When `parameters` is not `nothing`, the boundary condition `func` is called with
1919
the signature
2020
2121
```
22-
func(i, j, grid, clock, model_fields, parameters)
22+
func(i, j, grid, clock, model_fields, parameters, args...)
2323
```
24+
where `args` are any additional arguments passed to `getbc`.
2425
2526
*Note* that the index `end` does *not* access the final physical grid point of
2627
a model field in any direction. The final grid point must be explictly specified, as
@@ -34,17 +35,17 @@ end
3435
const UnparameterizedDBF = DiscreteBoundaryFunction{<:Nothing}
3536

3637
@inline getbc(condition::UnparameterizedDBF, i::Integer, j::Integer, grid::AbstractGrid, clock, model_fields, args...) =
37-
condition.func(i, j, grid, clock, model_fields)
38+
condition.func(i, j, grid, clock, model_fields, args...)
3839

3940
@inline getbc(condition::DiscreteBoundaryFunction, i::Integer, j::Integer, grid::AbstractGrid, clock, model_fields, args...) =
40-
condition.func(i, j, grid, clock, model_fields, condition.parameters)
41+
condition.func(i, j, grid, clock, model_fields, condition.parameters, args...)
4142

4243
# 3D function for immersed boundary conditions
4344
@inline getbc(condition::UnparameterizedDBF, i::Integer, j::Integer, k::Integer, grid::AbstractGrid, clock, model_fields, args...) =
44-
condition.func(i, j, k, grid, clock, model_fields)
45+
condition.func(i, j, k, grid, clock, model_fields, args...)
4546

4647
@inline getbc(condition::DiscreteBoundaryFunction, i::Integer, j::Integer, k::Integer, grid::AbstractGrid, clock, model_fields, args...) =
47-
condition.func(i, j, k, grid, clock, model_fields, condition.parameters)
48+
condition.func(i, j, k, grid, clock, model_fields, condition.parameters, args...)
4849

4950
# Don't re-convert DiscreteBoundaryFunctions passed to BoundaryCondition constructor
5051
BoundaryCondition(Classification::DataType, condition::DiscreteBoundaryFunction) = BoundaryCondition(Classification(), condition)

0 commit comments

Comments
 (0)