Skip to content

Commit

Permalink
Change the way dim and spacedim work.
Browse files Browse the repository at this point in the history
  • Loading branch information
luca-heltai committed Jun 23, 2024
1 parent 6d00429 commit 37253bc
Show file tree
Hide file tree
Showing 8 changed files with 2,249 additions and 1,151 deletions.
39 changes: 29 additions & 10 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,27 +86,46 @@
"random": "cpp",
"codecvt": "cpp",
"filesystem": "cpp",
"*.ipp": "cpp"
"*.ipp": "cpp",
"__bit_reference": "cpp",
"__config": "cpp",
"__hash_table": "cpp",
"__locale": "cpp",
"__node_handle": "cpp",
"__split_buffer": "cpp",
"__threading_support": "cpp",
"__tree": "cpp",
"__verbose_abort": "cpp",
"any": "cpp",
"charconv": "cpp",
"execution": "cpp",
"ios": "cpp",
"locale": "cpp",
"queue": "cpp",
"regex": "cpp",
"source_location": "cpp",
"span": "cpp",
"stack": "cpp"
},
"peacock.remoteColor": "#dd0531",
"peacock.color": "#215732",
"workbench.colorCustomizations": {
"activityBar.activeBackground": "#fa1b49",
"activityBar.activeBackground": "#2f7c47",
"activityBar.activeBorder": "#155e02",
"activityBar.background": "#fa1b49",
"activityBar.background": "#2f7c47",
"activityBar.foreground": "#e7e7e7",
"activityBar.inactiveForeground": "#e7e7e799",
"activityBarBadge.background": "#155e02",
"activityBarBadge.background": "#422c74",
"activityBarBadge.foreground": "#e7e7e7",
"sash.hoverBorder": "#fa1b49",
"statusBar.background": "#dd0531",
"sash.hoverBorder": "#2f7c47",
"statusBar.background": "#215732",
"statusBar.foreground": "#e7e7e7",
"statusBarItem.hoverBackground": "#fa1b49",
"statusBarItem.remoteBackground": "#dd0531",
"statusBarItem.hoverBackground": "#2f7c47",
"statusBarItem.remoteBackground": "#215732",
"statusBarItem.remoteForeground": "#e7e7e7",
"titleBar.activeBackground": "#dd0531",
"titleBar.activeBackground": "#215732",
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#dd053199",
"titleBar.inactiveBackground": "#21573299",
"titleBar.inactiveForeground": "#e7e7e799",
"commandCenter.border": "#e7e7e799"
},
Expand Down
72 changes: 37 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,23 @@ interaction problems: mathematical modeling and numerical approximation"**
| <!-- --> | <!-- --> |
| -- | -- |
| **Author** | Luca Heltai <[email protected]> |
| **GitHub Repository:** | https://github.com/luca-heltai/fsi-suite |
| **GitHub Pages:** | https://luca-heltai.github.io/fsi-suite/ |
| **GitHub Repository:** | <https://github.com/luca-heltai/fsi-suite> |
| **GitHub Pages:** | <https://luca-heltai.github.io/fsi-suite/> |
| **Licence:** | see the file [LICENCE.md](./LICENCE.md) |

## Course Introduction

Fluid-structure interaction (FSI) refers to the multiphysics coupling between
the laws that describe fluid dynamics and structural mechanics.
the laws that describe fluid dynamics and structural mechanics.

This page collects the material that I have used for a course given at Kaust
(https://www.kaust.edu.sa/en) during the spring semester of 2022.
(<https://www.kaust.edu.sa/en>) during the spring semester of 2022.

The course covers three main topics: i) basics of continuum mechanics, ii)
mathematical modeling of FSI problems, and iii) numerical implementations based
on the finite element method. Theoretical lectures are backed up by applied
laboratories based on the C++ language, using example codes developed with the
open source finite element library deal.II (www.dealii.org). I cover basic
open source finite element library deal.II (<www.dealii.org>). I cover basic
principles of continuum mechanics, discuss Lagrangian, Eulerian, and Arbitrary
Lagrangian-Eulerian formulations, and cover different coupling strategies, both
from the theoretical point of view, and with the aid of computational
Expand All @@ -32,8 +33,8 @@ finite element approximations for the solution of continuum mechanics problems,
including non-linear mechanics, computational fluid dynamics, and
fluid-structure-interaction problems.

