Skip to content

Commit 627518b

Browse files
committed
evaluator boundary bugfix
1 parent aa1225d commit 627518b

1 file changed

Lines changed: 2 additions & 11 deletions

File tree

epde/evaluators.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,8 @@ def __call__(self, factor, structural: bool = False, func_args: List[Union[torch
8484
self.indexes_vect[tensor_idx] = tuple([subarg[tensor_idx]
8585
for subarg in func_args])
8686
value = grid_function(self.indexes_vect)
87-
if len(global_var.grid_cache.initial_shape) > 1:
88-
value = value.reshape(*global_var.grid_cache.initial_shape)
89-
if isinstance(global_var.grid_cache.boundary_width, int):
90-
for dim in range(value.ndim):
91-
value[dim] = value[global_var.grid_cache.boundary_width:-global_var.grid_cache.boundary_width]
92-
elif isinstance(global_var.grid_cache.boundary_width, (list, tuple)):
93-
for dim in range(value.ndim):
94-
value[dim] = value[global_var.grid_cache.boundary_width[dim]:-global_var.grid_cache.boundary_width[dim]]
95-
value = value.reshape(-1)
96-
else:
97-
value = value[global_var.grid_cache.boundary_width:-global_var.grid_cache.boundary_width]
87+
value = value[global_var.grid_cache.g_func != 0]
88+
value = value.reshape(-1)
9889
return value
9990

10091

0 commit comments

Comments
 (0)