Skip to content

Parallel Vibro-Acoustic Solver#240

Merged
masterleinad merged 1 commit into
dealii:masterfrom
Andiiiiiii:parallel-vibroacoustic-solver
Apr 30, 2026
Merged

Parallel Vibro-Acoustic Solver#240
masterleinad merged 1 commit into
dealii:masterfrom
Andiiiiiii:parallel-vibroacoustic-solver

Conversation

@Andiiiiiii
Copy link
Copy Markdown

Add Parallel_Vibro-Acoustic_Solver to code gallery

@blaisb
Copy link
Copy Markdown
Member

blaisb commented Apr 21, 2026

Dear @Andiiiiiii. Thank you for your contribution. Could you write a commit message that explains a bit the target of this software? What does it do and accomplish as well as provide some context. Furthermore, you seem to have committed over 500+ .vtu files. We do not archives results with the code gallery software, but just the software itself. Could you please remove those from your pull request? Cheers

@Andiiiiiii
Copy link
Copy Markdown
Author

Dear @blaisb , thank you very much for reviewing my contribution! As requested, I removed the vtu files and added a short commit message describing what this code does. In addition, all of the equations and the problem solved is extensively described in the readme file. Thanks again for reviewing!

Copy link
Copy Markdown
Member

@bangerth bangerth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool -- I love these sorts of applications!

I have a couple of comments, but nothing big. If you have addressed everything, please squash all your commits into one and let us know!

Comment thread Parallel_Vibro-Acoustic_Solver/Readme.md Outdated
Elastodynamic equations
-----------------------

The behavior of the structure \f$ \Omega_S \f$ is modelled by means of the linear elastodynamic equations, which are given in strong form as
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below, would you mind turning \f$ into just $? We have scripts that make this translation automatically.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I implemented the changes

Comment on lines +128 to +130
In the figure below, the STL obtained in the present work is compared with measurement data from [3], with results from a commercial FEM software reported in [1] for a single random seed in the diffuse sound field, and with the corresponding average STL over multiple random seeds as presented in [2]. Overall, the STL calculations are sensitive to the choice of random seeds for the diffuse sound field.

![image](./doc/images/plot.png)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary for the code gallery program, but if you'd like to expand on this for my own education because I'm not an acoustical engineer (and likely neither are the other potential readers of this program): The STL is in the range of 30-60 dB. What does that actually means? Is that the attenuation? So 30 dB = 3 Bel attenuation = a factor of 1000 in energy = a factor of 30 in sound amplitude? That would be noticeable: a loud street at 100 dB down to a room with 70 dB (not quiet, but not loud either).

I imagine that some of the spikes are caused by resonances between the two volumes, right? If you happen to have png files that show the solution, that might be cool to add as well!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dear @bangerth thank you for your comment.
I added a png file showing the solution for the first resonance frequency of the concrete wall and the corresponding sound pressure. Moreover, I added the explanation in the Readme file, that "The STL ranges between 30 and 60 dB, which corresponds to the incident sound power being between $10^3$ and $10^6$ times greater than the transmitted sound power, depending on frequency."
You are right that the sound pressure is proportional to the square root of sound power. However, one cannot derive sound pressure solely from sound power/sound transmission loss. The sound pressure in the receiving room depends also on other parameters such as the sound absorption behavior of the room.
Therefore, the STL indicates how much sound power is reduced by the wall, but it does not directly determine the sound pressure level in the receiving room.

Ideas for extensions
--------------------

