Skip to content

Commit

Permalink
fix multiphase init
Browse files Browse the repository at this point in the history
  • Loading branch information
daubners committed Nov 18, 2024
1 parent 11eff49 commit d1fcaeb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion taufactor/taufactor.py
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,6 @@ def __init__(self, img, cond={1: 1}, bc=(-0.5, 0.5), device=torch.device('cuda:0
for a 2 phase material, {1:0.543, 2: 0.420}, with 1s and 2s in the input img
:param bc: Upper and lower boundary conditions. Leave as default.
"""
super().__init__(img, bc, device)
if (0 in cond.values()):
raise ValueError(
'0 conductivity phase: non-conductive phase should be labelled 0 in the input image and ommitted from the cond argument')
Expand All @@ -408,6 +407,7 @@ def __init__(self, img, cond={1: 1}, bc=(-0.5, 0.5), device=torch.device('cuda:0
self.cond = {ph: 0.5 / c for ph, c in cond.items()}

# Results
super().__init__(img, bc, device)
self.pre_factors = self.nn[1:]
self.nn = self.nn[0]

Expand Down

0 comments on commit d1fcaeb

Please sign in to comment.