예제 #1
0
파일: basic.py 프로젝트: pnmoralesh/Devito
 def _check_indices(self, inds=None):
     """
     Check if the function indices are aligned with the dimensions.
     """
     inds = inds or self.indices
     return all([aligned_indices(i, j, d.spacing) for i, j, d in
                 zip(inds, self.indices_ref, self.dimensions)])
예제 #2
0
 def _is_on_grid(self):
     """
     Check whether the object is on the grid or need averaging.
     For example, if the original non-staggered function is f(x)
     then f(x) is on the grid and f(x + h_x/2) is off the grid.
     """
     return all([aligned_indices(i, j, d.spacing) for i, j, d in
                 zip(self.indices, self.indices_ref, self.dimensions)])