Skip to content
/ simput Public
forked from Kitware/simput

Provide a simple way to write input simulation files.

License

Notifications You must be signed in to change notification settings

nloppi/simput

 
 

Repository files navigation

Simput

Goal

To provide a simple way to write input simpulation files.

Installation

$ npm install -g simput

Usage

After installing the package you will get one executable Simput with the following set of options:

$ Simput

  Usage: Simput [options]

  Options:

    -h, --help                    output usage information
    -V, --version                 output the version number

    -i, --input [file|directory]  Input file or directory
    -o, --output [directory]      Output directory to output to
    -t, --type [type]             Type of input

    --no-gui                      Just generate output
    -s, --silent                  Do not open the browser

    -c, --compile [directory]     Directory to compile files
    -m, --minify                  Minify compiled file
    -a, --add [file]              Add model to list of available inputs
    -l, --list                    List model types of available as inputs
    -r, --remove [type]           Remove model to list of available inputs

Examples

$ Simput -t pyfr -o ~/pyfr/example

Starts a server and opens your web browser, an empty PyFR model is loaded which you can modify. The Save button will export a pyfr.json file (model) which you can then be loaded later on. The Convert button will export a pyfr.ini file for PyFR execution.

As no initial model was provided, the boundary names will be autogenerated. In order to pre-define those boundary names, you can either edit the generated model (pyfr.json) or start with an empty model you've created like the following one.

my-pyfr-model.json

{
    "type": "pyfr",
    "data": {},
    "external": {
        "boundary-names": {
            "User friendly name": "value-expected-by-code",
            "Inlet": "inlet",
            "Outlet": "outlet",
            "External walls": "external-wall"
        }
    }
}

Then loading it back for further edits can be performed with the following command line:

$ Simput -i my-pyfr-model.json -o ~/pyfr/example

Demos

There are a few supplied demos in the folder types, each have their own README.

Development

$ git clone --recursive https://github.com/Kitware/simput.git
$ cd simput
$ npm install
$ npm run build
$ npm link
$ Simput

  Usage: Simput [options]

  Options:

    -h, --help                    output usage information
    -V, --version                 output the version number

    -i, --input [file|directory]  Input file or directory
    -o, --output [directory]      Output directory to output to
    -t, --type [type]             Type of input

    --no-gui                      Just generate output
    -s, --silent                  Do not open the browser

    -c, --compile [directory]     Directory to compile files
    -m, --minify                  Minify compiled file
    -a, --add [file]              Add model to list of available inputs
    -l, --list                    List model types of available as inputs
    -r, --remove [type]           Remove model to list of available inputs

Then to compile pyfr and publish it:

$ Simput -mc types/pyfr/src/ -t pyfr -o dist/types/

Degbugging

A recent version Firefox is preferred for debugging. Errors in Chrome do not always point to the exact line where the error is happening.

Licensing

Simput is licensed under BSD Clause 3.

Getting Involved

Fork our repository and do great things. At Kitware, we've been contributing to open-source software for 15 years and counting, and want to make Simput useful to as many people as possible.

About

Provide a simple way to write input simulation files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.7%
  • Other 0.3%