Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Cartesian grid and MandelSetup #1308

Merged
Merged
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
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
Loading