rompy.swan.components.output.CURVES#

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

Output locations along multiple curves.

CURVE 'sname1' [xp1] [yp1] < [int] [xp] [yp] >
CURVE 'sname2' [xp1] [yp1] < [int] [xp] [yp] >
..

This component can be used to prescribe and render multiple CURVE components.

Examples

In [1]: from rompy.swan.components.output import CURVE, CURVES

In [2]: loc1 = CURVE(
   ...:     sname="c1", xp1=7, yp1=-40, npts=[3, 3], xp=[7, 9], yp=[-38, -38],
   ...: )
   ...: 

In [3]: loc2 = CURVE(
   ...:     sname="c2", xp1=3, yp1=-37, npts=[5, 5], xp=[4, 5], yp=[-37, -36],
   ...: )
   ...: 

In [4]: locs = CURVES(curves=[loc1, loc2])

In [5]: print(locs.render())
CURVE sname='c1' xp1=7.0 yp1=-40.0 &
    int=3 xp=7.0 yp=-38.0 &
    int=3 xp=9.0 yp=-38.0
CURVE sname='c2' xp1=3.0 yp1=-37.0 &
    int=5 xp=4.0 yp=-37.0 &
    int=5 xp=5.0 yp=-36.0

Show JSON schema
{
   "title": "CURVES",
   "description": "Output locations along multiple curves.\n\n.. code-block:: text\n\n    CURVE 'sname1' [xp1] [yp1] < [int] [xp] [yp] >\n    CURVE 'sname2' [xp1] [yp1] < [int] [xp] [yp] >\n    ..\n\nThis component can be used to prescribe and render multiple CURVE components.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import CURVE, CURVES\n    loc1 = CURVE(\n        sname=\"c1\", xp1=7, yp1=-40, npts=[3, 3], xp=[7, 9], yp=[-38, -38],\n    )\n    loc2 = CURVE(\n        sname=\"c2\", xp1=3, yp1=-37, npts=[5, 5], xp=[4, 5], yp=[-37, -36],\n    )\n    locs = CURVES(curves=[loc1, loc2])\n    print(locs.render())",
   "type": "object",
   "properties": {
      "model_type": {
         "default": "curves",
         "description": "Model type discriminator",
         "enum": [
            "curves",
            "CURVES"
         ],
         "title": "Model Type",
         "type": "string"
      },
      "curves": {
         "description": "CURVE components",
         "items": {
            "$ref": "#/$defs/CURVE"
         },
         "title": "Curves",
         "type": "array"
      }
   },
   "$defs": {
      "CURVE": {
         "additionalProperties": false,
         "description": "Output locations along a curve.\n\n.. code-block:: text\n\n    CURVE 'sname' [xp1] [yp1] < [int] [xp] [yp] >\n\nWith this optional command the user defines output along a curved line. Actually\nthis curve is a broken line, defined by the user with its corner points. The values\nof the output quantities along the curve are interpolated from the computational\ngrid. This command may be used more than once to define more curves.\n\nNote\n----\nThe following pre-defined curves are available and could be used instead of a CURVE\ncomponent: 'BOUNDARY' and `BOUND_0N` where `N` is boundary part number.\n\nNote\n----\nAll coordinates and distances should be given in m when Cartesian coordinates are\nused or degrees when Spherical coordinates are used (see command COORD).\n\nNote\n----\nRepeat the group `< int xp yp` > in proper order if there are more corner points\non the curve.\n\nExamples\n--------\n\n.. ipython:: python\n    :okwarning:\n\n    from rompy.swan.components.output import CURVE\n    loc = CURVE(\n        sname=\"outcurve\",\n        xp1=172,\n        yp1=-40,\n        npts=[3, 3],\n        xp=[172.0, 174.0],\n        yp=[-38.0, -38.0],\n    )\n    print(loc.render())",
         "properties": {
            "model_type": {
               "default": "curve",
               "description": "Model type discriminator",
               "enum": [
                  "curve",
                  "CURVE"
               ],
               "title": "Model Type",
               "type": "string"
            },
            "sname": {
               "description": "Name of the set of output locations defined by this command",
               "maxLength": 8,
               "title": "Sname",
               "type": "string"
            },
            "xp1": {
               "description": "Problem coordinate of the first point of the curve in the x-direction",
               "title": "Xp1",
               "type": "number"
            },
            "yp1": {
               "description": "Problem coordinate of the first point of the curve in the y-direction",
               "title": "Yp1",
               "type": "number"
            },
            "npts": {
               "description": "The `int` CURVE parameter, SWAN will generate `npts-1` equidistant locations between two subsequent corner points of the curve including the two corner points",
               "items": {
                  "type": "integer"
               },
               "minItems": 1,
               "title": "Npts",
               "type": "array"
            },
            "xp": {
               "description": "problem coordinates of a corner point of the curve in the x-direction",
               "items": {
                  "type": "number"
               },
               "minItems": 1,
               "title": "Xp",
               "type": "array"
            },
            "yp": {
               "description": "problem coordinates of a corner point of the curve in the y-direction",
               "items": {
                  "type": "number"
               },
               "minItems": 1,
               "title": "Yp",
               "type": "array"
            }
         },
         "required": [
            "sname",
            "xp1",
            "yp1",
            "npts",
            "xp",
            "yp"
         ],
         "title": "CURVE",
         "type": "object"
      }
   },
   "additionalProperties": false,
   "required": [
      "curves"
   ]
}

Fields:
field curves: list[CURVE] [Required]#

CURVE components

field model_type: Literal['curves', 'CURVES'] = 'curves'#

Model type discriminator

cmd() list[str][source]#

Return the string or list of strings to render the component to the CMD.

property sname: list[str]#