11from functools import wraps
22
3- from devito .types import NODE
43from devito .types .dimension import StencilDimension
54from .differentiable import Weights , DiffDerivative
65from .tools import generate_indices , fd_weights_registry
@@ -101,12 +100,7 @@ def check_staggering(func):
101100 def wrapper (expr , dim , x0 = None , expand = True ):
102101 grid = expr .grid
103102 x0 = {k : v for k , v in x0 .items () if k .is_Space }
104- if expr .staggered is NODE or expr .staggered is None :
105- cond = x0 == {} or x0 == all_staggered (grid ) or x0 == grid_node (grid )
106- elif expr .staggered == grid .dimensions :
107- cond = x0 == {} or x0 == all_staggered (grid ) or x0 == grid_node (grid )
108- else :
109- cond = False
103+ cond = x0 == {} or x0 == all_staggered (grid ) or x0 == grid_node (grid )
110104 if cond :
111105 return func (expr , dim , x0 = x0 , expand = expand )
112106 else :
@@ -117,7 +111,8 @@ def wrapper(expr, dim, x0=None, expand=True):
117111@check_staggering
118112def d45 (expr , dim , x0 = None , expand = True ):
119113 """
120- RSFD approximation of the derivative of `expr` along `dim` at point `x0`.
114+ Rotated staggered grid finite-differences (RSFD) discretization
115+ of the derivative of `expr` along `dim` at point `x0`.
121116
122117 Parameters
123118 ----------
@@ -132,7 +127,8 @@ def d45(expr, dim, x0=None, expand=True):
132127 """
133128 # Make sure the grid supports RSFD
134129 if expr .grid .dim not in [2 , 3 ]:
135- raise ValueError ('RSFD only supported in 2D and 3D' )
130+ raise ValueError ('Rotated staggered grid finite-differences (RSFD)'
131+ ' only supported in 2D and 3D' )
136132
137133 # Diagonals weights
138134 w = dir_weights [(dim .name , expr .grid .dim )]
0 commit comments