swiift.lib.phase_shift¶
Pseudo-scattering parameterisations.
Classes¶
No scattering. |
|
Scattering with uniformly sampled new phases. |
|
Scattering with phases perturbated around the continuous solution. |
Module Contents¶
- class swiift.lib.phase_shift.ContinuousScatteringHandler¶
Bases:
_ScatteringHandlerNo scattering.
The surface stays continuous across floes edges.
- compute_edge_amplitudes(edge_amplitudes, c_wavenumbers, xf)¶
Determine post-breakup wave amplitudes at the edge of new floes.
The wave propagates and is attenuated underneath the floe. For the current timestep, for each wave component, the complex wave amplitude is fully determined at all the coordinates where fracture is about to occur. After fractures have occured, the complex amplitudes at these coordinates become the complex amplitudes at the left edges of new fragments. Further pseudo-scattering rules can be used if it is not desirable to keep the wave surface in phase on both sides of a floe edge.
- Parameters:
- Return type:
np.ndarray of complex
- class swiift.lib.phase_shift.UniformScatteringHandler¶
Bases:
_RandomScatteringHandlerScattering with uniformly sampled new phases.
The wave phase at the edge of a new floe is sampled from the uniform distribution on \([0; 2\pi)\).
- Parameters:
rng (numpy.random.Generator) – Random generator used to sample phases
- classmethod from_seed(seed)¶
Instantiate self with an RNG seeded by an integer.
- Parameters:
seed (int) – A seed passed to numpy.random.default_rng
- Return type:
- compute_edge_amplitudes(edge_amplitudes, c_wavenumbers, xf)¶
Determine post-breakup wave amplitudes at the edge of new floes.
The wave propagates and is attenuated underneath the floe. For the current timestep, for each wave component, the complex wave amplitude is fully determined at all the coordinates where fracture is about to occur. After fractures have occured, the complex amplitudes at these coordinates become the complex amplitudes at the left edges of new fragments. Further pseudo-scattering rules can be used if it is not desirable to keep the wave surface in phase on both sides of a floe edge.
- Parameters:
- Return type:
np.ndarray of complex
- class swiift.lib.phase_shift.PerturbationScatteringHandler¶
Bases:
_RandomScatteringHandlerScattering with phases perturbated around the continuous solution.
The wave phase at the left edge of a new floe is computed to maintain continuity of the surface across the edge. Then, a random perturbation sampled from a normal distribution, is added to the phase.
- rng¶
Random generator used to sample perturbations
- Type:
numpy.random.Generator
- scale¶
The standard deviation of the normal distribution used to sample perturbations, in rad
- Type:
Notes
Perturbations are always added to an existing phase. The expectation of the resulting phase is thus the sum of loc and the phase of the continuous solution.
- classmethod from_seed(seed, loc=0, scale=1)¶
Instantiate with an RNG seeded with an integer.
- Parameters:
- Return type:
- compute_edge_amplitudes(edge_amplitudes, c_wavenumbers, xf)¶
Determine post-breakup wave amplitudes at the edge of new floes.
The wave propagates and is attenuated underneath the floe. For the current timestep, for each wave component, the complex wave amplitude is fully determined at all the coordinates where fracture is about to occur. After fractures have occured, the complex amplitudes at these coordinates become the complex amplitudes at the left edges of new fragments. Further pseudo-scattering rules can be used if it is not desirable to keep the wave surface in phase on both sides of a floe edge.
- Parameters:
- Return type:
np.ndarray of complex