comparison src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl @ 1731:3684db043add feature/sbp_operators/laplace_curvilinear

Add Base.@constprop :aggressive to src/SbpOperators/volumeops/derivatives/second_derivative_variable.jl
author Jonatan Werpers <jonatan@werpers.com>
date Mon, 09 Sep 2024 09:01:57 +0200
parents e9dfc1998d31
children
comparison
equal deleted inserted replaced
1700:87d603499fc3 1731:3684db043add
138 # TBD: Can this be solved by fixing the general methods instead? 138 # TBD: Can this be solved by fixing the general methods instead?
139 139
140 140
141 ## x-direction 141 ## x-direction
142 function apply_lower(op::SecondDerivativeVariable{1}, v, i, j) 142 function apply_lower(op::SecondDerivativeVariable{1}, v, i, j)
143 Base.@constprop :aggressive
143 ṽ = @view v[:,j] 144 ṽ = @view v[:,j]
144 c̃ = @view op.coefficient[:,j] 145 c̃ = @view op.coefficient[:,j]
145 146
146 return @inbounds apply_stencil(op.closure_stencils[i], c̃, ṽ, i) 147 return @inbounds apply_stencil(op.closure_stencils[i], c̃, ṽ, i)
147 end 148 end
148 149
149 function apply_interior(op::SecondDerivativeVariable{1}, v, i, j) 150 function apply_interior(op::SecondDerivativeVariable{1}, v, i, j)
151 Base.@constprop :aggressive
150 ṽ = @view v[:,j] 152 ṽ = @view v[:,j]
151 c̃ = @view op.coefficient[:,j] 153 c̃ = @view op.coefficient[:,j]
152 154
153 return @inbounds apply_stencil(op.inner_stencil, c̃, ṽ, i) 155 return @inbounds apply_stencil(op.inner_stencil, c̃, ṽ, i)
154 end 156 end
155 157
156 function apply_upper(op::SecondDerivativeVariable{1}, v, i, j) 158 function apply_upper(op::SecondDerivativeVariable{1}, v, i, j)
159 Base.@constprop :aggressive
157 ṽ = @view v[:,j] 160 ṽ = @view v[:,j]
158 c̃ = @view op.coefficient[:,j] 161 c̃ = @view op.coefficient[:,j]
159 162
160 sz = domain_size(op)[derivative_direction(op)] 163 sz = domain_size(op)[derivative_direction(op)]
161 stencil = op.closure_stencils[sz-i+1] 164 stencil = op.closure_stencils[sz-i+1]
163 end 166 end
164 167
165 168
166 ## y-direction 169 ## y-direction
167 function apply_lower(op::SecondDerivativeVariable{2}, v, i, j) 170 function apply_lower(op::SecondDerivativeVariable{2}, v, i, j)
171 Base.@constprop :aggressive
168 ṽ = @view v[i,:] 172 ṽ = @view v[i,:]
169 c̃ = @view op.coefficient[i,:] 173 c̃ = @view op.coefficient[i,:]
170 174
171 return @inbounds apply_stencil(op.closure_stencils[j], c̃, ṽ, j) 175 return @inbounds apply_stencil(op.closure_stencils[j], c̃, ṽ, j)
172 end 176 end
173 177
174 function apply_interior(op::SecondDerivativeVariable{2}, v, i, j) 178 function apply_interior(op::SecondDerivativeVariable{2}, v, i, j)
179 Base.@constprop :aggressive
175 ṽ = @view v[i,:] 180 ṽ = @view v[i,:]
176 c̃ = @view op.coefficient[i,:] 181 c̃ = @view op.coefficient[i,:]
177 182
178 return @inbounds apply_stencil(op.inner_stencil, c̃, ṽ, j) 183 return @inbounds apply_stencil(op.inner_stencil, c̃, ṽ, j)
179 end 184 end
180 185
181 function apply_upper(op::SecondDerivativeVariable{2}, v, i, j) 186 function apply_upper(op::SecondDerivativeVariable{2}, v, i, j)
187 Base.@constprop :aggressive
182 ṽ = @view v[i,:] 188 ṽ = @view v[i,:]
183 c̃ = @view op.coefficient[i,:] 189 c̃ = @view op.coefficient[i,:]
184 190
185 sz = domain_size(op)[derivative_direction(op)] 191 sz = domain_size(op)[derivative_direction(op)]
186 stencil = op.closure_stencils[sz-j+1] 192 stencil = op.closure_stencils[sz-j+1]