Skip to content

FAQ/ Introduction to DioVISTA Batch Processing

Can you tell us the basics of DioVISTA batch processing?

When I read the technical reference Batch processing / overview, I couldn't do it well.
Could you teach me how to do it from the beginning?

response

I created a tutorial.
Could you follow the steps below to get an overview?

preparation

  1. Prepare a PC that runs DioVISTA.
  2. Obtain a project project_Tsurumi.zip for the exercises .

    • Deploy to a suitable location
    • In this case,C:\temp\ suppose you expand to
    • C:\temp\ Screen with the project expanded to
  3. Verify that the project for the exercise can be simulated in DioVISTA.

    • In DioVISTA, open Project Files [鶴見.fsxproj] .
    • Press the Start Simulation button
    • verify that the results in the figure below are displayed
    • Screen running in DioVISTA [鶴見.fsxproj]
  4. Prepare to run PowerShell.

Setting variables

  1. wt Launch

  2. Store the path of the DioVISTA executable in a variable.

    • In this case,C:\Program Files\Hitachi\DioVISTA Flood\bin it is installed in
    • Copy and paste the following two lines of text one line at a time wt into
    1
    2
    $exe = "C:\Program Files\Hitachi\DioVISTA Flood\bin\dfsCalc64.exe"
    &$exe --version
    
    • verify that the build number is displayed
    • example
    1
    Build 2021-11-01 19:34:14 +0900 (0ea5431acb3bad3a7b4d5a35b9bc1f470b597f29)
    
  3. Stores the path of the DioVISTA data translator in a variable.

    • Copy and paste the following string wt into .
    1
    2
    $conv = "C:\Program Files\Hitachi\DioVISTA Flood\bin\dfsConv64.exe"
    dir $conv
    
    Source Code Explanation
    • Two-line name: dir The command is almost identical to the dir DOS command and Linux command ls . This is another name for Get-ChildItem.
    • Verify that the file information (for dfsConv64 .exe) is displayed.
    • example

      1
      2
      3
      4
      5
          Directory: C:\Program Files\Hitachi\DioVISTA Flood\bin
      
      Mode                 LastWriteTime         Length Name
      ----                 -------------         ------ ----
      -a---          2021/06/17    21:34         323160 dfsConv64.exe
      
  4. Store the path of the DioVISTA configuration file in a variable.

    • Copy and paste the following string wt into .
    1
    2
    3
    [xml]$xml = cat "$env:LOCALAPPDATA\hitachi\DioVISTA\DioVISTA.xml"
    $d = $xml.Configuration.settings.dataset
    dir $d
    
    Source Code Explanation
    • Single line name: cat The command is almost identical to the type DOS command and Linux command cat . This is another name for Get-Content.
    • Line 1: is the same as the $env:LOCALAPPDATA DOS environment variable %LOCALAPPDATA% . In other words, we are loading a file %LOCALAPPDATA%\hitachi\DioVISTA\DioVISTA.xml . Reference: FAQ/ Dataset file path
    • Line 2: Storing the xml element Configuration.settings.dataset in a variable $d .
    • Verify that the file information (about dataset.ini) is displayed.
    • example

      1
      2
      3
      4
      5
          Directory: D:\mapdata
      
      Mode                 LastWriteTime         Length Name
      ----                 -------------         ------ ----
      -a---          2019/11/07    17:30            408 dataset.ini
      

Basic Commands

  1. You must have performed the Set Variables described above .

  2. Run DioVISTA.

    • Copy and paste the following string wt into
    1
    2
    cd C:\temp
    &$exe -d $d -m 25 -o BP001 -O . -I 300 -t 36000 鶴見.fsxproj
    
    Source Code Explanation
    • The calculation is performed.
    • Check the calculation result BP001 on the DioVISTA screen.
  3. Convert DioVISTA result files to MLIT format.

    • Copy and paste the following string wt into
    1
    &$conv csv -d 40 -s $d -G  -o . BP001
    
    Source Code Explanation
    • Verify that the MLIT-formatted CSV file C:\temp\BP001 has been output to .

    Note

    You will get the following warning about the absence of C:\temp\ and in the METADATA.CSV folder KENSAKU\WL_STATION.CSV , but the resulting CSV file will be output.

    1
    2
    .\METADATA.CSV: ファイルがオープンできません
    .\KENSAKU\WL_STATION.CSV: ファイルがオープンできません
    

