kwave.kmedium module

class kWaveMedium[source]

Bases: object

kWaveMedium(sound_speed: <built-in function array>, sound_speed_ref: <built-in function array> = None, density: <built-in function array> = None, alpha_coeff: <built-in function array> = None, alpha_power: <built-in function array> = None, alpha_mode: <built-in function array> = None, alpha_filter: <built-in function array> = None, alpha_sign: <built-in function array> = None, BonA: <built-in function array> = None, absorbing: bool = False, stokes: bool = False)

BonA: array = None
__init__(sound_speed, sound_speed_ref=None, density=None, alpha_coeff=None, alpha_power=None, alpha_mode=None, alpha_filter=None, alpha_sign=None, BonA=None, absorbing=False, stokes=False)
Parameters:
  • sound_speed (array)

  • sound_speed_ref (array | None)

  • density (array | None)

  • alpha_coeff (array | None)

  • alpha_power (array | None)

  • alpha_mode (array | None)

  • alpha_filter (array | None)

  • alpha_sign (array | None)

  • BonA (array | None)

  • absorbing (bool)

  • stokes (bool)

Return type:

None

absorbing: bool = False
alpha_coeff: array = None
property alpha_coeff_compression

Compression alpha coefficient (used in elastic simulations | not supported currently!)

property alpha_coeff_shear

Shear alpha coefficient (used in elastic simulations | not supported currently!)

alpha_filter: array = None
alpha_mode: array = None
alpha_power: array = None
alpha_sign: array = None
check_fields(kgrid_shape)[source]

Check whether the given properties are valid

Parameters:

kgrid_shape (ndarray) – Shape of the kWaveGrid

Returns:

None

Return type:

None

density: array = None
ensure_defined(*fields)[source]

Assert that the field(s) are defined (not None)

Parameters:

*fields – String list of the fields

Returns:

None

Return type:

None

is_defined(*fields)[source]

Check if the field(s) are defined or None

Parameters:

*fields – String list of the fields

Returns:

Boolean list

Return type:

List[bool]

is_nonlinear()[source]

Check if the medium is nonlinear

Returns:

whether the fluid simulation is nonlinear

Return type:

bool

set_absorbing(is_absorbing, is_stokes=False)[source]

Change medium’s absorbing and stokes properties

Parameters:
  • is_absorbing – Is the medium absorbing

  • is_stokes – Is the medium stokes

Returns:

None

Return type:

None

sound_speed: array
property sound_speed_compression

Compression sound speed (used in elastic simulations | not supported currently!)

sound_speed_ref: array = None
property sound_speed_ref_compression

Compression sound speed reference (used in elastic simulations | not supported currently!)

property sound_speed_ref_shear

Shear sound speed reference (used in elastic simulations | not supported currently!)

property sound_speed_shear

Shear sound speed (used in elastic simulations | not supported currently!)

stokes: bool = False