Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions discretize/base/base_tensor_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -554,9 +554,9 @@ def boundary_edges(self):
ey = ndgrid(self.nodes_x[[0, -1]], self.cell_centers_y)
return np.r_[ex, ey]
if dim == 3:
ex = self.edges_x[make_boundary_bool(self.shape_edges_x, dir="yz")]
ey = self.edges_y[make_boundary_bool(self.shape_edges_y, dir="xz")]
ez = self.edges_z[make_boundary_bool(self.shape_edges_z, dir="xy")]
ex = self.edges_x[make_boundary_bool(self.shape_edges_x, bdir="yz")]
ey = self.edges_y[make_boundary_bool(self.shape_edges_y, bdir="xz")]
ez = self.edges_z[make_boundary_bool(self.shape_edges_z, bdir="xy")]
return np.r_[ex, ey, ez]

def _getTensorGrid(self, key):
Expand Down
22 changes: 11 additions & 11 deletions discretize/curvilinear_mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,24 +506,24 @@ def boundary_nodes(self): # NOQA D102
def boundary_edges(self): # NOQA D102
# Documentation inherited from discretize.base.BaseMesh
if self.dim == 2:
ex = self.edges_x[make_boundary_bool(self.shape_edges_x, dir="y")]
ey = self.edges_y[make_boundary_bool(self.shape_edges_y, dir="x")]
ex = self.edges_x[make_boundary_bool(self.shape_edges_x, bdir="y")]
ey = self.edges_y[make_boundary_bool(self.shape_edges_y, bdir="x")]
return np.r_[ex, ey]
elif self.dim == 3:
ex = self.edges_x[make_boundary_bool(self.shape_edges_x, dir="yz")]
ey = self.edges_y[make_boundary_bool(self.shape_edges_y, dir="xz")]
ez = self.edges_z[make_boundary_bool(self.shape_edges_z, dir="xy")]
ex = self.edges_x[make_boundary_bool(self.shape_edges_x, bdir="yz")]
ey = self.edges_y[make_boundary_bool(self.shape_edges_y, bdir="xz")]
ez = self.edges_z[make_boundary_bool(self.shape_edges_z, bdir="xy")]
return np.r_[ex, ey, ez]

@property
def boundary_faces(self): # NOQA D102
# Documentation inherited from discretize.base.BaseMesh
fx = self.faces_x[make_boundary_bool(self.shape_faces_x, dir="x")]
fy = self.faces_y[make_boundary_bool(self.shape_faces_y, dir="y")]
fx = self.faces_x[make_boundary_bool(self.shape_faces_x, bdir="x")]
fy = self.faces_y[make_boundary_bool(self.shape_faces_y, bdir="y")]
if self.dim == 2:
return np.r_[fx, fy]
elif self.dim == 3:
fz = self.faces_z[make_boundary_bool(self.shape_faces_z, dir="z")]
fz = self.faces_z[make_boundary_bool(self.shape_faces_z, bdir="z")]
return np.r_[fx, fy, fz]

@property
Expand All @@ -538,16 +538,16 @@ def boundary_face_outward_normals(self): # NOQA D102
is_bym = is_bym.reshape(-1, order="F")

is_b = np.r_[
make_boundary_bool(self.shape_faces_x, dir="x"),
make_boundary_bool(self.shape_faces_y, dir="y"),
make_boundary_bool(self.shape_faces_x, bdir="x"),
make_boundary_bool(self.shape_faces_y, bdir="y"),
]
switch = np.r_[is_bxm, is_bym]
if self.dim == 3:
is_bzm = np.zeros(self.shape_faces_z, order="F", dtype=bool)
is_bzm[:, :, 0] = True
is_bzm = is_bzm.reshape(-1, order="F")

is_b = np.r_[is_b, make_boundary_bool(self.shape_faces_z, dir="z")]
is_b = np.r_[is_b, make_boundary_bool(self.shape_faces_z, bdir="z")]
switch = np.r_[switch, is_bzm]
face_normals = self.face_normals.copy()
face_normals[switch] *= -1
Expand Down
12 changes: 6 additions & 6 deletions discretize/operators/differential_operators.py
Original file line number Diff line number Diff line change
Expand Up @@ -3465,11 +3465,11 @@ def project_face_to_boundary_face(self): # NOQA D102

# Create a matrix that projects all faces onto boundary faces
# The below should work for a regular structured mesh
is_b = make_boundary_bool(self.shape_faces_x, dir="x")
is_b = make_boundary_bool(self.shape_faces_x, bdir="x")
if self.dim > 1:
is_b = np.r_[is_b, make_boundary_bool(self.shape_faces_y, dir="y")]
is_b = np.r_[is_b, make_boundary_bool(self.shape_faces_y, bdir="y")]
if self.dim == 3:
is_b = np.r_[is_b, make_boundary_bool(self.shape_faces_z, dir="z")]
is_b = np.r_[is_b, make_boundary_bool(self.shape_faces_z, bdir="z")]
return sp.eye(self.n_faces, format="csr")[is_b]

@property
Expand All @@ -3484,11 +3484,11 @@ def project_edge_to_boundary_edge(self): # NOQA D102
return None # No edges are on the boundary in 1D

is_b = np.r_[
make_boundary_bool(self.shape_edges_x, dir="yz"),
make_boundary_bool(self.shape_edges_y, dir="xz"),
make_boundary_bool(self.shape_edges_x, bdir="yz"),
make_boundary_bool(self.shape_edges_y, bdir="xz"),
]
if self.dim == 3:
is_b = np.r_[is_b, make_boundary_bool(self.shape_edges_z, dir="xy")]
is_b = np.r_[is_b, make_boundary_bool(self.shape_edges_z, bdir="xy")]
return sp.eye(self.n_edges, format="csr")[is_b]

@property
Expand Down