Index: DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DamEngineIo/FillXmlInputFromDamUiTests.cs
===================================================================
diff -u -r6758 -r6776
--- DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DamEngineIo/FillXmlInputFromDamUiTests.cs (.../FillXmlInputFromDamUiTests.cs) (revision 6758)
+++ DamClients/DamUI/trunk/src/Dam/Deltares.Dam.Tests/DamEngineIo/FillXmlInputFromDamUiTests.cs (.../FillXmlInputFromDamUiTests.cs) (revision 6776)
@@ -73,7 +73,6 @@
// Load input file
Input actualInput = DamXmlSerialization.LoadInputFromXmlFile(inputFilename);
DamProjectData actualDamProjectData = FillDamUiFromXmlInput.CreateDamProjectData(actualInput);
- CompareSoilLists(actualDamProjectData.WaterBoard.Dikes[0].SoilList, expectedDamProjectData.WaterBoard.Dikes[0].SoilList);
CompareDamProjectData(actualDamProjectData, expectedDamProjectData);
// The soil profiles 2D are not present in the expectedDamProjectData because they are created when calling
// FillXmlInputFromDamUi.CreateInput. That's why they must be checked separately from the Input object.
@@ -678,37 +677,6 @@
Assert.That(() => FillXmlInputFromDamUi.CreateInput(damProjectData), Throws.TypeOf(typeof(ArgumentNullException)).With.Message.EqualTo(expectedMessage));
}
- /// Compares the soil lists.
- /// The object comparer does not handle NaN's correctly, therefore this method is created.
- /// The actual soil list.
- /// The expected soil list.
- private void CompareSoilLists(SoilList actualSoilList, SoilList expectedSoilList)
- {
- const string errorMessage = "Actual and expected values of {0} are not equal";
- foreach (Soil actualSoil in actualSoilList.Soils)
- {
- Soil expectedSoil = expectedSoilList.GetSoilByName(actualSoil.Name);
- Assert.That(actualSoil.AbovePhreaticLevel, Is.EqualTo(expectedSoil.AbovePhreaticLevel), string.Format(errorMessage, "AbovePhreaticLevel"));
- Assert.That(actualSoil.BelowPhreaticLevel, Is.EqualTo(expectedSoil.BelowPhreaticLevel), string.Format(errorMessage, "BelowPhreaticLevel"));
- Assert.That(actualSoil.DryUnitWeight, Is.EqualTo(expectedSoil.DryUnitWeight), string.Format(errorMessage, "DryUnitWeight"));
- Assert.That(actualSoil.BeddingAngle, Is.EqualTo(expectedSoil.BeddingAngle), string.Format(errorMessage, "BeddingAngle"));
- Assert.That(actualSoil.DiameterD70, Is.EqualTo(expectedSoil.DiameterD70), string.Format(errorMessage, "DiameterD70"));
- Assert.That(actualSoil.DiameterD90, Is.EqualTo(expectedSoil.DiameterD90), string.Format(errorMessage, "DiameterD90"));
- Assert.That(actualSoil.PermeabKx, Is.EqualTo(expectedSoil.PermeabKx), string.Format(errorMessage, "PermeabKx"));
- Assert.That(actualSoil.WhitesConstant, Is.EqualTo(expectedSoil.WhitesConstant), string.Format(errorMessage, "WhitesConstant"));
- Assert.That(actualSoil.ShearStrengthModel, Is.EqualTo(expectedSoil.ShearStrengthModel), string.Format(errorMessage, "ShearStrengthModel"));
- Assert.That(actualSoil.UseDefaultShearStrengthModel, Is.EqualTo(expectedSoil.UseDefaultShearStrengthModel), string.Format(errorMessage, "UseDefaultShearStrengthModel"));
- Assert.That(actualSoil.Cohesion, Is.EqualTo(expectedSoil.Cohesion), string.Format(errorMessage, "Cohesion"));
- Assert.That(actualSoil.FrictionAngle, Is.EqualTo(expectedSoil.FrictionAngle), string.Format(errorMessage, "FrictionAngle"));
- Assert.That(actualSoil.OCR, Is.EqualTo(expectedSoil.OCR), string.Format(errorMessage, "OCR"));
- Assert.That(actualSoil.RestSlope, Is.EqualTo(expectedSoil.RestSlope), string.Format(errorMessage, "RestSlope"));
- Assert.That(actualSoil.DilatancyType, Is.EqualTo(expectedSoil.DilatancyType), string.Format(errorMessage, "DilatancyType"));
- Assert.That(actualSoil.StrengthIncreaseExponent, Is.EqualTo(expectedSoil.StrengthIncreaseExponent), string.Format(errorMessage, "StrengthIncreaseExponent"));
- Assert.That(actualSoil.RRatio, Is.EqualTo(expectedSoil.RRatio), string.Format(errorMessage, "RRatio"));
- Assert.That(actualSoil.RatioCuPc, Is.EqualTo(expectedSoil.RatioCuPc), string.Format(errorMessage, "RatioCuPc"));
- }
- }
-
private static void CompareSoilProfiles2D(SoilProfile2D[] actual, SoilProfile2D[] expected)
{
var compare = new CompareLogic
@@ -848,24 +816,10 @@
FillInputTimeSeries(damProjectData);
FillSensorData(damProjectData);
- FillTrafficLoadDegreeOfConsolidation(dike);
return damProjectData;
}
+
- private static void FillTrafficLoadDegreeOfConsolidation(Dike dike)
- {
- dike.TrafficLoadDegreeOfConsolidations = new List();
- for (var i = 0; i < dike.SoilList.Soils.Count; i++)
- {
- var loadDegreeOfConsolidation = new TrafficLoadDegreeOfConsolidation
- {
- DegreeOfConsolidation = i * 3,
- SoilName = dike.SoilList.Soils[i].Name
- };
- dike.TrafficLoadDegreeOfConsolidations.Add(loadDegreeOfConsolidation);
- }
- }
-
private void FillSensorData(DamProjectData damProjectData)
{
// Note: the properties SensorLocations, Sensors and SensorGroups of SensorData are automatically created
@@ -1038,9 +992,10 @@
{
const int soilCount = 3;
dike.SoilList = new SoilList();
+ dike.DamSoils = [];
for (var i = 0; i < soilCount; i++)
{
- var soil = new Soil
+ var soil = new DamSoil
{
Name = $"Soil {i}"
};
@@ -1057,11 +1012,12 @@
soil.StrengthIncreaseExponent = 28 + 0.1 * i;
soil.RatioCuPc = 29 + 0.1 * i;
- dike.SoilList.Add(soil);
+ dike.AddDamSoil(soil);
+ dike.DamSoils.Last().TrafficLoadDegreeOfConsolidation = 30 + 0.1 * i;
}
// Change 1 soil to ShearStrengthModel.StressTable (SigmaTauCurve)
- Soil soilSigmaTauCurve = dike.SoilList.Soils[1];
+ DamSoil soilSigmaTauCurve = dike.DamSoils[1];
soilSigmaTauCurve.ShearStrengthModel = ShearStrengthModel.StressTable;
soilSigmaTauCurve.StressTable = new StressCurve();
soilSigmaTauCurve.StressTable.SigmaTaus.Add(new SigmaTau
@@ -1076,7 +1032,7 @@
});
// Change 1 soil to ShearStrengthModel.SuTable
- Soil soilSuTable = dike.SoilList.Soils[2];
+ DamSoil soilSuTable = dike.DamSoils[2];
soilSuTable.ShearStrengthModel = ShearStrengthModel.SuTable;
soilSuTable.SuTable = new SigmaSuCurve();
soilSuTable.SuTable.SigmaSus.Add(new SigmaSu
@@ -1091,22 +1047,24 @@
});
// Add dike embankment material
- var dikeSoil = new Soil
+ var dikeSoil = new DamSoil
{
Name = dikeEmbankmentMaterial,
UseDefaultShearStrengthModel = false
};
- dike.SoilList.Add(dikeSoil);
+ dike.AddDamSoil(dikeSoil);
+ dike.DamSoils.Last().TrafficLoadDegreeOfConsolidation = 31.1;
// Add shoulder embankment materials
for (var i = 0; i < locationCount; i++)
{
- var shoulderSoil = new Soil
+ var shoulderSoil = new DamSoil
{
Name = shoulderEmbankmentMaterial + (i + 1),
UseDefaultShearStrengthModel = false
};
- dike.SoilList.Add(shoulderSoil);
+ dike.AddDamSoil(shoulderSoil);
+ dike.DamSoils.Last().TrafficLoadDegreeOfConsolidation = 32.2;
}
}