Code supplement for article "Accuracy of post-processing projections for displacement based finite element simulations in room acoustics".
This repository contains scripts to reproduce all the numerical results included as benchmark cases in the article. The implementation is in the Julia programming language, primarily using Gridap package.
Details:
- Weak formulation for pressure
$L^2$ and$H^1$ -projections - Continuous and discontinuous Galerkin discretizations for computing the pressure field
- First and second-order finite element discretizations are analyzed
- Error convergence and computational performance is illustrated with different benchmarks
Authors:
Affiliation:
- Centre for Mathematical Research and Technology of Galicia (CITMaGa), A Coruña, Spain.
Repository:
License:
- MIT, see
LICENSE.txt
.
Table of Contents
First, clone the repository or download the contents locally on your computer, and ensure you are working within project directory,
git clone [email protected]:ashwin-nayak/pressure-projections.git
cd pressure-projections
The library is structured into the following folders, which correspond to each benchmark scenarios:
Folder | Information |
---|---|
1D-example |
One-dimensional planewave propagation in an elongated rectangle |
2D-annulus-example |
Two-dimensional radial wave propagation in a quarter of an annular domain |
2D-square-structured-example |
Two-dimensional planewave propagation in the unit square using a structured mesh |
2D-square-unstructured-example |
Two-dimensional planewave propagation in the unit square using an unstructured mesh |
2D-square-noise-example |
Two-dimensional planewave propagation in the unit square in the presence of noise |
2D-room-example |
Two-dimensional transmitted field in the interior of the cross-section of an auditorium |
To run the scripts, you must first set the environment and dependent Julia packages. Instructions provided here are provided for standard UNIX distributions, but maybe easily adopted (but not tested) in other operating systems.
You may either choose to use,
- Build and run in containers: Recommended to primarily reproduce results
- Compile and Run: Recommended for customizations and further development.
Warning
The code execution requires a large amount of free RAM memory (>40 GB) and a runtime of about ~20 h (due to large problem sizes for highly resolved meshes).
The project offers a Dockerfile
to automate the configuration and execution by,
setting relevant dependencies, hosting the source code, building executables and running the demos.
Necessary tools:
- Docker Desktop specifically Docker Engine (tested with
27.3.1
).
Build the pressure-projections
image which contains the environment, copies the source code and builds executables
docker build -f Dockerfile --tag pressure-projections .
Run a disposable container by sharing the project folder within,
docker run --rm \
-u $(id -u):$(id -g) \
-v $PWD:/src \
-w /src \
pressure-projections \
julia \
--project=/pressure-projections \
--startup-file=no \
--history-file=no \
main.jl
This should run an instance of the Julia REPL where each benchmark can be executed.
Tip
The flags ensure correct user permissions are set on the container-generated output files. Additionally, the container information is cleared at the end of the run.
Setup the right versions and proper environment to run the scripts by following along the links,
- Install Julia (
v1.11.0
) (not described here) - Install Dependencies
Tip
If juliaup
is available (recommended), the right version can be installed simply by,
juliaup add 1.11.0
Tip
If you already have installed Julia before, verify the version you have by,
julia -e 'using InteractiveUtils; versioninfo()'
Install relevant dependencies to ensure proper environment,
julia +1.11.0 --project=. -e "using Pkg; Pkg.instantiate();"
Each benchmark can be run independently in its respective folder.
Alternatively, an automated script main.jl
is provided to run all the benchmarks,
julia +1.11.0 --project=. main.jl
If you intend to develop the source code without modifying/installing any dependencies on your host computer, you can make use of development containers for setting up the requisite environment.
A specification file .devcontainer.json
is provided for building the devcontainer and can be utilized by supporting editors.
Necessary tools :
- Docker Engine (tested with
27.3.1
), - Visual Studio Code with Dev Containers extension (support since 2019. Tested with version
1.94.2
).
Start VS Code, run the "Dev Containers: Open Folder in Container..." command from the Command Palette (F1), and select the project folder. While done for the first time, this should start building the container and can take a while (~5 min) and subsequently open the project within the container. The build is cached for subsequent runs and should be fairly quick thereon.
Proceed to running the benchmarks.