A glimpse of the PDEs that are discussed in the course is given by the following
graph
A glimpse of the PDEs that are discussed in the course is given by the following
graph

@dotfile serial.dot width=100%

Expand All @@ -42,7 +43,7 @@ graph
The laboratory part should enable a PhD student working on numerical analysis
of PDEs to implement state-of-the-art adaptive finite element codes for FSI
problems, that run in parallel, using modern C++ libraries. The implementation
are based on the `deal.II` library (www.dealii.org).
are based on the `deal.II` library (<www.dealii.org>).

Main topics covered by these lectures:

Expand All @@ -57,27 +58,27 @@ Main topics covered by these lectures:
Continuous Integration Status
-----------------------------

Up to date online documentation for the codes used in the laboratories is here:
Up to date online documentation for the codes used in the laboratories is here:

https://luca-heltai.github.io/fsi-suite/
<https://luca-heltai.github.io/fsi-suite/>

| System | Status |
| ------ | ------- |
| ------ | ------- |
| **Continous Integration** | [![GitHub CI](https://github.com/luca-heltai/fsi-suite/actions/workflows/tests.yml/badge.svg)](https://github.com/luca-heltai/fsi-suite/actions/workflows/tests.yml) |
| **Docker** | [![github-docker](https://github.com/luca-heltai/fsi-suite/actions/workflows/docker.yml/badge.svg)](https://github.com/luca-heltai/fsi-suite/actions/workflows/docker.yml) |
| **Doxygen** | [![Doxygen](https://github.com/luca-heltai/fsi-suite/actions/workflows/doxygen.yml/badge.svg)](https://github.com/luca-heltai/fsi-suite/actions/workflows/doxygen.yml) |
| **Indent** | [![Indent](https://github.com/luca-heltai/fsi-suite/actions/workflows/indentation.yml/badge.svg)](https://github.com/luca-heltai/fsi-suite/actions/workflows/indentation.yml) |


## Useful links

One of my courses on theory and practice of finite elements:
- https://www.math.sissa.it/course/phd-course/theory-and-practice-finite-element-methods

- <https://www.math.sissa.it/course/phd-course/theory-and-practice-finite-element-methods>

Exceptional video lectures by Prof. Wolfgang Bangerth, that cover all the
things you will ever need for finite element programming.

- https://www.math.colostate.edu/~bangerth/videos.html
- <https://www.math.colostate.edu/~bangerth/videos.html>

## Quick start

Expand All @@ -94,23 +95,23 @@ you should see the following output:

Will run program-name with program-options, possibly via mpirun, passing -np N to mpirun.
Here is a list of programs you can run:
linear_elasticity.g mpi_stokes.g
distributed_lagrange mesh_handler poisson
distributed_lagrange.g mesh_handler.g poisson.g
dof_plotter mpi_linear_elasticity reduced_lagrange
dof_plotter.g mpi_linear_elasticity.g reduced_lagrange.g
fsi_test mpi_poisson stokes
fsi_test.g mpi_poisson.g stokes.g
linear_elasticity mpi_stokes
linear_elasticity.g mpi_stokes.g
distributed_lagrange mesh_handler poisson
distributed_lagrange.g mesh_handler.g poisson.g
dof_plotter mpi_linear_elasticity reduced_lagrange
dof_plotter.g mpi_linear_elasticity.g reduced_lagrange.g
fsi_test mpi_poisson stokes
fsi_test.g mpi_poisson.g stokes.g
linear_elasticity mpi_stokes

Programs ending with .g are compiled with debug symbols. To see help on how to run
any of the programs, add a -h flag at the end.

The above command will download the latest docker image from the `main` branch
of this repository (which is built and uploaded to
https://hub.docker.com/r/heltai/fsi-suite at every commit to master), mount the
<https://hub.docker.com/r/heltai/fsi-suite> at every commit to master), mount the
current directory, in a directory with the same path inside the container, and
the program you selected. For example,
the program you selected. For example,

./fsi-suite.sh -np 4 mpi_poisson.g

Expand All @@ -119,10 +120,10 @@ problem in parallel, using 4 processors. You can change grid, boundary
conditions, forcing terms, finite element spaces, etc. by editing the
configuration file which is created the first time you run the program, and then
passing it as an argument to the program itself, i.e., in the example above, the
parameter file that would be generated is `used_mpi_poisson.g_2d.prm`, which you
parameter file that would be generated is `used_mpi_poisson.g.prm`, which you
can edit and then pass as input to the program itself:

./fsi-suite.sh -np 4 mpi_poisson.g used_mpi_poisson.g_2d.prm
./fsi-suite.sh -np 4 mpi_poisson.g used_mpi_poisson.g.prm

If you want to read some documentation of what each parameter does and how it
works, you can call the program passing a non-existing parameter file:
Expand All @@ -143,7 +144,7 @@ works, you can call the program passing a non-existing parameter file:

The created parameter file will also contain documentation for each parameter.
Running again the same command will now use the parameter file that was just
created:
created:

./fsi-suite.sh -np 4 mpi_poisson.g my_test.prm

Expand All @@ -170,28 +171,29 @@ created:
| setup_system | 1 | 0.0124s | 18% |
| solve | 1 | 0.00547s | 7.8% |
+---------------------------------+-----------+------------+------------+

## Course program

A tentative detailed program is shown below
A tentative detailed program is shown below
(this will be updated during the course to reflect the actual course content)

1. Course introduction.
1. Course introduction.
- Motivating examples
- Basic principles and background knowledge.

2. Recap on Finite Element Methods
- Introduction to deal.II.

3. Basic principles of continuum mechanics
- conservation equations
3. Basic principles of continuum mechanics
- conservation equations
- constitutive equations
- kinematics
- transport theorems

3. Lagrangian formulation of continuum mechanics (solids).
- Static and compressible linear elasticity

4. Recap on mixed problems
4. Recap on mixed problems
- Static incompressible linear elasticity

5. Eulerian formulation of continuum mechanics
Expand All @@ -200,13 +202,13 @@ A tentative detailed program is shown below
6. Recap on time discretization schemes
- Time dependent Stokes problem
- Time dependent linear elasticity (wave equations)
7. Treating non-linearities

7. Treating non-linearities
- IMEX
- predictor corrector
- fixed point
- Newton

8. Navier-Stokes equations

9. Segregated coupling
Expand Down
55 changes: 24 additions & 31 deletions doc/01_design.dox
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
* library (https://github.com/mathLab/pi-DoMUS). After a couple of years of
* intense development, that project was abandoned as it became more and more
* difficult to maintain. That project relied eavily on a tool kit library,
* which we named deal2lkit (https://github.com/mathLab/deal2lkit) \cite
* SartoriGiulianiBardelloni-2018-a
* which we named deal2lkit (https://github.com/mathLab/deal2lkit)
* \cite SartoriGiulianiBardelloni-2018-a
*
* The deal2lkit library was a good starting point, but we quickly found out
* that the development of the deal.II library itself runs way faster than we
Expand All @@ -36,8 +36,8 @@
*
* SymbolicFunction, FunctionParser, Manifold, ParameterAcceptor,
* ParsedErrorTable, and the LinearOperator classes are some of the results of
* this effort, and are currently used widely by the deal.II community \cite
* HeltaiBangerthKronbichler-2021, \cite MaierBardelloniHeltai-2016-a.
* this effort, and are currently used widely by the deal.II community
* \cite HeltaiBangerthKronbichler-2021, \cite MaierBardelloniHeltai-2016-a.
*
* The task is not finished yet. It is painful to port code from user space into
* a large library. The documentation requirements are stringent, proper testing
Expand Down Expand Up @@ -90,14 +90,16 @@
*
* The deal.II library should be installed with the following options:
*
* - `DEAL_II_HAVE_CXX17=ON`
* - `DEAL_II_WITH_CGAL=ON`
* - `DEAL_II_WITH_MPI=ON`
* - `DEAL_II_WITH_MU_PARSER=ON`
* - `DEAL_II_WITH_OPENCASCADE=ON`
* - `DEAL_II_WITH_PETSC=ON`
* - `DEAL_II_WITH_TRILINOS=ON`
* - `DEAL_II_WITH_MU_PARSER=ON`
* - `DEAL_II_WITH_SUNDIALS=ON`
* - `DEAL_II_WITH_SYMENGINE=ON`
* - `DEAL_II_WITH_UMFPACK=ON`
* - `DEAL_II_WITH_SUNDIALS=ON`
* - `DEAL_II_HAVE_CXX17=ON`
*
* Once you have downloaded the code, you can configure and compile it using the
* following:
Expand Down Expand Up @@ -164,7 +166,7 @@
* The user entry point for each class is the method `run()`.
*
* The main functions in the @ref apps folder take care of parsing the command
* line, deducing from the command line (or from the name of the paramter file)
* line, deducing from the command line (or from parameter file itself)
* in what dimension and space dimension you want to run the code, and then they
* instantiate the specific class for the specific dimension and spacedimension
* combination, read parameters from the parameter file, and execute the `run()`
Expand All @@ -187,10 +189,7 @@
* -o, --output_prm_file <filename> Where to write the file containing the
* actual parameters used in this run of
* the program. It defaults to the string
* `used_./mesh_handler' followed by a
* string of the type '1d_2d' containing
* the dimension and the spacedimension at
* which the program was run if the input
* `used_program_name.prm' if the input
* parameter file is not specified,
* otherwise it defaults to the string
* `used_' followed by the name of the
Expand Down Expand Up @@ -226,35 +225,30 @@
* @section running Running a program of the FSI-suite
*
* Every program in the FSI-suite can be executed by calling it with
* arguments specifying the dimension and space dimension, or can deduce these
* numbers from the naming scheme of your parameter file. For example:
* arguments specifying the dimension and space dimension, or it can read these
* numbers from your parameter file. For example:
* @code{.sh}
* ./poisson -d=2 -s=3 -i=input.prm -o=output.prm
* @endcode
* will run the poisson problem in dimension 2 with spacedimension 3, reading
* options from the `input.prm` file in the current directory, and writing all
* used options in the `output.prm` file in the current directory.
*
* The same effect can be obtained by naming your parameter file in such a way
* that the filename contains the combination of dimension and spacedimension,
* or just one if they are the same. For example, the above example could have
* been achieved similarly by executing as:
* @code{.sh}
* ./poisson input_2d_3d.prm
* @endcode
* and an equivalent example running in two dimensions
* The same effect can be obtained by inserting in your parameter file the
* combination of dimension and spacedimension, i.e.,
*
* @code{.sh}
* ./poisson input_2d.prm
* # Listing of Parameters
* # ---------------------
* set dim = 1
* set spacedim = 2
* @endcode
*
* @warning If you specify the dimension (and/or the spacdimension) from the
* command line, and provide a parameter file as input that is named with a
* different combination, you will get an error message. Either do not name your
* file with `1d_2d`, and use `-d 2` and `-s 2`, or make sure that they are
* consistent:
* @code{.sh}
* ./poisson -d=2 input_2d.prm
* @endcode
* command line, and provide a parameter file as input that contains a different
* combination, you will get an error message. Either do not put the combination
* in your parameter file, or make sure that they are consistent with the
* command line options
*
* Notice that `input.prm` does not need to exist prior to executing the
* program. If it does not exist, the program will create it for you, print an
Expand All @@ -271,7 +265,6 @@
*
* Any parameter that you can change from the parameter files, can be changed
* also from the command line. The opposite is also true, with the exception of
* the dimension (`-d` or `-dim`), space dimension ('-s' or `-spacedim`), and
* the input and output parameter files (`-i` and `-o`), which do not have, in
* general, a correspondending entry in the parameter file itself.
*
Expand Down
8 changes: 4 additions & 4 deletions doc/parsed_tools.dox
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,10 @@
* 3. you always need to keep the two functions syncronized.
*
* Nothing difficult, but for large programs, with hundreds of paramters, this
* may become difficult. Building on top of \cite
* SartoriGiulianiBardelloni-2018-a, deal.II offers an alternative framework for
* the handling of parameter files and classes, based on the ParameterAcceptor
* class.
* may become difficult. Building on top of
* \cite SartoriGiulianiBardelloni-2018-a, deal.II offers an alternative
* framework for the handling of parameter files and classes, based on the
* ParameterAcceptor class.
*
* ParameterAcceptor provides a global subscription mechanism. Whenever an
* object of a class derived from ParameterAcceptor is constructed, a pointer to
Expand Down
Loading

0 comments on commit 37253bc

Please sign in to comment.