private void Initialize(string PreProcessed3dSzFile, string PreProcessed2dSzFile) { //Open File with 3D data if (System.IO.File.Exists(PreProcessed3dSzFile)) { _PreProcessed_3DSZ = new DFS3(PreProcessed3dSzFile); //Generate 3D properties for (int i = 0; i < _PreProcessed_3DSZ.Items.Length; i++) { switch (_PreProcessed_3DSZ.Items[i].Name) { case "Horizontal conductivity in the saturated zone": _horizontalConductivity = new DataSetsFromDFS3(_PreProcessed_3DSZ, i + 1); break; case "Vertical conductivity in the saturated zone": _verticalConductivity = new DataSetsFromDFS3(_PreProcessed_3DSZ, i + 1); break; case "Transmissivity in the saturated zone": _transmissivity = new DataSetsFromDFS3(_PreProcessed_3DSZ, i + 1); break; case "Specific yield in the saturated zone": _specificYield = new DataSetsFromDFS3(_PreProcessed_3DSZ, i + 1); break; case "Specific storage in the saturated zone": _specificStorage = new DataSetsFromDFS3(_PreProcessed_3DSZ, i + 1); break; case "Initial potential heads in the saturated zone": _initialHeads = new DataSetsFromDFS3(_PreProcessed_3DSZ, i + 1); break; default: //Unknown item break; } } } //Open File with 2D data _prePro2D = new DFS2(PreProcessed2dSzFile); //Generate 2D properties by looping the items for (int i = 0; i < _prePro2D.Items.Length; i++) { switch (_prePro2D.Items[i].Name) { case "Net Rainfall Fraction": _netRainFallFraction = new DataSetsFromDFS2(_prePro2D, i +1); break; case "Infiltration Fraction": _infiltrationFraction = new DataSetsFromDFS2(_prePro2D, i +1); break; default: //Unknown item break; } } //Now construct the grid from the open files _grid = new MikeSheGridInfo(_PreProcessed_3DSZ, _prePro2D); }
private void Initialize3DSZFlow(string sz3dFlowFile) { DFS3 SZ3DFlow = new DFS3(sz3dFlowFile); if (SZ3DFlow != null) { for (int i = 0; i < SZ3DFlow.Items.Length; i++) { switch (SZ3DFlow.Items[i].Name) { case "groundwater flow in x-direction": _xflow = new DataSetsFromDFS3(SZ3DFlow, i + 1); break; case "groundwater flow in y-direction": _yflow = new DataSetsFromDFS3(SZ3DFlow, i + 1); break; case "groundwater flow in z-direction": _zflow = new DataSetsFromDFS3(SZ3DFlow, i + 1); break; case "groundwater extraction": _groundWaterExtraction = new DataSetsFromDFS3(SZ3DFlow, i + 1); break; case "SZ exchange flow with river": _sZExchangeFlowWithRiver = new DataSetsFromDFS3(SZ3DFlow, i + 1); break; case "SZ drainage flow from point": _sZDrainageFlow = new DataSetsFromDFS3(SZ3DFlow, i + 1); break; default: break; } } } }
/// <summary> /// Opens the necessary dfs-files and sets up the references to the properties /// </summary> /// <param name="fileNames"></param> private void Initialize3DSZ(string sz3dFile) { SZ3D = new DFS3(sz3dFile); if (SZ3D != null) { DeleteValue = SZ3D.DeleteValue; for (int i = 0; i < SZ3D.Items.Length; i++) { if (SZ3D.Items[i].Name.Equals(HeadElevationString, StringComparison.OrdinalIgnoreCase)) { _heads = new DataSetsFromDFS3(SZ3D, i + 1); //Also create the phreatic heads; _phreaticHead = new PhreaticPotential(_heads, _grid, SZ3D.DeleteValue); } } } }