From 0f912d42780e11c94942442b922ca0a7725003db Mon Sep 17 00:00:00 2001 From: Hesam Salehipour Date: Fri, 4 Oct 2024 11:01:46 -0400 Subject: [PATCH] enabled the new BC to work with indices bc masker --- xlb/operator/boundary_condition/bc_grads_approximation.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/xlb/operator/boundary_condition/bc_grads_approximation.py b/xlb/operator/boundary_condition/bc_grads_approximation.py index 2e6e597..870635e 100644 --- a/xlb/operator/boundary_condition/bc_grads_approximation.py +++ b/xlb/operator/boundary_condition/bc_grads_approximation.py @@ -71,6 +71,12 @@ def __init__( # This BC needs implicit distance to the mesh self.needs_mesh_distance = True + # If this BC is defined using indices, it would need padding in order to find missing directions + # when imposed on a geometry that is in the domain interior + if self.mesh_vertices is None: + assert self.indices is not None + self.needs_padding = True + # Raise error if used for 2d examples: if self.velocity_set.d == 2: raise NotImplementedError("This BC is not implemented in 2D!")