Skip to content

Commit

Permalink
Merge branch 'develop' into issue_test_geometry
Browse files Browse the repository at this point in the history
  • Loading branch information
IvarStefansson authored Jan 20, 2025
2 parents b1fe22a + 80c6aa6 commit a0232b4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/porepy/examples/mandel_biot.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

from __future__ import annotations

import warnings
from dataclasses import dataclass
from typing import Callable, Literal, Union, cast

Expand Down Expand Up @@ -1022,6 +1023,18 @@ def _plot_horizontal_flux(self, color_map: mcolors.ListedColormap) -> None:
color_map: listed color map object.
"""
if self.grid_type() == "cartesian":
# A division by zero was discovered while running the Mandel-problem on a
# Cartesian grid. The issue was related to plotting, and the current
# solution is to skip the troublesome plotting if the grid type is
# Cartesian. The GitHub-issue for this is found at:
# https://github.com/pmgbergen/porepy/issues/1137
warnings.warn(
"""Division by x-component of the normal vector for internal faces of
cells adjacent to the southern boundary causes division by zero for
cartesian grids."""
)
return
sd = self.mdg.subdomains()[0]
xf = sd.face_centers[0]
nx = sd.face_normals[0]
Expand Down

0 comments on commit a0232b4

Please sign in to comment.