rompy.swan.components.output.NGRID_UNSTRUCTURED#

pydantic model rompy.swan.components.output.NGRID_UNSTRUCTURED[source]#

Output locations for a nested grid.

NGRID 'sname' UNSTRUCTURED ->TRIANGLE|EASYMESH 'fname'

If the user wishes to carry out nested SWAN runs, a separate coarse-grid SWAN run is required. With this optional command NGRID, the user defines in the present coarse-grid run, a set of output locations along the boundary of the subsequent nested computational grid. The set of output locations thus defined is of the type NGRID.

With this option the user indicates that the subsequent nested grid is unstructured Only grids generated by Triangle and Easymesh are supported by SWAN.

Note

Command NESTOUT is required after this command NGRID to generate some data for the (subsequent) nested run.

Examples

In [1]: from rompy.swan.components.output import NGRID_UNSTRUCTURED

In [2]: loc = NGRID_UNSTRUCTURED(sname="outnest", kind="triangle", fname="ngrid.txt")

In [3]: print(loc.render())
NGRID sname='outnest' UNSTRUCTURED TRIANGLE fname='ngrid.txt'

Show JSON schema
{
   "title": "NGRID_UNSTRUCTURED",
   "description": "Output locations for a nested grid.\n\n.. code-block:: text\n\n    NGRID 'sname' UNSTRUCTURED ->TRIANGLE|EASYMESH 'fname'\n\nIf the user wishes to carry out nested SWAN runs, a separate coarse-grid SWAN run\nis required. With this optional command `NGRID`, the user defines in the present\ncoarse-grid run, a set of output locations along the boundary of the subsequent\nnested computational grid. The set of output locations thus defined is of the type\nNGRID.\n\nWith this option the user indicates that the subsequent nested grid is unstructured\nOnly grids generated by Triangle and Easymesh are supported by SWAN.\n\nNote\n----\nCommand `NESTOUT` is required after this command `NGRID` to generate some data for\nthe (subsequent) nested run.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import NGRID_UNSTRUCTURED\n    loc = NGRID_UNSTRUCTURED(sname=\"outnest\", kind=\"triangle\", fname=\"ngrid.txt\")\n    print(loc.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "ngrid_unstructured",
         "description": "Model type discriminator",
         "enum": [
            "ngrid_unstructured",
            "NGRID_UNSTRUCTURED"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "sname": {
         "description": "Name of the set of output locations defined by this command",
         "maxLength": 8,
         "title": "Sname",
         "type": "string"
      },
      "kind": {
         "anyOf": [
            {
               "enum": [
                  "triangle",
                  "easymesh"
               ],
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": "triangle",
         "description": "Indicate if nested grid is generated by Triangle or Easymesh. The base name of the grid specified in the `fname` parameter is used internally by SWAN to define the `.node` and `.ele` files in case of the former or the `.n` and `.e` files in case of the latter.",
         "title": "Kind"
      },
      "fname": {
         "description": "Basename of the required files, i.e. without extension",
         "maxLength": 32,
         "title": "Fname",
         "type": "string"
      }
   },
   "additionalProperties": false,
   "required": [
      "sname",
      "fname"
   ]
}

Fields:
Validators:

field fname: str [Required]#

Basename of the required files, i.e. without extension

Constraints:
  • max_length = 32

field kind: Literal['triangle', 'easymesh'] | None = 'triangle'#

Indicate if nested grid is generated by Triangle or Easymesh. The base name of the grid specified in the fname parameter is used internally by SWAN to define the .node and .ele files in case of the former or the .n and .e files in case of the latter.

field model_type: Literal['ngrid_unstructured', 'NGRID_UNSTRUCTURED'] = 'ngrid_unstructured'#

Model type discriminator

cmd() str[source]#

Command file string for this component.