public static OneBlockModelSettings LoadOneBlockFromXml(string path) { var xdoc = XDocument.Load(path); var xsettings = xdoc.Element("ModelSettings"); var mesh = ReadMeshParameters(xsettings); var mb = ReadManualBoundaries(xsettings); var model = new OneBlockModelSettings(mesh, mb) .WithConductivity(xsettings.ElementAsDoubleOrNull("Conductivity") ?? -1) .WithAnomalyStartDepth(xsettings.ElementAsDecimal("AnomalyStartDepth")) .WithAnomalySizeX(xsettings.ElementAsDecimal("AnomalySizeX")) .WithAnomalySizeY(xsettings.ElementAsDecimal("AnomalySizeY")) .WithAnomalySizeZ(xsettings.ElementAsDecimal("AnomalySizeZ")); model.Section1D = ModelReader.LoadBackground(xsettings); return(model); }