Detailed API reference¶
This page is generated from Yonderdrake’s public Python objects. The concise support tables and method-selection guidance remain in API and supported scope.
Time-memory operators¶
Yonderdrake public interface.
Markers¶
Representations¶
- class yonderdrake.BirkSong(num_modes, **method_parameters)[source]¶
Birk-Song’s squared Cayley-transform Gauss-Jacobi spectrum.
- Parameters:
num_modes (int)
method_parameters (Any)
- class yonderdrake.Cayley(num_modes, *, power=None, t_final=None, min_step=None, **method_parameters)[source]¶
Cayley-transform diffusive spectrum with a selectable exponent.
The rate map is
((1 - x) / (1 + x)) ** powerover the Gauss-Jacobi reference interval, sopowersets how many decades of relaxation rate a given mode count spans. Diethelm2008 and BirkSong are the publishedpower=2andpower=4members of this family.Pass
t_finalandmin_stepto size the exponent from the time range the problem needs, orpowerto set it directly.- Parameters:
- class yonderdrake.Jacobi(num_modes, *, sigma, rho, **method_parameters)[source]¶
Two-parameter Gauss-Jacobi diffusive representation.
sigmacontrols the rate-map behaviour nearx=1andrhocontrols it nearx=-1. Both parameters must be finite and positive.
- class yonderdrake.Diethelm2008(num_modes, **method_parameters)[source]¶
Diethelm2008’s Gauss-Jacobi improvement of the diffusive representation.
- Parameters:
num_modes (int)
method_parameters (Any)
- class yonderdrake.SumOfExponentials(*, target_error, t_final, min_step)[source]¶
Tolerance-driven positive sum of exponentials from Jiang et al.
- class yonderdrake.Diethelm2022(num_modes, *, quadrature='trapezoidal', target_error=1e-08, decay_scale=1.0, truncation_radius=None, rate_scale=1.0)[source]¶
Discretize Diethelm2008’s 2022 real-line representation.
quadratureselects the published Gauss-Laguerre construction or a truncated composite trapezoidal, composite Simpson, or Gauss-Legendre rule. Gauss-Laguerre requires an evennum_modesbecause each node produces two modes. Simpson quadrature requires an oddnum_modes. The truncation controls apply only to the three truncated rules.- Warning:
This representation is provided for expert use and comparison. It is more sensitive to mode count, time range, and scaling than BirkSong or Diethelm2008.
- Parameters:
- class yonderdrake.YuanAgrawal(num_modes, *, rate_scale=1.0)[source]¶
Original Yuan-Agrawal Gauss-Laguerre diffusive spectrum.
- Warning:
This representation is provided for expert use and comparison. It is generally less robust per mode than
BirkSongorDiethelm2008.
- class yonderdrake.SineDiffusive(num_modes)[source]¶
Sine diffusive representation of Khosravian-Arab and Dehghan.
- Warning:
This undamped, slowly convergent representation is provided for literature comparison. Use a positive-rate representation for routine simulations.
- Parameters:
num_modes (int)
Formulations and steppers¶
- class yonderdrake.Recurrence(interpolant='quadratic')[source]¶
Eliminated constant-memory recurrence formulation.
- Parameters:
interpolant (str)
- class yonderdrake.AuxiliaryODE(scheme='backward_euler')[source]¶
Auxiliary-ODE formulation solving the field and its modes together.
Where Recurrence eliminates the memory modes from the field solve, this couples them into one monolithic system on
V^(m+1), which is what makes the modes reachable from PETSc.- Parameters:
scheme (str)
- yonderdrake.FractionalTimeStepper(F, representation, t, dt, u, *, formulation=None, u0=None, bcs=None, solver_parameters=None, appctx=None)[source]¶
Construct a native formulation for a fractional derivative marker.
- yonderdrake.TimeMemoryStepper(F, t, dt, u, *, representation=None, formulation=None, u0=None, bcs=None, solver_parameters=None, appctx=None, warn_initial_compatibility=True)[source]¶
Advance exponential memory and optional fractional time markers.
- class yonderdrake.ExponentialMemoryCompatibilityWarning[source]¶
Warn that bounded-kernel evolution requires compatible initial data.
Spatial operators¶
- yonderdrake.SpectralFractionalLaplacian(u, s, *, bcs=None, sinc_truncation_target=1e-10, shift_cache='stream', shift_solver_parameters=None, mass_solver_parameters=None)[source]¶
Create
(-Delta)^swith Dirichlet or natural Neumann boundaries.Omitting
bcsuses the discrete Neumann Laplacian. Supplyingbcsselects the homogeneous-Dirichlet realization and must constrain the complete exterior boundary.
- yonderdrake.RieszFractionalLaplacian(u, s, *, extension='zero', quadrature_degree=6, quadrature_rule='boundary', assembly='matfree', compression_tolerance=1e-06, admissibility=1.0, leaf_size=16, bcs=None, mass_solver_parameters=None)[source]¶
Create the zero-exterior operator on affine triangles or tetrahedra.
Caputo-Wismer applications¶
Application-level building blocks.
- class yonderdrake.applications.CaputoWismerMaterial(*, indicator, density, wave_speed, damping, alpha)[source]¶
One piecewise acoustic material in a Caputo-Wismer model.
- class yonderdrake.applications.SensorArray(space, locations, *, width)[source]¶
Gaussian volume sensors with a matching discrete adjoint.
- Parameters:
space (Any)
locations (Any)
width (float)
- classmethod ring(space, num_sensors, radius, *, width, center=(0.0, 0.0))[source]¶
Construct a two-dimensional circular sensor array.
- classmethod sphere(space, num_sensors, radius, *, width, center=(0.0, 0.0, 0.0))[source]¶
Construct a three-dimensional spherical sensor array.
- sample(field)[source]¶
Return the spatially averaged value recorded by every sensor.
- Parameters:
field (Any)
- Return type:
ndarray
- class yonderdrake.applications.CaputoWismerStepper(u, t, dt, *, materials, representation=None, num_modes=32, volume_source=None, boundary_source=None, boundaries=(), initial_velocity=0.0, bcs=None, stiffness_theta=1.0, solver_parameters=None, appctx=None)[source]¶
Advance a heterogeneous Caputo-Wismer wave equation.
- Parameters:
u (Any)
t (Any)
dt (Any)
materials (Sequence[CaputoWismerMaterial])
representation (Any)
num_modes (int)
volume_source (Any)
boundary_source (Any)
boundaries (Sequence[CaputoWismerImpedanceBoundary])
initial_velocity (Any)
bcs (Any)
stiffness_theta (float)
solver_parameters (Any)
appctx (Any)
- class yonderdrake.applications.CaputoWismerSource(*, profile, signal, region='volume', boundary_id=None)[source]¶
A separable spatial profile and time signal.
- class yonderdrake.applications.CaputoWismerArraySource(*, array, signals)[source]¶
Independent time signals injected through a sensor-array transpose.
- class yonderdrake.applications.CaputoWismerImpedanceBoundary(*, coefficient, boundary_id=None)[source]¶
A first-order outgoing-wave condition on a marked boundary.
- class yonderdrake.applications.CaputoWismerPML(*, damping, outer_boundary=True, interior_bounds=None, reflection=None, polynomial_order=None)[source]¶
Directional damping fields for a time-domain acoustic PML.
- Parameters:
- yonderdrake.applications.ring_sensor_locations(num_sensors, radius, *, center=(0.0, 0.0))[source]¶
Return uniformly spaced sensor centres on a two-dimensional ring.
- yonderdrake.applications.sphere_sensor_locations(num_sensors, radius, *, center=(0.0, 0.0, 0.0))[source]¶
Return approximately uniform sensor centres on a three-dimensional sphere.
- class yonderdrake.applications.CaputoWismerModel(space, *, materials, dt, num_steps, sensors=None, sources=(), boundaries=(), pml=None, attenuation='dissipative', attenuation_filter_length=None, attenuation_filter_order=2, num_modes=32, representation=None, stiffness_theta=None, solver_parameters=None)[source]¶
A conservative acoustic model and its exact discrete adjoint.
- Parameters:
space (Any)
materials (Sequence[CaputoWismerMaterial])
dt (float)
num_steps (int)
sensors (SensorArray | None)
sources (Sequence[CaputoWismerSource | CaputoWismerArraySource])
boundaries (Sequence[CaputoWismerImpedanceBoundary])
pml (CaputoWismerPML | None)
attenuation (AttenuationMode)
attenuation_filter_length (float | None)
attenuation_filter_order (int)
num_modes (int)
representation (Any)
stiffness_theta (float | None)
solver_parameters (Any)
- propagate(initial_pressure, *, record_history=False)[source]¶
Advance an initial pressure and configured time-dependent sources.
- class yonderdrake.applications.CaputoWismerInverseProblem(model, sensor_data, *, regularization=1e-06)[source]¶
Regularized initial-pressure reconstruction for one acoustic model.
- Parameters:
model (CaputoWismerModel)
sensor_data (Any)
regularization (float)
- objective_gradient(candidate)[source]¶
Return the Tikhonov objective and coefficient-space gradient.
- class yonderdrake.applications.CaputoWismerReconstruction(pressure, converged, iterations, objective, objective_history, message, function_evaluations, forward_seconds, adjoint_seconds, elapsed_seconds)[source]¶
Result and diagnostics from an iterative reconstruction.
- yonderdrake.applications.reconstruct_initial_pressure(model, sensor_data, *, method='kaltenbacher', regularization=1e-06, initial_guess=None, max_iterations=100, tolerance=1e-05, positivity=True, warm_start=True, compensate_attenuation=True, filter_length=None, filter_order=2)[source]¶
Reconstruct initial pressure with the selected method.
- Parameters:
model (CaputoWismerModel)
sensor_data (Any)
method (Literal['kaltenbacher', 'adjoint', 'time_reversal'])
regularization (float)
initial_guess (Any)
max_iterations (int)
tolerance (float)
positivity (bool)
warm_start (bool)
compensate_attenuation (bool)
filter_length (float | None)
filter_order (int)
- Return type: