Skip to content
This repository was archived by the owner on Jul 19, 2023. It is now read-only.

Commit a986250

Browse files
committed
added error message if stencil length is larger than dimension
1 parent 5a453b0 commit a986250

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/derivative_operators/derivative_operator.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,8 @@ struct DerivativeOperator{T<:Real,S<:SVector,LBC,RBC} <: AbstractDerivativeOpera
8585
stencil_coefs = convert(SVector{stencil_length, T}, calculate_weights(derivative_order, zero(T),
8686
grid_step .* collect(-div(stencil_length,2) : 1 : div(stencil_length,2))))
8787

88+
dimension < stencil_length && throw("Dimension too low for the stencil length of the Operator. Check your dimension length, derivative order, and approximation order.")
89+
8890
left_bndry = initialize_left_boundary!(Val{:LO},low_boundary_coefs,stencil_coefs,BC,derivative_order,
8991
grid_step,bl,bpc_array,dx,LBC)
9092

@@ -93,7 +95,6 @@ struct DerivativeOperator{T<:Real,S<:SVector,LBC,RBC} <: AbstractDerivativeOpera
9395

9496
boundary_condition = (left_bndry, right_bndry)
9597
boundary_point_count = (bpc_array[1],bpc_array[2])
96-
9798
t = 0
9899

99100
new(derivative_order, approximation_order, dx, dimension, stencil_length,

0 commit comments

Comments
 (0)