* Implementation of a QuadratureCache class to store calculated data for single cells to be reused for different frequencies, similar to that in [step-62](https://dealii.org/current/doxygen/deal.II/step_62.html).
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* Implementation of a QuadratureCache class to store calculated data for single cells to be reused for different frequencies, similar to that in [step-62](https://dealii.org/current/doxygen/deal.II/step_62.html).
* Implementation of a QuadratureCache class to store calculated data for single cells to be reused for different frequencies, similar to that in step-62.

@@ -0,0 +1,80 @@
50 51.4448
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might not be worth including this file. It is generated by the program, right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I removed it. Thanks for the hint.

Comment thread Parallel_Vibro-Acoustic_Solver/CMakeLists.txt Outdated
Comment thread Parallel_Vibro-Acoustic_Solver/CMakeLists.txt Outdated
@Andiiiiiii Andiiiiiii force-pushed the parallel-vibroacoustic-solver branch 2 times, most recently from 760792c to ac7b671 Compare April 25, 2026 09:43
@Andiiiiiii
Copy link
Copy Markdown
Author

Dear @bangerth @blaisb @marcfehling thank you for your comments and review.
I addressed all your comments and squashed all the commits into one.

Copy link
Copy Markdown
Member

@marcfehling marcfehling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your code does not seem to compile on our testers. Can you have a second look about the following:

2026-04-25T14:01:34.2273751Z [ 50%] Building CXX object CMakeFiles/parallel_vibroacoustic_solver.dir/parallel_vibroacoustic_solver.cc.o
2026-04-25T14:01:42.9022527Z /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc: In instantiation of ‘void VibroAcousticProblem::HarmonicResponse<dim>::solve() [with int dim = 3]’:
2026-04-25T14:01:42.9025323Z /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc:1243:5:   required from ‘void VibroAcousticProblem::HarmonicResponse<dim>::run(bool) [with int dim = 3]’
2026-04-25T14:01:42.9027180Z /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc:1328:30:   required from here
2026-04-25T14:01:42.9029417Z /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc:1184:38: error: no matching function for call to ‘dealii::PETScWrappers::SparseDirectMUMPS::SparseDirectMUMPS(dealii::SolverControl&, ompi_communicator_t*&)’
2026-04-25T14:01:42.9030641Z  1184 |     PETScWrappers::SparseDirectMUMPS solver(solver_control, mpi_communicator);
2026-04-25T14:01:42.9031097Z       |                                      ^~~~~~
2026-04-25T14:01:42.9031662Z In file included from /usr/local/include/deal.II/lac/generic_linear_algebra.h:28,
2026-04-25T14:01:42.9032287Z                  from /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc:31:
2026-04-25T14:01:42.9033575Z /usr/local/include/deal.II/lac/petsc_solver.h:781:5: note: candidate: ‘dealii::PETScWrappers::SparseDirectMUMPS::SparseDirectMUMPS(dealii::SolverControl&, const dealii::PETScWrappers::SparseDirectMUMPS::AdditionalData&)’
2026-04-25T14:01:42.9034466Z   781 |     SparseDirectMUMPS(SolverControl        &cn,
2026-04-25T14:01:42.9034741Z       |     ^~~~~~~~~~~~~~~~~
2026-04-25T14:01:42.9035703Z /usr/local/include/deal.II/lac/petsc_solver.h:782:45: note:   no known conversion for argument 2 from ‘MPI_Comm’ {aka ‘ompi_communicator_t*’} to ‘const dealii::PETScWrappers::SparseDirectMUMPS::AdditionalData&’
2026-04-25T14:01:42.9036575Z   782 |                       const AdditionalData &data = AdditionalData());
2026-04-25T14:01:42.9036919Z       |                       ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
2026-04-25T14:01:42.9037819Z /usr/local/include/deal.II/lac/petsc_solver.h:769:9: note: candidate: ‘dealii::PETScWrappers::SparseDirectMUMPS::SparseDirectMUMPS(const dealii::PETScWrappers::SparseDirectMUMPS&)’
2026-04-25T14:01:42.9038614Z   769 |   class SparseDirectMUMPS : public SolverBase
2026-04-25T14:01:42.9038878Z       |         ^~~~~~~~~~~~~~~~~
2026-04-25T14:01:42.9039271Z /usr/local/include/deal.II/lac/petsc_solver.h:769:9: note:   candidate expects 1 argument, 2 provided
2026-04-25T14:01:42.9040282Z /usr/local/include/deal.II/lac/petsc_solver.h:769:9: note: candidate: ‘dealii::PETScWrappers::SparseDirectMUMPS::SparseDirectMUMPS(dealii::PETScWrappers::SparseDirectMUMPS&&)’
2026-04-25T14:01:42.9041140Z /usr/local/include/deal.II/lac/petsc_solver.h:769:9: note:   candidate expects 1 argument, 2 provided
2026-04-25T14:01:42.9042796Z /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc: In instantiation of ‘void VibroAcousticProblem::HarmonicResponse<dim>::calculate_magnitude() [with int dim = 3]’:
2026-04-25T14:01:42.9044340Z /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc:1247:5:   required from ‘void VibroAcousticProblem::HarmonicResponse<dim>::run(bool) [with int dim = 3]’
2026-04-25T14:01:42.9045388Z /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc:1328:30:   required from here
2026-04-25T14:01:42.9046758Z /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc:1196:36: error: conversion from ‘dealii::PETScWrappers::internal::VectorReference’ to non-scalar type ‘const std::complex<double>’ requested
2026-04-25T14:01:42.9047748Z  1196 |         const std::complex<double> value = locally_relevant_solution[i];
2026-04-25T14:01:42.9048245Z       |                                    ^~~~~
2026-04-25T14:01:43.0747210Z /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc: In instantiation of ‘double VibroAcousticProblem::HarmonicResponse<dim>::cell_receiver_sound_power(const dealii::FEFaceValuesBase<dim>&, const dealii::FEFaceValuesBase<dim>&, const double&) [with int dim = 3]’:
2026-04-25T14:01:43.0750890Z /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc:1094:27:   required from ‘double VibroAcousticProblem::HarmonicResponse<dim>::receiver_sound_power() [with int dim = 3]’
2026-04-25T14:01:43.0753059Z /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc:1249:50:   required from ‘void VibroAcousticProblem::HarmonicResponse<dim>::run(bool) [with int dim = 3]’
2026-04-25T14:01:43.0754303Z /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc:1328:30:   required from here
2026-04-25T14:01:43.0755778Z /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc:1155:54: error: cannot convert ‘std::vector<std::complex<double> >’ to ‘std::vector<double, std::allocator<double> >&’
2026-04-25T14:01:43.0756751Z  1155 |                                                      local_dof_values_pressure);
2026-04-25T14:01:43.0757131Z       |                                                      ^~~~~~~~~~~~~~~~~~~~~~~~~
2026-04-25T14:01:43.0757457Z       |                                                      |
2026-04-25T14:01:43.0757806Z       |                                                      std::vector<std::complex<double> >
2026-04-25T14:01:43.0758252Z In file included from /usr/local/include/deal.II/fe/fe_values_base.h:33,
2026-04-25T14:01:43.0758674Z                  from /usr/local/include/deal.II/fe/fe_values.h:32,
2026-04-25T14:01:43.0759261Z                  from /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc:23:
2026-04-25T14:01:43.0761546Z /usr/local/include/deal.II/fe/fe_values_views.h:339:67: note:   initializing argument 2 of ‘void dealii::FEValuesViews::Scalar<dim, spacedim>::get_function_values(const dealii::ReadVector<Number>&, std::vector<typename dealii::ProductType<Number, double>::type>&) const [with Number = double; int dim = 3; int spacedim = 3; typename dealii::ProductType<Number, double>::type = double]’
2026-04-25T14:01:43.0763139Z   339 |                         std::vector<solution_value_type<Number>> &values) const;
2026-04-25T14:01:43.0763543Z       |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
2026-04-25T14:01:43.0765134Z /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc:1160:34: error: cannot convert ‘std::vector<dealii::Tensor<1, 3, std::complex<double> >, std::allocator<dealii::Tensor<1, 3, std::complex<double> > > >’ to ‘std::vector<dealii::Tensor<1, 3>, std::allocator<dealii::Tensor<1, 3> > >&’
2026-04-25T14:01:43.0766364Z  1160 |       locally_relevant_solution, local_dof_values_displacement);
2026-04-25T14:01:43.0767053Z       |                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2026-04-25T14:01:43.0767327Z       |                                  |
2026-04-25T14:01:43.0767831Z       |                                  std::vector<dealii::Tensor<1, 3, std::complex<double> >, std::allocator<dealii::Tensor<1, 3, std::complex<double> > > >
2026-04-25T14:01:43.0768427Z In file included from /usr/local/include/deal.II/fe/fe_values_base.h:33,
2026-04-25T14:01:43.0768801Z                  from /usr/local/include/deal.II/fe/fe_values.h:32,
2026-04-25T14:01:43.0769330Z                  from /__w/code-gallery/code-gallery/Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc:23:
2026-04-25T14:01:43.0771531Z /usr/local/include/deal.II/fe/fe_values_views.h:948:67: note:   initializing argument 2 of ‘void dealii::FEValuesViews::Vector<dim, spacedim>::get_function_values(const dealii::ReadVector<Number>&, std::vector<typename dealii::ProductType<Number, dealii::Tensor<1, spacedim> >::type>&) const [with Number = double; int dim = 3; int spacedim = 3; typename dealii::ProductType<Number, dealii::Tensor<1, spacedim> >::type = dealii::Tensor<1, 3>]’
2026-04-25T14:01:43.0773337Z   948 |                         std::vector<solution_value_type<Number>> &values) const;
2026-04-25T14:01:43.0773698Z       |                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
2026-04-25T14:01:44.3025897Z make[2]: *** [CMakeFiles/parallel_vibroacoustic_solver.dir/build.make:76: CMakeFiles/parallel_vibroacoustic_solver.dir/parallel_vibroacoustic_solver.cc.o] Error 1
2026-04-25T14:01:44.3027336Z make[1]: *** [CMakeFiles/Makefile2:93: CMakeFiles/parallel_vibroacoustic_solver.dir/all] Error 2
2026-04-25T14:01:44.3029041Z make: *** [Makefile:91: all] Error 2

Comment thread Parallel_Vibro-Acoustic_Solver/parallel_vibroacoustic_solver.cc Outdated
@Andiiiiiii Andiiiiiii force-pushed the parallel-vibroacoustic-solver branch from 8363893 to 628acdf Compare April 26, 2026 17:02
@Andiiiiiii
Copy link
Copy Markdown
Author

@marcfehling Thanks for your comment! The requested change is implemented. I tested the code with deal.ii 9.6.0 and on my machine it compiles and runs without errors.
To run the code, deal.II must be installed together with PETSc (configured with complex number support) and the p4est library (similar configuration as needed for step-62).
Thank you again for your patience!

@marcfehling
Copy link
Copy Markdown
Member

marcfehling commented Apr 27, 2026

To run the code, deal.II must be installed together with PETSc (configured with complex number support) and the p4est library (similar configuration as needed for step-62).

Thanks for clarifying! In that case, may I ask you to add a check into your CMakeLists.txt whether deal.II has been configured with p4est and PETSc with complex support? This way users will be warned about a configuration problem early and do not need to deal with hard-to-read error messages during compilation.

You can actually use the configuration from step-62, but skip the HDF5 part.

Our deal.II installation for continuous integration may not feature PETSc with complex support. We might need to skip your program for testing. Let's do this in a separate pull request if necessary.

@Andiiiiiii Andiiiiiii force-pushed the parallel-vibroacoustic-solver branch from 82092cb to 65f2282 Compare April 27, 2026 14:05
@Andiiiiiii
Copy link
Copy Markdown
Author

Dear @marcfehling Thanks, the configuration check in CMakeLists.txt indeed makes sense! I implemented the configuration check according to step-62.

@masterleinad
Copy link
Copy Markdown
Member

@Andiiiiiii Do you mind rebasing? That should hopefully make the CI pass.

@Andiiiiiii
Copy link
Copy Markdown
Author

@masterleinad I fetched and rebased onto origin/master, but the branch is already up to date, so no changes were applied.

@marcfehling
Copy link
Copy Markdown
Member

That should hopefully make the CI pass.

@masterleinad Our docker image does not come with a PETSc installation that features complex numbers. I suggest to manually exclude the test in our CI in a separate PR.

Update Parallel_Vibro-Acoustic_Solver/CMakeLists.txt
@Andiiiiiii Andiiiiiii force-pushed the parallel-vibroacoustic-solver branch from b2a260f to 91388c4 Compare April 30, 2026 15:45
@masterleinad masterleinad merged commit 537ea58 into dealii:master Apr 30, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants