Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implemented changes to move to deal.II version 9.6.0 #55

Merged
merged 5 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# The clang-format (Clang 11) style file used by deal.II.
# The clang-format (Clang 16) style file used by deal.II.
#

AccessModifierOffset: -2
Expand Down Expand Up @@ -160,6 +160,8 @@ PointerAlignment: Right
ReflowComments: true
CommentPragmas: '( \| |\*--|<li>|@ref | @p |@param |@name |@returns |@warning |@ingroup |@author |@date |@related |@relates |@relatesalso |@deprecated |@image |@return |@brief |@attention |@copydoc |@addtogroup |@todo |@tparam |@see |@note |@skip |@skipline |@until |@line |@dontinclude |@include)'

QualifierAlignment: Left

SortIncludes: true
SortUsingDeclarations: true

Expand All @@ -175,7 +177,7 @@ SpacesInContainerLiterals: false
SpacesInParentheses: false
SpacesInSquareBrackets: false

Standard: Cpp11
Standard: c++20

TabWidth: 2

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/indentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:

runs-on: ubuntu-latest
container:
image: dealii/dealii:v9.5.0-jammy
image: dealii/dealii:v9.6.0-jammy
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: dealii/dealii:v9.5.0-jammy
image: dealii/dealii:v9.6.0-jammy
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

steps:
Expand All @@ -32,7 +32,7 @@ jobs:
runs-on: ubuntu-latest

container:
image: dealii/dealii:v9.5.0-jammy
image: dealii/dealii:v9.6.0-jammy
options: --user root --env OMPI_ALLOW_RUN_AS_ROOT=1 --env OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

steps:
Expand Down
5 changes: 2 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
##
# CMake script for large project, with one executable
# and a library of objects, optionally
# depending on deal2lkit.
# and a library of objects
#
# The structure of the directory is assumed to be:
# ./source: containing implementations and one file with "int main()"
Expand Down Expand Up @@ -38,7 +37,7 @@ ENDIF()

CMAKE_MINIMUM_REQUIRED(VERSION 3.13.4)

FIND_PACKAGE(deal.II 9.5 REQUIRED
FIND_PACKAGE(deal.II 9.5.0 REQUIRED
HINTS ${deal.II_DIR} ${DEAL_II_DIR} ../ ../../ $ENV{DEAL_II_DIR}
)

Expand Down
174 changes: 81 additions & 93 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
</a>
</p>

# pi-BEM: Parallel BEM Solver
# pi-BEM: Parallel BEM Solver

[![Build Status](https://travis-ci.org/mathLab/pi-BEM.svg?branch=master)](https://travis-ci.org/mathLab/pi-BEM)

Copyright (C) 2015 -- 2019 by Nicola Giuliani (1), Andrea Mola (2) and Luca Heltai (2)

(1) Scuola Internazionale Superiore di Studi Avanzati E-mail: [email protected]
(1) Scuola Internazionale Superiore di Studi Avanzati E-mail: <[email protected]>

(2) Scuola Internazionale Superiore di Studi Avanzati E-mail: [email protected]
(2) Scuola Internazionale Superiore di Studi Avanzati E-mail: <[email protected]>

(3) Scuola Internazionale Superiore di Studi Avanzati E-mail: [email protected]
(3) Scuola Internazionale Superiore di Studi Avanzati E-mail: <[email protected]>

The library represents a parallel solver for the Laplace equation through Boundary Element Methods. We have developed the software in C++ on top of many high performance libraries, the [deal.II](https://github.com/dealii/dealii) library for Finite Element Handling, the [METIS](http://glaros.dtc.umn.edu/gkhome/metis/metis/download) project and [Trilinos](https://trilinos.org/) library for automatic Workload balance, [OpenCASCADE](https://www.opencascade.com/) for CAD integration, and [deal2lkit](https://github.com/luca-heltai/deal2lkit) for parameter handling.
The library represents a parallel solver for the Laplace equation through Boundary Element Methods. We have developed the software in C++ on top of many high performance libraries, the [deal.II](https://github.com/dealii/dealii) library for Finite Element Handling, the [METIS](http://glaros.dtc.umn.edu/gkhome/metis/metis/download) project and [Trilinos](https://trilinos.org/) library for automatic Workload balance, and [OpenCASCADE](https://www.opencascade.com/) for CAD integration.

## Provided features

Expand All @@ -32,131 +32,125 @@ We provide the following capabilities
- Hybrid Distributed (MPI) - Shared (Intel Threaded Building Block) memory parallelisation for the BEM-FMM code
- Recovery of both primal (potential) and dual (potential normal derivative) unknowns.
- L2 projection of the full 3D potential gradient for post processing.
- Extensive tuning via parameter file using the [deal2lkit](https://github.com/mathLab/deal2lkit) library

- Extensive tuning via parameter file using.

## Code Structure

We have subdivided the code in main classes to handle the many different aspects of a complete BEM simulation.

- Driver. This class is in charge of organising the overall BEM simulation. It has interfaces with all the other classes in order to perform a complete simulation.
- ComputationalDomain. This class handles, and provides to the other classes, ONLY the geometry of the problem. In particular
- it handles the domain decomposition using a graph partitioning tool (METIS);
- it reads the domain from an external file.
- it handles the domain decomposition using a graph partitioning tool (METIS);
- it reads the domain from an external file.
- BoundaryCondition. The class handles the boundary conditions. In particular
- it reads the boundary conditions for the potential and its normal derivative;
- given the peculiarities of the BEM, the boundary conditions represent the actual unknowns, thus it creates the vectors containing the two variables and fills them with the proper data;
- it performs the error analysis on both unknowns.
- it reads the boundary conditions for the potential and its normal derivative;
- given the peculiarities of the BEM, the boundary conditions represent the actual unknowns, thus it creates the vectors containing the two variables and fills them with the proper data;
- it performs the error analysis on both unknowns.

- BEMProblem. This class is the core of the BEM simulation
- it receives the variables vector filled in with the proper boundary condition;
- it creates the codimension 1 functional space setting up the BEM;
- it solves the system using a preconditioned parallel GMRES solver;
- it eventually interacts with the FMM accelerator.
- it receives the variables vector filled in with the proper boundary condition;
- it creates the codimension 1 functional space setting up the BEM;
- it solves the system using a preconditioned parallel GMRES solver;
- it eventually interacts with the FMM accelerator.
- BEMFMA. This class handles the accelerator, in particular
- it sets up an hierarchical 3D space subdivision (octree);
- it receives two distributed vectors representing the unknowns and performs a full FMM matrix vector product.
- it sets up an hierarchical 3D space subdivision (octree);
- it receives two distributed vectors representing the unknowns and performs a full FMM matrix vector product.

## Install Procedure using CANDI

To install from scratch all the needed library you can look to the automatic installation procedure provided by [CANDI](https://github.com/koecher/candi) developed Uwe Köcher.

## Install Procedure using spack

Just follow the [instructions](https://github.com/dealii/dealii/wiki/deal.II-in-Spack) to install dealii@develop using spack.

## Install Procedure using Docker
We provide the possibility of using Docker as a tool to provide a fully operational environment for our library. To use such tool you need to install Docker following the [instructions](https://docs.docker.com/engine/installation/) provided by its authors. Then you can execute the following command line instruction

docker run -v `pwd`:/pwd_to_your_own_directory/ -i -t mathlab/deal2lkit:latest bash
We provide the possibility of using Docker as a tool to provide a fully operational environment for our library. To use such tool you need to install Docker following the [instructions](https://docs.docker.com/engine/installation/) provided by its authors. Then you can execute the following command line instruction

docker run -v `pwd`:/pwd_to_your_own_directory/ -i -t dealii/dealii:v9.6.0-jammy bash

to retrieve the environment. In such a shell you can easily compile the pi-BEM library following its own instructions.

## Install Procedure from scratch
In order to successfully compile the code you need

- to install the Trilinos and Metis wrappers of the library, see the official [instructions](https://www.dealii.org/developer/readme.html)
- to install the [deal.II](https://github.com/dealii/dealii) library allowing both for multiprocessors and multithreaded environment.
- to install the [deal2lkit](https://github.com/mathLab/deal2lkit) library allowing both for multiprocessors and multithreaded environment.

In order to successfully compile the code you need

- to install the Trilinos and Metis wrappers of the library, see the official [instructions](https://www.dealii.org/developer/readme.html)
- to install the [deal.II](https://github.com/dealii/dealii) library allowing both for multiprocessors and multithreaded environment.

### deal.II Installation procedure
Follow the detailed [instruction](https://www.dealii.org/developer/readme.html) to install deal with METIS and Trilinos wrappers. We highlight that in order to fully exploit pi-BEM you need to properly install the following additional packages: MPI, TBB, METIS, TRILINOS ans OPENCASCADE. For more detailed instruction you can look to the the deal.ii install procedures. In the following we provide an example of the installation of all the proper packages.

Follow the detailed [instruction](https://www.dealii.org/developer/readme.html) to install deal with METIS and Trilinos wrappers. We highlight that in order to fully exploit pi-BEM you need to properly install the following additional packages: MPI, TBB, METIS, TRILINOS ans OPENCASCADE. For more detailed instruction you can look to the the deal.ii install procedures. In the following we provide an example of the installation of all the proper packages.

### OpenCASCADE Installation procedure
- Download the latest version at [OpenCASCADE](https://github.com/tpaviot/oce)
- Follow the instructions

- Download the latest version at [OpenCASCADE](https://github.com/tpaviot/oce)
- Follow the instructions

### METIS-PARMETIS Installation procedure

- Download the latest version at [METIS](http://glaros.dtc.umn.edu/gkhome/metis/metis/download)
- Follow the [instructions](http://glaros.dtc.umn.edu/gkhome/metis/metis/download) for the correct installation of the package


### Trilinos Installation procedure

- Download the latest version at [Trilinos](https://trilinos.org/download/)
- This is a possible configuration file

cmake -D Trilinos_ENABLE_OPTIONAL_PACKAGES:BOOL=ON \
-D Trilinos_ENABLE_ALL_PACKAGES:BOOL=ON \
-D CMAKE_CXX_FLAGS:STRING="-O3" \
-D CMAKE_C_FLAGS:STRING="-O3" \
-D CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE \
-D Trilinos_VERBOSE_CONFIGURE:BOOL=FALSE \
-D TPL_ENABLE_MPI:BOOL=ON \
-D CMAKE_BUILD_TYPE:STRING=RELEASE \
-D Trilinos_ENABLE_Fortran:BOOL=ON \
-D BLAS_LIBRARY_NAMES:STRING="blas" \
-D BLAS_LIBRARY_DIRS:PATH=/usr/lib/libblas/ \
-D TPL_BLAS_LIBRARIES:PATH=/usr/lib/libblas/ \
-D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING="" \
-D CMAKE_INSTALL_PREFIX:PATH=/usr/local/ \
-D BUILD_SHARED_LIBS:BOOL=ON ../
make install
cmake -D Trilinos_ENABLE_OPTIONAL_PACKAGES:BOOL=ON \
-D Trilinos_ENABLE_ALL_PACKAGES:BOOL=ON \
-D CMAKE_CXX_FLAGS:STRING="-O3" \
-D CMAKE_C_FLAGS:STRING="-O3" \
-D CMAKE_VERBOSE_MAKEFILE:BOOL=FALSE \
-D Trilinos_VERBOSE_CONFIGURE:BOOL=FALSE \
-D TPL_ENABLE_MPI:BOOL=ON \
-D CMAKE_BUILD_TYPE:STRING=RELEASE \
-D Trilinos_ENABLE_Fortran:BOOL=ON \
-D BLAS_LIBRARY_NAMES:STRING="blas" \
-D BLAS_LIBRARY_DIRS:PATH=/usr/lib/libblas/ \
-D TPL_BLAS_LIBRARIES:PATH=/usr/lib/libblas/ \
-D Trilinos_WARNINGS_AS_ERRORS_FLAGS:STRING="" \
-D CMAKE_INSTALL_PREFIX:PATH=/usr/local/ \
-D BUILD_SHARED_LIBS:BOOL=ON ../
make install

- if some packages create conflicts they can be disabled as seen on the Trilinos webpage





### deal2lkit Installation procedure
Follow the detailed [instruction](https://https://github.com/mathLab/deal2lkit) to install deal2lkit.


### pi-BEM Installation procedure

Then you can clone the repository and compile it

git clone https://github.com/mathLab/pi-BEM.git
cd pi-BEM
mkdir build
cd build
cmake ../
make -j4
git clone <https://github.com/mathLab/pi-BEM.git>
cd pi-BEM
mkdir build
cd build
cmake ../
make -j4

After you have compiled your application, you can run
After you have compiled your application, you can run

make test
make test

or
ctest

ctest

to start the testsuite.

Take a look at
https://www.dealii.org/developer/developers/testsuite.html for more
<https://www.dealii.org/developer/developers/testsuite.html> for more
information on how to create tests and add categories of tests.

If you want you can run a preliminary execution in the build library typing

mpirun -np 1 bem_fma_2d

this will automatically generate the parameter file for the bi-dimensional run while

mpirun -np 1 bem_fma_3d

mpirun -np 1 bem_fma_2d

this will automatically generate the parameter file for the bi-dimensional run while

mpirun -np 1 bem_fma_3d

will create a proper parameter file for a 3 dimensional simulation.

# Notice to developers
Expand All @@ -165,34 +159,28 @@ Before making a pull request, please make sure you run the script

./scripts/indent

from the base directory of this project, to ensure that no random
from the base directory of this project, to ensure that no random
white space changes are inserted in the repository.

The script requires Artistic Style Version 2.04 (astyle) to work
properly.
The script requires `clang-format` version 16.0.6 to work properly.

# Cite this work

If you use this software, please consider citing the following work:

@article{GiulianiMolaHeltai2018,
doi = {10.1016/j.advengsoft.2018.03.008},
url = {https://doi.org/10.1016/j.advengsoft.2018.03.008},
year = {2018},
month = {jul},
publisher = {Elsevier {BV}},
volume = {121},
pages = {39--58},
author = {Nicola Giuliani and Andrea Mola and Luca Heltai},
title = {$\uppi$ - {BEM} : A flexible parallel implementation for adaptive, geometry aware, and high order boundary element methods},
journal = {Advances in Engineering Software}
}



#Licence
@article{GiulianiMolaHeltai2018,
doi = {10.1016/j.advengsoft.2018.03.008},
url = {<https://doi.org/10.1016/j.advengsoft.2018.03.008}>,
year = {2018},
month = {jul},
publisher = {Elsevier {BV}},
volume = {121},
pages = {39--58},
author = {Nicola Giuliani and Andrea Mola and Luca Heltai},
title = {$\uppi$ - {BEM} : A flexible parallel implementation for adaptive, geometry aware, and high order boundary element methods},
journal = {Advances in Engineering Software}
}

# Licence

Please see the file [LICENSE](https://github.com/mathLab/pi-BEM/blob/master/LICENSE) for details



2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.5.0
9.6.0
2 changes: 1 addition & 1 deletion docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM dealii/dealii:v9.5.0-jammy
FROM dealii/dealii:v9.6.0-jammy

# pi-BEM master image
RUN git clone https://github.com/mathLab/pi-BEM/ &&\
Expand Down
12 changes: 6 additions & 6 deletions include/bem_fma.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,10 @@ class BEMFMA : public ParameterAcceptor
/// Mapping in the BEMFMA class. It also sets up some useful vector for,
/// mixed boundary conditions and double nodes handling.
void
init_fma(const DoFHandler<dim - 1, dim> & input_dh,
init_fma(const DoFHandler<dim - 1, dim> &input_dh,
const std::vector<std::set<types::global_dof_index>> &db_in,
const TrilinosWrappers::MPI::Vector & input_sn,
const Mapping<dim - 1, dim> & input_mapping =
const TrilinosWrappers::MPI::Vector &input_sn,
const Mapping<dim - 1, dim> &input_mapping =
StaticMappingQ1<dim - 1, dim>::mapping,
unsigned int quad_order = 4,
unsigned int sing_quad_order = 5);
Expand Down Expand Up @@ -173,8 +173,8 @@ class BEMFMA : public ParameterAcceptor
multipole_matr_vect_products(
const TrilinosWrappers::MPI::Vector &phi_values,
const TrilinosWrappers::MPI::Vector &dphi_dn_values,
TrilinosWrappers::MPI::Vector & matrVectProdN,
TrilinosWrappers::MPI::Vector & matrVectProdD) const;
TrilinosWrappers::MPI::Vector &matrVectProdN,
TrilinosWrappers::MPI::Vector &matrVectProdD) const;


// void compute_m2l_flags();
Expand Down Expand Up @@ -209,7 +209,7 @@ class BEMFMA : public ParameterAcceptor
/// architectures.
TrilinosWrappers::PreconditionILU &
FMA_preconditioner(const TrilinosWrappers::MPI::Vector &alpha,
AffineConstraints<double> & c);
AffineConstraints<double> &c);

protected:
/// Three pointers to the problem parameters to be set equal to
Expand Down
Loading
Loading