Build and Run

Requirements

Required:

  • CMake >= 3.10

  • a C++ compiler supported by your deal.II build

  • deal.II compatible with the APIs used by this project

Optional:

  • Trilinos or PETSc as enabled in deal.II

  • OpenMP

  • GoogleTest

  • OpenCASCADE and HDF5 for selected features

  • lib1dsolver for coupled 3D/1D executables

Build

mkdir -p build
cd build
cmake -DDEAL_II_DIR=/path/to/deal.II ..
cmake --build . -j

Executables are generated from files in apps/app_*.cc, for example elasticity, laplacian, reduced_poisson, and coupled_elasticity.

Run

Typical single-run pattern:

./build/elasticity path/to/input.prm

or

./build/laplacian path/to/input.prm

For coupled workflows, inspect the corresponding apps/app_*.cc entry point and the matching files under prms/ or benchmarks/.

Coupled 3D/1D Workflow

(app_coupled_elasticity.cc) that were previously in the main README.md.

Install FVM (1D solver)

  1. Clone the FVM repository.

  2. Start a container with deal.II:

docker run -ti -v ./:/fvm --platform linux/amd64 dealii/dealii:v9.6.0-jammy
  1. Inside the container:

cd /fvm/
make -f MakefileGCCDesktop clean all

Compile the coupled code

Build with OpenMP enabled (needed by the 1D code):

cmake -DCMAKE_CXX_FLAGS=-fopenmp .
cd build
ninja -jX

where X is the number of processes used for compilation.

Run

For parallel runs:

export OMP_NUM_THREADS=1
mpirun -np n ./build/coupled_elasticity_debug <path_to_input_3d> <path_to_input_1d> <couplingSampling> <couplingStart> 0

Notes:

  • To run only the 1D simulation, set couplingStart to 100.

  • To run only the 3D simulation, provide only <path_to_input_3d>.

Legacy note

An observed compile issue (invalid template argument) was historically worked around by changing include order in app_* files.