rompy.swan.components.output.CURVE#
- pydantic model rompy.swan.components.output.CURVE[source]#
Output locations along a curve.
CURVE 'sname' [xp1] [yp1] < [int] [xp] [yp] >
With this optional command the user defines output along a curved line. Actually this curve is a broken line, defined by the user with its corner points. The values of the output quantities along the curve are interpolated from the computational grid. This command may be used more than once to define more curves.
Note
The following pre-defined curves are available and could be used instead of a CURVE component: ‘BOUNDARY’ and BOUND_0N where N is boundary part number.
Note
All coordinates and distances should be given in m when Cartesian coordinates are used or degrees when Spherical coordinates are used (see command COORD).
Note
Repeat the group < int xp yp > in proper order if there are more corner points on the curve.
Examples
In [1]: from rompy.swan.components.output import CURVE In [2]: loc = CURVE( ...: sname="outcurve", ...: xp1=172, ...: yp1=-40, ...: npts=[3, 3], ...: xp=[172.0, 174.0], ...: yp=[-38.0, -38.0], ...: ) ...: In [3]: print(loc.render()) CURVE sname='outcurve' xp1=172.0 yp1=-40.0 & int=3 xp=172.0 yp=-38.0 & int=3 xp=174.0 yp=-38.0
Show JSON schema
{ "title": "CURVE", "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())", "type": "object", "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" } }, "additionalProperties": false, "required": [ "sname", "xp1", "yp1", "npts", "xp", "yp" ] }
- Fields:
- Validators:
ensure_equal_size
»all fields
- field model_type: Literal['curve', 'CURVE'] = 'curve'#
Model type discriminator
- Validated by:
- field npts: list[int] [Required]#
The int CURVE parameter, SWAN will generate npts-1 equidistant locations between two subsequent corner points of the curve including the two corner points
- Constraints:
min_length = 1
- Validated by:
- field xp: list[float] [Required]#
problem coordinates of a corner point of the curve in the x-direction
- Constraints:
min_length = 1
- Validated by:
- field xp1: float [Required]#
Problem coordinate of the first point of the curve in the x-direction
- Validated by:
- field yp: list[float] [Required]#
problem coordinates of a corner point of the curve in the y-direction
- Constraints:
min_length = 1
- Validated by:
- field yp1: float [Required]#
Problem coordinate of the first point of the curve in the y-direction
- Validated by: