mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-10-12 03:24:14 +00:00
Spring pool tests and single source marker
- Only the centerline cell of the first station carries the source feature - Headwater and styled geometry tests expect the spring pool - Transect table starts with the first 24 stations
This commit is contained in:
+2
-1
@@ -82,7 +82,8 @@ public final class SurfaceFootprintCompiler {
|
|||||||
HydraulicSegment segment = exposed.get(stations.segmentIndex()[column.station()]);
|
HydraulicSegment segment = exposed.get(stations.segmentIndex()[column.station()]);
|
||||||
int flowX = (int) StrictMath.round(centerline.tangentX()[column.station()]);
|
int flowX = (int) StrictMath.round(centerline.tangentX()[column.station()]);
|
||||||
int flowZ = (int) StrictMath.round(centerline.tangentZ()[column.station()]);
|
int flowZ = (int) StrictMath.round(centerline.tangentZ()[column.station()]);
|
||||||
boolean source = column.station() == 0 && column.role() == SurfaceRole.CHANNEL && !column.apron();
|
boolean source = column.station() == 0 && column.role() == SurfaceRole.CHANNEL && !column.apron()
|
||||||
|
&& column.x() == centerline.x()[0] && column.z() == centerline.z()[0];
|
||||||
int y = column.role() == SurfaceRole.CHANNEL ? column.headY() : column.height();
|
int y = column.role() == SurfaceRole.CHANNEL ? column.headY() : column.height();
|
||||||
HydrologyFeatureRef feature = features.feature(segment, column.role(), source, column.x(), y, column.z(), flowX, flowZ);
|
HydrologyFeatureRef feature = features.feature(segment, column.role(), source, column.x(), y, column.z(), flowX, flowZ);
|
||||||
columns.add(new SurfaceLayerColumn(
|
columns.add(new SurfaceLayerColumn(
|
||||||
|
|||||||
+10
-5
@@ -1367,7 +1367,7 @@ public class HydrologyFootprintCompilerTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void surfaceHeadwaterTapersUpToChannelWidthWithoutARadialBasin() {
|
public void surfaceHeadwaterOpensAsASpringPoolThatNarrowsToTheChannel() {
|
||||||
HydraulicSegment segment = new HydraulicSegment(
|
HydraulicSegment segment = new HydraulicSegment(
|
||||||
521L,
|
521L,
|
||||||
520L,
|
520L,
|
||||||
@@ -1385,16 +1385,21 @@ public class HydrologyFootprintCompilerTest {
|
|||||||
HydrologyFootprintCompiler compiler = compiler(terrain);
|
HydrologyFootprintCompiler compiler = compiler(terrain);
|
||||||
RiverFootprint footprint = compiler.compile(List.of(course));
|
RiverFootprint footprint = compiler.compile(List.of(course));
|
||||||
|
|
||||||
assertTrue(surfaceFluidLayer(footprint, -4, 0) == null);
|
assertTrue(wetHalfWidth(footprint, 0) > wetHalfWidth(footprint, 32));
|
||||||
assertTrue(wetHalfWidth(footprint, 0) < wetHalfWidth(footprint, 32));
|
assertTrue(wetHalfWidth(footprint, 0) >= 2 * wetHalfWidth(footprint, 56));
|
||||||
assertTrue(wetHalfWidth(footprint, 32) <= wetHalfWidth(footprint, 56));
|
assertTrue(Math.abs(wetHalfWidth(footprint, 32) - wetHalfWidth(footprint, 56)) <= 1);
|
||||||
|
for (int x = 1; x <= 24; x++) {
|
||||||
|
assertTrue(wetHalfWidth(footprint, x) <= wetHalfWidth(footprint, x - 1) + 1);
|
||||||
|
}
|
||||||
HydrologyColumnLayer source = surfaceFluidLayer(footprint, 0, 0);
|
HydrologyColumnLayer source = surfaceFluidLayer(footprint, 0, 0);
|
||||||
HydrologyColumnLayer cruise = surfaceFluidLayer(footprint, 56, 0);
|
HydrologyColumnLayer cruise = surfaceFluidLayer(footprint, 56, 0);
|
||||||
assertTrue(source != null);
|
assertTrue(source != null);
|
||||||
assertTrue(cruise != null);
|
assertTrue(cruise != null);
|
||||||
|
assertTrue(source.feature().source());
|
||||||
|
assertFalse(surfaceFluidLayer(footprint, 0, 3).feature().source());
|
||||||
int sourceDepth = source.fluidHeadY() - source.bedY();
|
int sourceDepth = source.fluidHeadY() - source.bedY();
|
||||||
int cruiseDepth = cruise.fluidHeadY() - cruise.bedY();
|
int cruiseDepth = cruise.fluidHeadY() - cruise.bedY();
|
||||||
assertTrue(Math.abs(sourceDepth - cruiseDepth) <= 1);
|
assertTrue(sourceDepth >= cruiseDepth + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
+4
-2
@@ -74,9 +74,11 @@ public class HydrologyStyledGeometryTest {
|
|||||||
RiverCourse surface = courses(first, RiverCourseType.SURFACE).getFirst();
|
RiverCourse surface = courses(first, RiverCourseType.SURFACE).getFirst();
|
||||||
DrainageNode surfaceSource = first.node(surface.sourceNodeId().orElseThrow()).orElseThrow();
|
DrainageNode surfaceSource = first.node(surface.sourceNodeId().orElseThrow()).orElseThrow();
|
||||||
HydraulicSegment surfaceStart = surface.segments().getFirst();
|
HydraulicSegment surfaceStart = surface.segments().getFirst();
|
||||||
int maximumSurfaceWidth = surfaceSettings.surface().maximumWidth()
|
// The first segment carries the spring pool: wider by the spring ratio and one block deeper.
|
||||||
|
int maximumSurfaceWidth = (int) Math.ceil(surfaceSettings.surface().maximumWidth()
|
||||||
|
* surfaceSettings.surface().banks().springWidthRatio())
|
||||||
+ (surfaceStart.receivingPool() ? 2 : 0);
|
+ (surfaceStart.receivingPool() ? 2 : 0);
|
||||||
int maximumSurfaceDepth = surfaceSettings.surface().maximumDepth()
|
int maximumSurfaceDepth = surfaceSettings.surface().maximumDepth() + 1
|
||||||
+ (surfaceStart.receivingPool() ? 1 : 0);
|
+ (surfaceStart.receivingPool() ? 1 : 0);
|
||||||
assertTrue(surfaceStart.width() >= surfaceSettings.surface().minimumWidth());
|
assertTrue(surfaceStart.width() >= surfaceSettings.surface().minimumWidth());
|
||||||
assertTrue(surfaceStart.width() <= maximumSurfaceWidth);
|
assertTrue(surfaceStart.width() <= maximumSurfaceWidth);
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ public final class RiverTransectProbe {
|
|||||||
private static final int MAXIMUM_PLAN_COLUMNS = 6_000_000;
|
private static final int MAXIMUM_PLAN_COLUMNS = 6_000_000;
|
||||||
private static final int MAXIMUM_DETAILS = 16;
|
private static final int MAXIMUM_DETAILS = 16;
|
||||||
private static final int TABLE_HALF_SECTION = 16;
|
private static final int TABLE_HALF_SECTION = 16;
|
||||||
|
private static final int[] HEADWATER_SECTIONS = {0, 6, 12, 18, 24};
|
||||||
|
|
||||||
private RiverTransectProbe() {
|
private RiverTransectProbe() {
|
||||||
}
|
}
|
||||||
@@ -495,10 +496,14 @@ public final class RiverTransectProbe {
|
|||||||
IrisComplex complex,
|
IrisComplex complex,
|
||||||
IrisHydrologyRuntime runtime
|
IrisHydrologyRuntime runtime
|
||||||
) throws IOException {
|
) throws IOException {
|
||||||
int[] stations = sectionStations(centerline.size());
|
int[] spaced = sectionStations(centerline.size());
|
||||||
|
int[] stations = new int[HEADWATER_SECTIONS.length + spaced.length];
|
||||||
|
for (int index = 0; index < HEADWATER_SECTIONS.length; index++) {
|
||||||
|
stations[index] = Math.min(centerline.size() - 1, HEADWATER_SECTIONS[index]);
|
||||||
|
}
|
||||||
|
System.arraycopy(spaced, 0, stations, HEADWATER_SECTIONS.length, spaced.length);
|
||||||
StringBuilder text = new StringBuilder();
|
StringBuilder text = new StringBuilder();
|
||||||
for (int section = 0; section < SECTIONS; section++) {
|
for (int station : stations) {
|
||||||
int station = stations[section];
|
|
||||||
text.append("station ").append(station)
|
text.append("station ").append(station)
|
||||||
.append(" at ").append(centerline.x()[station]).append(',').append(centerline.z()[station])
|
.append(" at ").append(centerline.x()[station]).append(',').append(centerline.z()[station])
|
||||||
.append(" head=").append(column(complex, runtime, centerline.x()[station], centerline.z()[station]).water())
|
.append(" head=").append(column(complex, runtime, centerline.x()[station], centerline.z()[station]).water())
|
||||||
|
|||||||
Reference in New Issue
Block a user