Mercurial > repos > public > sbplib_julia
comparison src/BoundaryConditions/boundary_condition.jl @ 1395:bdcdbd4ea9cd feature/boundary_conditions
Merge with default. Comment out broken tests for boundary_conditions at sat
author | Vidar Stiernström <vidar.stiernstrom@it.uu.se> |
---|---|
date | Wed, 26 Jul 2023 21:35:50 +0200 |
parents | d26aef8a5987 |
children | 35840a0681d1 |
comparison
equal
deleted
inserted
replaced
1217:ea2e8254820a | 1395:bdcdbd4ea9cd |
---|---|
68 a `LazyArray` holding the `BoundaryData` discretized on `boundary_grid`. | 68 a `LazyArray` holding the `BoundaryData` discretized on `boundary_grid`. |
69 """ | 69 """ |
70 # TODO: Is the return type of discretize really a good interface | 70 # TODO: Is the return type of discretize really a good interface |
71 # for the boundary data? | 71 # for the boundary data? |
72 # Moreover, instead of explicitly converting to a LazyArray here | 72 # Moreover, instead of explicitly converting to a LazyArray here |
73 # should we defer this to evalOn (and extend evalOn for scalars as well)? | 73 # should we defer this to eval_on (and extend eval_on for scalars as well)? |
74 # I.e. if evalOn returns a LazyArray, the boundary data is lazy. Otherwise | 74 # I.e. if eval_on returns a LazyArray, the boundary data is lazy. Otherwise |
75 # it is preallocated. | 75 # it is preallocated. |
76 | 76 |
77 function discretize(bd::ConstantBoundaryData, boundary_grid) | 77 function discretize(bd::ConstantBoundaryData, boundary_grid) |
78 return t -> LazyTensors.LazyConstantArray(bd.val, size(boundary_grid)) | 78 return t -> LazyTensors.LazyConstantArray(bd.val, size(boundary_grid)) |
79 end | 79 end |
81 function discretize(bd::TimeDependentBoundaryData, boundary_grid) | 81 function discretize(bd::TimeDependentBoundaryData, boundary_grid) |
82 return t -> LazyTensors.LazyConstantArray(bd.val(t), size(boundary_grid)) | 82 return t -> LazyTensors.LazyConstantArray(bd.val(t), size(boundary_grid)) |
83 end | 83 end |
84 | 84 |
85 function discretize(bd::SpaceDependentBoundaryData, boundary_grid) | 85 function discretize(bd::SpaceDependentBoundaryData, boundary_grid) |
86 return t -> evalOn(boundary_grid, bd.val) | 86 return t -> eval_on(boundary_grid, bd.val) |
87 end | 87 end |
88 | 88 |
89 function discretize(bd::SpaceTimeDependentBoundaryData, boundary_grid) | 89 function discretize(bd::SpaceTimeDependentBoundaryData, boundary_grid) |
90 return t -> evalOn(boundary_grid, bd.val(t)) | 90 return t -> eval_on(boundary_grid, bd.val(t)) |
91 end | 91 end |
92 | 92 |
93 function discretize(::ZeroBoundaryData, boundary_grid) | 93 function discretize(::ZeroBoundaryData, boundary_grid) |
94 return t -> LazyTensors.LazyConstantArray(zero(eltype(boundary_grid)), size(boundary_grid)) | 94 return t -> LazyTensors.LazyConstantArray(zero(eltype(boundary_grid)), size(boundary_grid)) |
95 end | 95 end |