Published December 2, 2022 | Version v2
Software Open

Codes for "A nonsmooth primal-dual method with interwoven PDE constraint solver"


  • 1. University of Jyväskylä


This is Julia code for the nonsmooth primal-dual method for PDE constraint problems explained in the manuscript found here:


The code was written for Julia 1.6.7 and package dependencies are available in the .toml-file. To run the code start Julia in the codes root folder (where this file is located) using the command

Julia --project=/path/to/code

where the /path/to/code is replaced by the actual location on your machine.

In the Julia REPL type ] to enter Pkg mode and type instantiate to download and install all the listed dependencies.

Running the Examples

There are 4 experiment files: Numerical0__.jl with __ being 1 or 2 and a or b. a corresponds to a coarse grid problem, b to a finer grid problem. To run an experiment pick one of the files.

Creating the near-convergence solution to compare against

  1. To perform the same experiment as in the manuscript you will first need to do the long run computation so we have a target solution to compare against. To do that open the Experiment file and edit lines 20-21. Set load_conv_x to false and create_conv_x to true.
  2. Then call Julia <file> replacing <file> with the .jl file you just edited.

Running the experiment

  1. After having done the long run above, edit the file's lines 20-21 again and set load_conv_x to true and create_conv_x to false.
  2. Then, as above, call Julia <file>, where <file> is the file you edited.
  3. The output can be found in the Numerical/vizY__/ folder where each run's results are sorted into a timestamped subdirectory.


Files (61.1 kB)

Name Size Download all
61.1 kB Preview Download

Additional details

Related works

Is cited by
Preprint: arXiv:2211.04807 (arXiv)


Decoupling preconditioners for non-smooth optimisation and inverse problems 320022
Academy of Finland
Decoupling preconditioners for non-smooth optimisation and inverse problems 314701
Academy of Finland