rompy.swan.subcomponents.readgrid.GRIDREGULAR#

pydantic model rompy.swan.subcomponents.readgrid.GRIDREGULAR[source]#

SWAN Regular Grid subcomponent.

xp yp alp xlen ylen mx my

Note

The direction of the x-axis alp must be 0 in case of spherical coordinates

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).

Examples

In [91]: from rompy.swan.subcomponents.readgrid import GRIDREGULAR

In [92]: kwargs = dict(xp=173, yp=-40, alp=0, xlen=2, ylen=2, mx=199, my=199)

In [93]: grid = GRIDREGULAR(suffix="c", **kwargs)

In [94]: print(grid.render())
xpc=173.0 ypc=-40.0 alpc=0.0 xlenc=2.0 ylenc=2.0 mxc=199 myc=199

In [95]: grid = GRIDREGULAR(suffix="inp", **kwargs)

In [96]: print(grid.render())
xpinp=173.0 ypinp=-40.0 alpinp=0.0 xleninp=2.0 yleninp=2.0 mxinp=199 myinp=199
Fields:
field alp: float | None = 0.0#

Direction of the xaxis in degrees

field model_type: Literal['gridregular', 'GRIDREGULAR'] = 'gridregular'#

Model type discriminator

field mx: int [Required]#

Number of meshes in computational grid in x-direction (this number is one less than the number of grid points in this domain)

field my: int [Required]#

Number of meshes in computational grid in y-direction (this number is one less than the number of grid points in this domain)

field suffix: str | None = ''#

Suffix for rendering with each output grid parameter.

field xlen: float [Required]#

Length of the computational grid in the x-direction

field xp: float [Required]#

The x-coordinate of the origin in problem coordinates

field ylen: float [Required]#

Length of the computational grid in the y-direction

field yp: float [Required]#

The y-coordinate of the origin in problem coordinates

cmd() str[source]#

Command file string for this subcomponent.

property dx#

Grid spacing in x-direction.

property dy#

Grid spacing in y-direction.