Conversation
| if angle_units == 'rad': | ||
| unit_factor = 1.0 | ||
|
|
||
| theta = atan2(y, x) |
There was a problem hiding this comment.
I think this requires x,y to be (0,0) on the pole, which is why I previously had x_shift etc although that only works if the pole is in the centre of the mesh. Unless I've missed something, SpatialCoordinate(mesh) always gives x,y as (0,0) in the corner so would then be a different x,y to this?
There was a problem hiding this comment.
Would it help to add some input arguments to translate? I can't remember what you use this for...
There was a problem hiding this comment.
My original functions had Lx and Ly as input arguments to shift x and y. I use these to define the position of my cyclones, so given it's a polar plane I want to consider the centre of the mesh as (0,0) as that's the pole.
| xyz[1] - self.parameters.y0) | ||
| elif rotation is CoriolisOptions.gammaplane: | ||
| x, y = SpatialCoordinate(self.domain.mesh) | ||
| r, _ = rtheta_from_xy(x, y) |
There was a problem hiding this comment.
It's also used in here, so currently my gamma plane and trap is centred on a corner of the domain. This will probably be different for different people using it, but I imagine you'd typically want a gamma plane centred in the centre of the mesh?
Create gamma plane option for shallow water and enable specification of a "trap" in the Coriolis parameter via the
ShallowWaterEquationclass.