Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/PhreaticLine.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/PhreaticLine.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/PhreaticLine.cs (revision 2022) @@ -0,0 +1,44 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of the Dam Engine. +// +// The Dam Engine is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.ComponentModel; +using System.Xml.Serialization; + +namespace Deltares.DamEngine.Data.Geometry +{ + /// + /// Phreatic line object + /// As part of a waternet. + /// + [TypeConverter(typeof(ExpandableObjectConverter))] + public class PhreaticLine : GeometryPointString + { + /// + /// Gets or sets the waternet. + /// + /// + /// The waternet. + /// + [XmlIgnore] + public Waternet Waternet { get; set; } + + } +} \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityIoTests.cs =================================================================== diff -u -r2020 -r2022 --- DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityIoTests.cs (.../MacroStabilityIoTests.cs) (revision 2020) +++ DamEngine/trunk/src/Deltares.DamEngine.Calculators.Tests/KernelWrappers/MacroStabilityCommon/MacroStabilityIoTests.cs (.../MacroStabilityIoTests.cs) (revision 2022) @@ -25,7 +25,6 @@ using NUnit.Framework; using Deltares.MacroStability.Kernel; using Deltares.DamEngine.Data.General; -using Deltares.DamEngine.TestHelpers; using Deltares.DamEngine.Calculators.KernelWrappers.MacroStabilityCommon.MacroStabilityIo; using Deltares.DamEngine.Data.Geotechnics; using Deltares.DamEngine.TestHelpers.Factories; Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/HeadLine.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/HeadLine.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/HeadLine.cs (revision 2022) @@ -0,0 +1,32 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of the Dam Engine. +// +// The Dam Engine is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + + +namespace Deltares.DamEngine.Data.Geometry +{ + /// + /// Headline + /// + public class HeadLine : GeometryPointString + { + + } +} \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/WaternetLine.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/WaternetLine.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/WaternetLine.cs (revision 2022) @@ -0,0 +1,40 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of the Dam Engine. +// +// The Dam Engine is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Xml.Serialization; + +namespace Deltares.DamEngine.Data.Geometry +{ + /// + /// Waterline data class + /// + public class WaternetLine : GeometryPointString + { + /// + /// Gets or sets the head line. + /// + /// + /// The head line. + /// + [XmlElement("AssociatedHeadLine")] + public GeometryPointString HeadLine { get; set; } + } +} \ No newline at end of file Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Deltares.DamEngine.Data.csproj =================================================================== diff -u -r1732 -r2022 --- DamEngine/trunk/src/Deltares.DamEngine.Data/Deltares.DamEngine.Data.csproj (.../Deltares.DamEngine.Data.csproj) (revision 1732) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Deltares.DamEngine.Data.csproj (.../Deltares.DamEngine.Data.csproj) (revision 2022) @@ -118,11 +118,15 @@ + + + + Index: DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/Waternet.cs =================================================================== diff -u --- DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/Waternet.cs (revision 0) +++ DamEngine/trunk/src/Deltares.DamEngine.Data/Geometry/Waternet.cs (revision 2022) @@ -0,0 +1,151 @@ +// Copyright (C) Stichting Deltares 2019. All rights reserved. +// +// This file is part of the Dam Engine. +// +// The Dam Engine is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Collections.Generic; +using System.Xml.Serialization; + +namespace Deltares.DamEngine.Data.Geometry +{ + /// + /// Class holding the waternet. + /// + public class Waternet : GeometryObject + { + private readonly List headLineList = new List(); + private PhreaticLine phreaticLine; + private double unitWeight = GeometryConstants.VolumicWeightOfWater; + private readonly List waternetLineList = new List(); + + /// + /// Initializes a new instance of the class. + /// + public Waternet() + { + IsGenerated = false; + } + + /// + /// Gets or sets the phreatic line. + /// + /// + /// The phreatic line. + /// + public PhreaticLine PhreaticLine + { + get + { + return phreaticLine; + } + set + { + phreaticLine = value; + if (phreaticLine != null) + { + if (phreaticLine.Points.Count == 0 && phreaticLine.CalcPoints.Count > 0) + phreaticLine.SyncPoints(); + phreaticLine.Waternet = this; + } + } + } + + /// + /// Gets the head line list. + /// + /// + /// The head line list. + /// + [XmlArray("HeadLines")] + public List HeadLineList + { + get + { + return headLineList; + } + } + + /// + /// Gets the waternet line list. + /// + /// + /// The waternet line list. + /// + [XmlArray("WaternetLines")] + public List WaternetLineList + { + get + { + return waternetLineList; + } + } + + /// + /// Gets or sets the unit weight. + /// + /// + /// The unit weight. + /// + public double UnitWeight + { + get + { + return unitWeight; + } + set + { + unitWeight = value; + } + } + + /// + /// Gets or sets a value indicating whether this instance is generated. + /// + /// + /// true if this instance is generated; otherwise, false. + /// + public bool IsGenerated { get; set; } + + /// + /// The water level of the phreatic line at the left side + /// + public double ExternalWaterLevel + { + get + { + if (PhreaticLine != null) + return PhreaticLine.CalcPoints[0].Z; + return 0.0; + } + } + + /// + /// Adds the waternet line. + /// + /// A waternet line. + public void AddWaternetLine(WaternetLine aWaternetLine) + { + if (!WaternetLineList.Contains(aWaternetLine)) + { + aWaternetLine.SyncPoints(); + WaternetLineList.Add(aWaternetLine); + } + } + } +} \ No newline at end of file