You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docstrings generation was requested by @waltsims.
* #614 (comment)
The following files were modified:
* `kwave/kWaveSimulation.py`
* `tests/test_kspaceFirstOrder3D_state.py`
Initialize kWaveSimulation and prepare internal state for simulation validation and preparation.
41
+
42
+
Creates and stores copies of the provided grid, source, sensor, medium, and options; initializes flags, defaults, and internal placeholders used throughout the input-checking and preparation pipeline. If sensor.time_reversal_boundary_data is provided, the constructor converts inputs into a Dirichlet-style source and a minimal sensor for deprecated time-reversal mode, warns about deprecation, and configures the Recorder accordingly.
43
+
44
+
Parameters:
45
+
kgrid (kWaveGrid): Spatial grid definition for the simulation.
46
+
source (kSource): User-provided source definition (a deep copy is stored internally; the original is preserved on original_source).
47
+
sensor (NotATransducer): User-provided sensor definition (a deep copy is stored internally; the original is preserved on original_sensor).
48
+
medium (kWaveMedium): Medium properties (sound speed, density, absorption, etc.).
49
+
simulation_options (SimulationOptions): Simulation-wide options and flags.
50
+
51
+
Side effects:
52
+
- Stores deep copies as self.source and self.sensor and preserves originals in self.original_source and self.original_sensor.
53
+
- Sets many internal flags and default values (mask type, time-reversal flag, PML/simulation defaults, source/sensor indexing placeholders, absorption operator placeholders, recorder and logging setup).
54
+
- May replace source and sensor with a Dirichlet-style source/sensor when time-reversal boundary data is present.
Check if the sensor mask is a binary grid matching the kgrid dimensions.
1504
-
Takes into account that the PML may have been added to the sensor mask.
1505
-
1506
-
Args:
1507
-
kgrid_dim: Dimensionality of the kWaveGrid
1508
-
1509
-
Returns:
1510
-
bool: True if the sensor mask is a binary grid matching kgrid dimensions
1522
+
Return True if the sensor mask is a binary grid matching the simulation grid (kgrid), accounting for optional PML padding.
1523
+
1524
+
Checks whether sensor.mask has the same shape as kgrid.k or—when a PML size is configured in self.options.pml_size—matches the grid shape extended by 2*pml in each dimension. Supports 1D, 2D, and 3D grids and accepts a scalar or per-axis PML size representation.
0 commit comments