Metadata-Version: 2.4
Name: acousticDE
Version: 0.1.1
Summary: Acoustics Simulation using the Diffusion Equation
Keywords: room acoustics,acoustic diffusion equation,acoustic simulations
Author-email: Ilaria Fichera <i.fichera@tue.nl>, Cedric Van hoorickx <c.m.l.van.hoorickx@tue.nl>, Marco Berzborn <m.berzborn@tue.nl>, Maarten Hornikx <m.c.j.hornikx@tue.nl>
Requires-Python: >=3.10,<3.15
Description-Content-Type: text/markdown
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
Classifier: Natural Language :: English
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
License-File: LICENSE.md
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: gmsh
Requires-Dist: soundfile
Requires-Dist: pandas
Requires-Dist: pytest
Requires-Dist: sounddevice ; extra == "audio"
Requires-Dist: acousticDE[docs, examples, audio] ; extra == "dev"
Requires-Dist: sphinx ; extra == "docs"
Requires-Dist: sphinx-rtd-theme ; extra == "docs"
Requires-Dist: myst_parser ; extra == "docs"
Requires-Dist: sphinx-gallery ; extra == "docs"
Requires-Dist: pooch ; extra == "docs"
Requires-Dist: matplotlib ; extra == "docs"
Requires-Dist: ipykernel ; extra == "docs"
Requires-Dist: pooch ; extra == "examples"
Requires-Dist: matplotlib ; extra == "examples"
Requires-Dist: ipython ; extra == "examples"
Requires-Dist: ipykernel ; extra == "examples"
Project-URL: Documentation, https://building-acoustics-tu-eindhoven.github.io/acousticDE/
Project-URL: Source, https://github.com/Building-acoustics-TU-Eindhoven/acousticDE
Project-URL: Tracker, https://github.com/Building-acoustics-TU-Eindhoven/acousticDE/issues
Provides-Extra: audio
Provides-Extra: dev
Provides-Extra: docs
Provides-Extra: examples

﻿## Diffusion Equation Software for Room Acoustics Modeling
acousticDE is an open-source software package developed for the simulation of room acoustics based on the diffusion equation method. The package provides two complementary numerical implementations of this method: the Finite Volume Method (FVM) and the Finite Difference Method (FDM). In addition, it includes a tool for auralization enabling users to listen to acoustic renderings generated from the results of the Finite Volume Method. The main strength of acousticDE is in its ability to predict the distribution of acoustic energy over space and time within a given room. With only a minimal set of input parameters, the software delivers accurate and computationally efficient estimates of both the energy propagation and room acoustics properties. This makes it a valuable tool for researchers and practitioners interested in architectural acoustics. The software is being developed as part of an ongoing research within the Building Acoustics Group at the Department of Built Environment, Eindhoven University of Technology. It is currently under active development and implemented in Python by Ilaria Fichera. 

## Release version
Version 0.1.1

## Repository structure
The package acousticDE is formed by three subfolders: 
+ _Auralization_ generates the auralization wav file for the room in question;
+ _FiniteDifferenceMethod_ computes the room acoustics based on the diffusion equation using the finite difference method (Navarro et al., 2012);
+ _FiniteVolumeMethod_ computes the room acoustics based on the diffusion equation using the finite volume method (Munoz, 2019);

## Installation

### Installation from users

Use pip to install acousticDE

```bash 
pip install acousticDE==0.1.1
```

Once installed, in cmd window, use the following commands:

```bash 
python

import acousticDE

from pathlib import Path
```

