Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 30 additions & 1 deletion src/var_coef_operators.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,35 @@ The evaluation of the derivative can be parallelized using threads by choosing
"""
function var_coef_derivative_operator(source_of_coefficients, derivative_order,
accuracy_order,
xmin, xmax, N, bfunc, mode = FastMode())
xmin, xmax, N, bfunc::AbstractVector, mode = FastMode())
if mode === Val(:serial) || mode === Val(:threads)
# TODO: deprecated in v0.5
Base.depwarn("Providing the argument `parallel` is deprecated." *
"Use `mode` instead.", :var_coef_derivative_operator)
mode = _parallel_to_mode(mode)
end
grid = construct_grid(source_of_coefficients, accuracy_order, xmin, xmax, N)
coefficients = var_coef_derivative_coefficients(source_of_coefficients,
derivative_order, accuracy_order, grid,
mode)
VarCoefDerivativeOperator(coefficients, grid, bfunc)
end

"""
var_coef_derivative_operator(source_of_coefficients, derivative_order, accuracy_order,
xmin, xmax, N, left_weights, right_weights, bfunc,
mode=FastMode())

Create a `VarCoefDerivativeOperator` approximating a `derivative_order`-th
derivative with variable coefficients `bfunc` on a grid between `xmin` and
`xmax` with `N` grid points up to order of accuracy `accuracy_order` with
coefficients given by `source_of_coefficients`.
The evaluation of the derivative can be parallelized using threads by choosing
`mode=ThreadedMode()`.
"""
function var_coef_derivative_operator(source_of_coefficients, derivative_order,
accuracy_order,
xmin, xmax, N, bfunc::Function, mode = FastMode())
if mode === Val(:serial) || mode === Val(:threads)
# TODO: deprecated in v0.5
Base.depwarn("Providing the argument `parallel` is deprecated." *
Expand All @@ -96,6 +124,7 @@ function var_coef_derivative_operator(source_of_coefficients, derivative_order,
derivative_order, accuracy_order, grid,
mode)
VarCoefDerivativeOperator(coefficients, grid, bfunc.(grid))

end

"""
Expand Down