Acoustic scattering from multiple n-spheres in NumPy / PyTorch
Project description
biem-helmholtz-sphere
Documentation: https://biem-helmholtz-sphere.readthedocs.io
Source Code: https://github.com/ultrasphere-dev/biem-helmholtz-sphere
Acoustic scattering from multiple n-spheres in NumPy / PyTorch
Installation
Install this via pip (or your favourite package manager):
pip install biem-helmholtz-sphere
Usage (GUI)
uvx biem-helmholtz-sphere serve
Usage
Boundary Integral Equation Method (BIEM) for the Helmholtz equation.
Let $d \in \mathbb{N} \setminus \lbrace 1 \rbrace$ be the dimension of the space, $k$ be the wave number, and $\mathbb{S}^{d-1} = \lbrace x \in \mathbb{R}^d \mid |x| = 1 \rbrace$ be a unit sphere in $\mathbb{R}^d$. Let $B := {0, ..., }$ be the index set of spheres, $c_b \in \mathbb{R}^d$ be the center of sphere $b \in B$, and $\rho_b > 0$ be the radius of sphere $b \in B$. Assume that the closure of spheres do not overlap, i.e.,
$$ \forall b, b' \in B, b \neq b', |c_b - c_b'| > \rho_b + \rho_b' $$
Asuume that $u_\text{in}$ is an incident wave satisfying the Helmholtz equation
$$ \Delta u_\text{in} + k^2 u_\text{in} = 0 $$
and scattered wave $u$ satisfies the following:
$$ \begin{cases} \Delta u + k^2 u = 0 \quad &x \in \mathbb{R}^d \setminus \overline{\mathbb{S}^{d-1}} \ \alpha u + \beta \nabla u \cdot n_x = -\alpha u_\text{in} -\beta \nabla u_\text{in} \cdot n_x \quad &x \in \mathbb{S}^{d-1} \ \lim_{|x| \to \infty} |x|^{\frac{d-1}{2}} \left( \frac{\partial u}{\partial |x|} - i k u \right) = 0 \quad &\frac{x}{|x|} \in \mathbb{S}^{d-1} \end{cases} $$
The following code assumes
$$ d = 3, k = 1, u_\text{in} (x) = e^{i k x_0}, c_0 = (0, 2, 0), c_1 = (0, -2, 0), \rho_0 = 1, \rho_1 = 1, \alpha = 1, \beta = 0 \quad \text{(Sound-soft)} $$
and computes the scattered wave at $(0, 0, 0)$.
>>> from array_api_compat import numpy as xp
>>> from biem_helmholtz_sphere import BIEMResultCalculator, biem, plane_wave
>>> from ultrasphere import create_from_branching_types
>>> c = create_from_branching_types("ba")
>>> uin, uin_grad = plane_wave(k=xp.asarray(1.0), direction=xp.asarray((1.0, 0.0, 0.0)))
>>> calc = biem(c, uin=uin, uin_grad=uin_grad, k=xp.asarray(1.0), n_end=6, eta=xp.asarray(1.0), centers=xp.asarray(((0.0, 2.0, 0.0), (0.0, -2.0, 0.0))), radii=xp.asarray((1.0, 1.0)), kind="outer")
>>> complex(xp.round(calc.uscat(xp.asarray((0.0, 0.0, 0.0))), 6))
(-0.741333-0.669657j)
Contributors ✨
Thanks goes to these wonderful people (emoji key):
This project follows the all-contributors specification. Contributions of any kind welcome!
Credits
This package was created with Copier and the browniebroke/pypackage-template project template.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file biem_helmholtz_sphere-1.1.1.tar.gz.
File metadata
- Download URL: biem_helmholtz_sphere-1.1.1.tar.gz
- Upload date:
- Size: 24.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
743f9b705a4321edb13d369f67dc522d8ec6f10660f03b624088cd0f62e1f22e
|
|
| MD5 |
61448e18e7920698434d9177166725bb
|
|
| BLAKE2b-256 |
dc26b32f9891266a22473043a318a59d8ae6eb20952656c6766779dd2e629930
|
Provenance
The following attestation bundles were made for biem_helmholtz_sphere-1.1.1.tar.gz:
Publisher:
ci.yml on ultrasphere-dev/biem-helmholtz-sphere
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
biem_helmholtz_sphere-1.1.1.tar.gz -
Subject digest:
743f9b705a4321edb13d369f67dc522d8ec6f10660f03b624088cd0f62e1f22e - Sigstore transparency entry: 661059802
- Sigstore integration time:
-
Permalink:
ultrasphere-dev/biem-helmholtz-sphere@212a04668e94d1e2a7142de01c5a74901136af41 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ultrasphere-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@212a04668e94d1e2a7142de01c5a74901136af41 -
Trigger Event:
push
-
Statement type:
File details
Details for the file biem_helmholtz_sphere-1.1.1-py3-none-any.whl.
File metadata
- Download URL: biem_helmholtz_sphere-1.1.1-py3-none-any.whl
- Upload date:
- Size: 21.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44036e45dacace1a7e50256ab0ce91191abd4b0a6ee6338bafe75a03b2c67a5b
|
|
| MD5 |
9d346e1c527a3ffb98734fa6def67e33
|
|
| BLAKE2b-256 |
0538062d099523d7043fe7e82b8018b5987f4031008b778c25a9ba8a9b875c23
|
Provenance
The following attestation bundles were made for biem_helmholtz_sphere-1.1.1-py3-none-any.whl:
Publisher:
ci.yml on ultrasphere-dev/biem-helmholtz-sphere
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
biem_helmholtz_sphere-1.1.1-py3-none-any.whl -
Subject digest:
44036e45dacace1a7e50256ab0ce91191abd4b0a6ee6338bafe75a03b2c67a5b - Sigstore transparency entry: 661059809
- Sigstore integration time:
-
Permalink:
ultrasphere-dev/biem-helmholtz-sphere@212a04668e94d1e2a7142de01c5a74901136af41 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/ultrasphere-dev
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@212a04668e94d1e2a7142de01c5a74901136af41 -
Trigger Event:
push
-
Statement type: