The provided code refers to the paper Space-time formulation, discretization, and computational performance studies for phase-field fracture optimal control problems: reproduction code Section 5.1.1 published in 2022. The code we provide is completely novel and offers a concrete implementation of the mathematics developed in the paper, wherein no implementation aspects were covered.
The provided codebase is designed to solve phase-field fracture optimal control problems, wherein the goal is to achieve a desired fracture in a brittle material thorugh the application of external forces. This algorithmic framework was developed alongside our recent publication [1] and enables the accurate and efficient simulation of phase-field optimal control problems in a space-time fashion. In this example, the fracture is controlled through Neumann boundary conditions, and the cost functioncal tracks the distance between. Our code is based on the open source libraries DOpElib [2] and deal.II [3].
-
Install deal.II 9.5.1 via www.dealii.org
Download: https://www.dealii.org/download.html
Installation instructions: https://www.dealii.org/current/readme.html -
Install DOpElib via http://www.dopelib.net
Download: https://github.com/winnifried/dopelib
Installation instructions: https://winnifried.github.io/dopelib/documentation.html in Chapter 2 of the *.pdf manual. -
Please put the current code into some new folder on your machine.
Follow instructions from DOpElib *.pdf manual in Chapter 4 (i.e, Section 4.4 Creating new examples) to set up all environment variables (for finding deal.II and DOpElib) correctly.
Then: build, compile, run as described in Section 4.4 of the dopelib manual. To this end, building and compiling yields the executable JCP_5_1_1 that can be run in the (Linux) terminal via ./JCP_5_1_1 by taking implicitly the parameter file dope.prm into account. For additional information you can also check the workflow script. -
The results of this code (see local folder Results/ (this name given in dope.prm (bottom), which can be thus changed when multiple simulations shall be run simultaneously) ) should then reproduce Example 1 (Section 5.1.1) of Khimin et al., JCP, 2022. To compare the terminal output of the current implementation with own runs, the log file dope_Aug_12_2024.log can be used.
As the first steps, we recommend to read [1] first in order to understand the algorithmic background. Next, C++ knowledge in order to handle DOpElib and deal.II is required. Afterwards, the point of departure is main.cc. Therein, all include files from DOpElib and deal.II are taken as well as all the basic functionality is set up. The runtime parameters are adjusted in dope.prm. Running the code follows with the instructions previously given.
The project is automatically tested in the CI workflow, triggered by pushes or pull requests to the main branch. The workflow consists of three jobs: cache-dealii, install-dopelib, and build-and-test, all running on a Rocky Linux container. The cache-dealii job installs necessary dependencies and builds deal.II, caching the results for future use. The install-dopelib job installs DOpElib and depends on the deal.II cache, while the build-and-test job compiles the phase-field fracture project and runs the test script, uploading the test output log as an artifact for further analysis.
main.cc: In this file, first deal.II and DOpElib libraries are included. Then, local files such as localpde_eta.h, localfunctional.h, functionals.h, and my_functions.h are included. Then, various initialization take place such as DoFHandler, finite elements, quadrature rules, sparsity patterns, FunctionalInterface, OptProblemContainer, StateProblem, time stepping scheme, InstatOptProblemContainer, Integrator containers, linear solvers, nonlinear solvers, InstatStepModifiedNewtonSolver, and finally the reduced Newton algorithm for solving the overall optimization loop. Also, runtime parameters are read in from dope.prm. All functionalities are initialized and a final for-loop of the optimization algorithm is designed.
dope.prm: This is the runtime parameter file. Therein, global and local parameters can be adjusted without compiling the code again. These values are model, regularization, material, numerical, optimization parameters. Moreover, the output directory can be chosen.
unit_slit.inp: This is the finite element mesh file.
localpde_eta.h: In this file, the actual model, i.e., PDE system is implemented. Here, it is a quasi-static phase-field fracture system with two unknowns: vector-valued displacements and a scalar-valued smooth indicator function. The latter is subject to an inequality constraint in time, i.e., crack irreversibility. This is treated with the help of simple penalization.
localfunctional.h: In this file, the optimization objective is implemented in terms of the cost functional.
functionals.h: In this file, additional output functionals are implemented, so-called quantities of interest that are specifically interesting to be observed from an physics or engineering point of view.
my_functions.h: In this file, problem-specific functions such as non-homogeneous Dirichlet boundary conditions are implemented.
instat_step_modified_newtonsolver.h: This file directly derived from the main DOpElib library, but modified for the purpose of this phase_field_fracture_optimal_control library.
run_tests.sh: This is a script which executes ./JCP_5_1_1 and is called by the workflow script.
For contributing to this library, please see here.
The license is GNU LESSER GENERAL PUBLIC LICENSE (LGPL) Version 2.1. Detailed information can be found here.
[1] Denis Khimin, Marc C. Steinbach, Thomas Wick; Space-time formulation, discretization, and computational performance studies for phase-field fracture optimal control problems, Journal of Computational Physics (JCP), Vol. 470, 2022.
[2] Christian Goll, Thomas Wick, Winnifried Wollner; DOpElib: Differential Equations and Optimization Environment; A Goal Oriented Software Library for Solving PDEs and Optimization Problems with PDEs, Archive of Numerical Software (ANS), Vol. 5(2), pp. 1-14, 2017.
[3] Daniel Arndt, Wolfgang Bangerth, Maximilian Bergbauer, Marco Feder, Marc Fehling, Johannes Heinz, Timo Heister, Luca Heltai, Martin Kronbichler, Matthias Maier, Peter Munch, Jean-Paul Pelteret, Bruno Turcksin, David Wells, Stefano Zampini. The deal.II Library, Version 9.5, Journal of Numerical Mathematics, vol. 31, no. 3, pages 231-246, 2023.