mirror of https://gitlab.com/pamhyr/pamhyr2
Solver: Mage: Fix mage export.
parent
645a76b0e8
commit
420d766ae5
|
|
@ -250,26 +250,21 @@ class Mage(CommandLineSolver):
|
|||
|
||||
# Generate sediment additional data if available
|
||||
sediment = ""
|
||||
if profile.sl is None:
|
||||
return
|
||||
if profile.sl is not None and not profile.sl.is_deleted():
|
||||
if not any(filter(lambda f: ".GRA" in f, files)):
|
||||
files.append(self._gra_file)
|
||||
|
||||
if profile.sl.is_deleted():
|
||||
return
|
||||
# Number of layers
|
||||
nl = len(profile.sl)
|
||||
sediment = f" {nl:>3}"
|
||||
|
||||
if not any(filter(lambda f: ".GRA" in f, files)):
|
||||
files.append(self._gra_file)
|
||||
|
||||
# Number of layers
|
||||
nl = len(profile.sl)
|
||||
sediment = f" {nl:>3}"
|
||||
|
||||
# Layers data
|
||||
for layer in profile.sl.layers:
|
||||
sediment += (
|
||||
f" {layer.height:>10} {layer.d50:>10} " +
|
||||
f"{layer.sigma:>10} " +
|
||||
f"{layer.critical_constraint:>10}"
|
||||
)
|
||||
# Layers data
|
||||
for layer in profile.sl.layers:
|
||||
sediment += (
|
||||
f" {layer.height:>10} {layer.d50:>10} " +
|
||||
f"{layer.sigma:>10} " +
|
||||
f"{layer.critical_constraint:>10}"
|
||||
)
|
||||
|
||||
# Profile header line
|
||||
wfile.write(f"{num}{c1}{c2}{t} {rk} {pname} {sediment}\n")
|
||||
|
|
@ -283,24 +278,20 @@ class Mage(CommandLineSolver):
|
|||
# Generate sediment additional data if available
|
||||
sediment = ""
|
||||
prev = point.z
|
||||
if point.sl is None:
|
||||
return
|
||||
|
||||
if point.sl.is_deleted():
|
||||
return
|
||||
if point.sl is not None and not point.sl.is_deleted():
|
||||
# Number of layers
|
||||
nl = len(point.sl)
|
||||
sediment = f"{nl:>3}"
|
||||
|
||||
# Number of layers
|
||||
nl = len(point.sl)
|
||||
sediment = f"{nl:>3}"
|
||||
|
||||
# Layers data
|
||||
for layer in point.sl.layers:
|
||||
prev = round(prev - layer.height, 5)
|
||||
sediment += (
|
||||
f" {prev:>10} {layer.d50:>10} " +
|
||||
f"{layer.sigma:>10} " +
|
||||
f"{layer.critical_constraint:>10}"
|
||||
)
|
||||
# Layers data
|
||||
for layer in point.sl.layers:
|
||||
prev = round(prev - layer.height, 5)
|
||||
sediment += (
|
||||
f" {prev:>10} {layer.d50:>10} " +
|
||||
f"{layer.sigma:>10} " +
|
||||
f"{layer.critical_constraint:>10}"
|
||||
)
|
||||
|
||||
# Point line
|
||||
wfile.write(f"{x} {y} {z} {n} {sediment}\n")
|
||||
|
|
@ -701,18 +692,15 @@ class Mage(CommandLineSolver):
|
|||
|
||||
nb_cv = 0
|
||||
for hs in hydraulic_structures:
|
||||
if not hs.enabled or hs.is_deleted():
|
||||
continue
|
||||
|
||||
if hs.input_reach is None:
|
||||
continue
|
||||
|
||||
if not hs.input_reach.is_enable() or hs.input_reach.is_deleted():
|
||||
continue
|
||||
|
||||
if not hs.enabled:
|
||||
continue
|
||||
|
||||
if hs.is_deleted():
|
||||
continue
|
||||
|
||||
for bhs in hs.basic_structures:
|
||||
if bhs.enabled:
|
||||
logger.info(bhs._type)
|
||||
|
|
|
|||
Loading…
Reference in New Issue