Skip to content

Commit 7e64f63

Browse files
added an assertion to avoid id=0
1 parent cbf5064 commit 7e64f63

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/festim/subdomain/volume_subdomain.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class VolumeSubdomain:
2424
Volume subdomain class
2525
2626
Args:
27-
id: the id of the volume subdomain
27+
id: the id of the volume subdomain (> 0)
2828
submesh: the submesh of the volume subdomain
2929
cell_map: the cell map of the volume subdomain
3030
parent_mesh: the parent mesh of the volume subdomain
@@ -58,6 +58,7 @@ class VolumeSubdomain:
5858
def __init__(
5959
self, id, material, locator: Callable | None = None, name: str | None = None
6060
):
61+
assert id != 0, "Volume subdomain id cannot be 0"
6162
self.id = id
6263
self.material = material
6364
self.locator = locator

0 commit comments

Comments
 (0)