Advanced Commands

  1. You must have performed the Set Variables described above .
  2. Change the upstream flow of the Tsurumi River to the [tsurumi_q_ts.csv] time series stored in .

    • Copy and paste the following string wt into .
    1
    2
    3
    4
    5
    6
    $csv = cat tsurumi_q_ts.csv
    $inflow="{0} {1}" -f $csv.Length, (($csv -split "," ) -join " ")
    [xml]$xml = cat 鶴見.fsxproj
    $river = $xml.floodSim.conditions.diffusionalRivers.diffusionalRiver |where{$_.name -eq "鶴見川"}
    $river.inflow = $inflow
    $xml.Save("C:\temp\鶴見川2500.fsxproj")
    
    Code Explanation
    • Line 1: Store [tsurumi_q_ts.csv] the contents of the variable $csv .
    • Converts the contents of the second line $csv : to the format used in the DioVISTA project file (fsxproj) and $inflow stores it in a variable. -f is the Format operator.
    • Line 3: Store [鶴見.fsxproj] the contents of the variable $xml
    • Line 4: There are multiple [鶴見.fsxproj] xml elements floodSim.conditions.diffusionalRivers.diffusionalRiver in it , but we name extract the element whose attribute equals "Tsurumigawa" and $river store it in a variable. where is another name for Where-Object.
    • Line 5: Replace the contents of the XML element showing the upstream flow of the Tsurumi River inflow with the content created in line 2.
    • Line 6: Save the edited contents as the file "C:\temp\Tsurumigawa 2500.fsxproj". Here, specify the full path of the file to be saved.
    • Open Project Files in DioVISTA [鶴み川2500.fsxproj] .
    • Verify that the upstream flow of the Tsurumi River[tsurumi_q_ts.csv] is in the time series stored in .
  3. Change the breach point information of the Tsurumi River.

    • Copy and paste the following string wt into
    1
    2
    3
    4
    5
    6
    [xml]$xml = cat 鶴見.fsxproj
    $river = $xml.floodSim.conditions.diffusionalRivers.diffusionalRiver |where{$_.name -eq "鶴見川"}
    $breach = $river.riverBreaches.riverBreach|where{$_.name -eq "鶴見川_破堤箇所1"}
    $breach.name = "BP002"
    $breach.distance = "5000"
    $xml.Save("C:\temp\BP002.fsxproj")
    
    Code Explanation
    • Line 1: Store [鶴見.fsxproj] the contents of the variable $xml .
    • In the second line: [鶴見.fsxproj] there are multiple xml elements floodSim.conditions.diffusionalRivers.diffusionalRiver , of which the attribute name equals "Tsurumigawa" is extracted and $river stored in a variable.
    • Line 3: There are several child elements of riverBreaches.riverBreach Tsurumi River , but we extract the element whose attribute name equals "Tsurumi River_Break Point 1" and $breach store it in the variable .
    • Line 4: Replace the contents of the xml element indicating "Tsurumi River_Breakpoint 1name" with "BP002".
    • Line 5: Replace the contents of the xml element indicating "Tsurumi River_Breakage 1distance" with "5000".
    • Line 6: Save the edited content as the file "C:\temp\BP002.fsxproj".
    • Open Project Files in DioVISTA [BP002.fsxproj] .
    • Make sure that the name of the break point of the Tsurumi River [BP002] is and the distance [5000] is .

At last

  1. In a series of tutorials, you experienced running project files, converting result files, rewriting project files, and creating script files. Modify or combine these as needed by the user.

  2. DioVISTA checks for outliers when the user enters through the screen (for example, if you try to give a roughness of 0, it will be rejected). In this way, when editing the project file (fsxproj) without going through the screen, outlier values are not checked. When editing, be aware of outliers.


Last update: 2023-03-20