rompy.swan.components.physics.OBSTACLES#
- pydantic model rompy.swan.components.physics.OBSTACLES[source]#
List of swan obstacles.
OBSTACLE ... LINE < [xp] [yp] > OBSTACLE ... LINE < [xp] [yp] > .
This group component is a convenience to allow defining and rendering a list of obstacle components.
Examples
In [94]: from rompy.swan.components.physics import OBSTACLES, OBSTACLE, OBSTACLE_FIG In [95]: obst1 = dict( ....: model_type="obstacle", ....: reflection=dict(reflc=1.0), ....: line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]), ....: ) ....: In [96]: obst2 = OBSTACLE( ....: transmission=dict(model_type="transm"), ....: line=dict(xp=[174.3, 174.3], yp=[-39.1, -39.2]), ....: ) ....: In [97]: obst3 = OBSTACLE_FIG( ....: alpha1=5e-4, ....: hss=2.5, ....: tss=10.3, ....: line=dict(xp=[174.1, 174.2, 174.3], yp=[-39.1, -39.1, -39.1]), ....: ) ....: In [98]: obstacles = OBSTACLES(obstacles=[obst1, obst2, obst3]) In [99]: for obst in obstacles.render(): ....: print(obst) ....: OBSTACLE REFL reflc=1.0 LINE 174.1 -39.1 174.2 -39.1 174.3 -39.1 OBSTACLE TRANSM LINE 174.3 -39.1 174.3 -39.2 OBSTACLE FIG alpha1=0.0005 hss=2.5 tss=10.3 LINE 174.1 -39.1 174.2 -39.1 174.3 -39.1
- Fields:
- field model_type: Literal['obstacles', 'OBSTACLES'] = 'obstacles'#
Model type discriminator
- field obstacles: list[OBSTACLE | OBSTACLE_FIG] [Required]#
Obstacle component