To run FVM, prepare the inputs file as per description in [FVM documentation Inputs](https://building-acoustics-tu-eindhoven.github.io/acousticDE/Finite%20Volume%20Method%20Use.html#inputs) and continue with:
```bash 
from acousticDE.FiniteVolumeMethod.FVM import run_fvm_sim

mesh_file = Path.cwd() / "mesh.msh"
simulation_inputs = Path.cwd() / "simulation_fvm_inputs.json"
abs_coeff = Path.cwd() / "absorption_coefficients.csv"

results = run_fvm_sim(str(mesh_file), simulation_inputs, abs_coeff)
```

To run FDM, prepare the inputs file as per description in [FDM documentation Inputs](https://building-acoustics-tu-eindhoven.github.io/acousticDE/Finite%20Difference%20Method%20Use.html#inputs) and continue with:
```bash 
from acousticDE.FiniteDifferenceMethod.FDM import run_fdm_sim

simulation_inputs = Path.cwd() / "simulation_fdm_inputs.json"

results = run_fdm_sim(simulation_inputs)
```

To run Auralization, prepare the inputs file as per description in [Auralization documentation Inputs](https://building-acoustics-tu-eindhoven.github.io/acousticDE/Auralization%20Use.html#inputs) and continue with:
```bash 
from acousticDE.Auralization.Auralization import run_auralization

anechoic_file = Path.cwd() / "anechoic_file.wav"
results_FVM = Path.cwd() / "resultsFVM.pkl"

results = run_auralization(anechoic_file, results_FVM)
```

To run the codes/functions, check the [documentation](https://building-acoustics-tu-eindhoven.github.io/acousticDE/) depending on the method you want to use, create the files needed for the specific function and check the Tutorial sections of the documentation.

### Installation from source (developers)
These instructions are intended for users who clone the repository and want to run the examples or develop acousticDE locally.
You will need Git, Python 3.10 to 3.14 and [uv](https://docs.astral.sh/uv/) for environment and package management.

On Ubuntu or Ubuntu under WSL, install the system libraries required by Gmsh:
```bash 
sudo apt update
sudo apt install libglu1-mesa libgl1 libxrender1 libxcursor1 libxft2 libxinerama1 libgomp1
```
These packages were needed to run the example in the tested Ubuntu/WSL environment. Other Linux distributions may require different package names.

Clone the repository and enter its directory

```bash
git clone https://github.com/Building-acoustics-TU-Eindhoven/acousticDE.git
cd acousticDE
```

Create and activate a virtual environment

```bash
uv venv --python 3.12 .venv
```

Activate the environment on macOS and Linux with:

```bash
source .venv/bin/activate
```

Activate the environment on  Windows PowerShell with:

```powershell
.venv\Scripts\Activate.ps1
```

Install acousticDE in editable mode, including the example dependencies as below:

```bash
uv pip install -e ".[examples]"
```

Editable mode allows changes to the local source code to be used without reinstalling the package after every code change. The `examples` dependency group installs the additional packages needed to run the example scripts. See `pyproject.toml` for the complete list of dependencies.

Verify the installation by checking that the package can be inported:

```bash
python -c "import acousticDE, numpy; print('ok', numpy.__version__)"
```

If works, run an example from the repository root:

```bash
python examples/plot_cuboid_room_fvm.py
```

### Running the examples

The example scripts are included in the GitHub repository. If you have cloned the repository and would like to run the examples, install the main package with 'pip install acousticDE==0.1.1' as described above and install the additional packages required by the examples with:

```bash
pip install matplotlib pooch ipython
```

Then, from the root directory of the repository, run an example with:

```bash
python examples/plot_cuboid_room_fvm.py
```

Alternatively, if you use `uv`, the project dependencies can be installed with:

```bash
uv sync --extra examples
```

and the example can then be run with:

```bash
uv run python examples/plot_cuboid_room_fvm.py
```

## Usage & Documentation
The [documentation](https://building-acoustics-tu-eindhoven.github.io/acousticDE/) is created to help to use and develop acousticDE effectively. To use acousticDE, please refer to the Tutorial section of the [documentation](https://building-acoustics-tu-eindhoven.github.io/acousticDE/). In addition, the documentation gives an introduction of the package for both FDM and FVM.

## Authors
Software is being developed by Ilaria Fichera at Eindhoven University of Technology (TU/e). 

## Funding
This research is founded by the Dutch Research Council (<u>[NWO](https://www.nwo.nl/projecten/19430)), Applied and Engineering Sciences (AES) under grant agreement No. 19430, with project title "A new era of room acoustics simulation software: from academic advances to a sustainable open-source project and community".

## License
Diffusion is under copyright of Building Acoustics Group at the Eindhoven University of Technology and is licensed under GNU General Public License v2.0. See LICENSE.md for more details.

## References
J. M. Navarro, J. Escolano and J. J. Lopez, Implementation and evaluation of a diffusion equation model based on finite difference schemes for sound field prediction in rooms, Applied Acoustics 73 (2012).

R. P. Muñoz, Numerical modeling for urban sound propagation: developments in wave-based and energy based methods, PhD Thesis, Technische Universiteit Eindhoven, 2019.


