Esempio n. 1
0
    public void GetIndexTest()
    {
      Model mshe = new Model(@"..\..\..\TestData\TestModelDemo.she");

      int Column;
      int Row;

      Assert.IsTrue(mshe.GridInfo.GetIndex(11,11,out Column, out Row));
      Assert.AreEqual(1, Column);
      Assert.AreEqual(1, Row);

      Assert.IsTrue(mshe.GridInfo.GetIndex(19, 19, out Column, out Row));
      Assert.AreEqual(1, Column);
      Assert.AreEqual(1, Row);

      mshe.Dispose();

      DFS3 heads = new DFS3(@"..\..\..\TestData\TestModelDemo.she - Result Files\TestModelDemo_3DSZ.dfs3");

      Assert.AreEqual(1, heads.GetColumnIndex(11));

      Assert.AreEqual(2, heads.GetColumnIndex(19));

      heads.Dispose();
      

    }
Esempio n. 2
0
        private void Initialize(string PreProcessed3dSzFile, string PreProcessed2dSzFile)
        {
            //Open File with 3D data
              _PreProcessed_3DSZ = new DFS3(PreProcessed3dSzFile);

              //Generate 3D properties
              for (int i = 0; i < _PreProcessed_3DSZ.ItemNames.Length; i++)
              {
            switch (_PreProcessed_3DSZ.ItemNames[i])
            {
              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.ItemNames.Length; i++)
              {
            switch (_prePro2D.ItemNames[i])
            {
              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);
        }
Esempio n. 3
0
 private void Initialize3DSZFlow(string sz3dFlowFile)
 {
     DFS3 SZ3DFlow = new DFS3(sz3dFlowFile);
       for (int i = 0; i < SZ3DFlow.ItemNames.Length; i++)
       {
     switch (SZ3DFlow.ItemNames[i])
     {
       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;
     }
       }
 }
Esempio n. 4
0
 /// <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);
       DeleteValue = SZ3D.DeleteValue;
       for (int i = 0; i < SZ3D.ItemNames.Length; i++)
       {
     if (SZ3D.ItemNames[i].Equals(HeadElevationString, StringComparison.OrdinalIgnoreCase))
     {
     _heads = new DataSetsFromDFS3(SZ3D, i + 1);
     //Also create the phreatic heads;
     _phreaticHead = new PhreaticPotential(_heads, _grid, SZ3D.DeleteValue);
     }
       }
 }