# Legacy DOLFIN

**URL:** https://fenicsproject.discourse.group/c/posts-relating-to-legacy-dolfin/16.md

[Latest](https://fenicsproject.discourse.group/latest.md) · [Categories](https://fenicsproject.discourse.group/categories.md) · [Tags](https://fenicsproject.discourse.group/tags.md)

---

## [About the Legacy DOLFIN category](https://fenicsproject.discourse.group/t/about-the-legacy-dolfin-category/13067)

<div class="topic-metadata">

**Author:** [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Replies:** 0

</div>

This category is for posts relating to Legacy DOLFIN (formerly known as DOLFIN, no longer maintained), which is hosted on bitbucket: Bitbucket. See: The new DOLFINx solver is now recommended over DOLFIN for rational fo…

---

## [Compute minimum and maximum values of expression over boundary](https://fenicsproject.discourse.group/t/compute-minimum-and-maximum-values-of-expression-over-boundary/19719)

<div class="topic-metadata">

**Author:** [@Babs](https://fenicsproject.discourse.group/u/Babs)\
**Replies:** 7\
**Last updated:** [June 4, 2026, 9:39am UTC](https://fenicsproject.discourse.group/t/compute-minimum-and-maximum-values-of-expression-over-boundary/19719 "2026-06-04T09:39:44Z")

</div>

Hello everyone, I was trying to define an expression that contains the normal n = FacetNormal(mesh). I need to compute the minimum and maximum values of the expression over a boundary region. I have tried with the follo…

---

## [Importing 3D mesh](https://fenicsproject.discourse.group/t/importing-3d-mesh/19341)

<div class="topic-metadata">

**Author:** [@Zeinab\_javid](https://fenicsproject.discourse.group/u/Zeinab_javid)\
**Replies:** 2\
**Last updated:** [February 5, 2026, 2:25pm UTC](https://fenicsproject.discourse.group/t/importing-3d-mesh/19341 "2026-02-05T14:25:11Z")

</div>

Hello, I have a Questions regarding import a 3D mesh into Fenics code from COMSOL I have a lattice cell and I set a Periodic Boundary conditions to this model, Now can I export the Periodic mesh into Fenics ?

---

## [Parallelizing Legacy Fenics Code](https://fenicsproject.discourse.group/t/parallelizing-legacy-fenics-code/18472)

<div class="topic-metadata">

**Author:** [@zaccandels](https://fenicsproject.discourse.group/u/zaccandels)\
**Replies:** 1\
**Last updated:** [December 16, 2025, 8:32am UTC](https://fenicsproject.discourse.group/t/parallelizing-legacy-fenics-code/18472 "2025-12-16T08:32:40Z")

</div>

Here I’m using FEniCS 2019.1.0. For the MWE pasted below, the performance I see upon executing the program using mpirun -np 4 python3 program.py is actually worse than when I run the program in serially. What do I have …

---

## [Pathological Asymmetry in Projected Function](https://fenicsproject.discourse.group/t/pathological-asymmetry-in-projected-function/18398)

<div class="topic-metadata">

**Author:** [@zaccandels](https://fenicsproject.discourse.group/u/zaccandels)\
**Replies:** 2\
**Last updated:** [November 26, 2025, 5:17pm UTC](https://fenicsproject.discourse.group/t/pathological-asymmetry-in-projected-function/18398 "2025-11-26T17:17:29Z")

</div>

First thing, I’m using FEniCS 2019.1.0. In the MWE pasted below, I initialize a function phi\_n by projecting the right-hand side of the equation \\phi(x,y) = 0.5 - 0.5 \\tanh\\biggl( 2 \\frac{ \\sqrt{ (x - x\_c)^2 + (y- y\_c)…

---

## [Set krylov linear solver paramters in newton solver in C++](https://fenicsproject.discourse.group/t/set-krylov-linear-solver-paramters-in-newton-solver-in-c/18362)

<div class="topic-metadata">

**Author:** [@Rafa](https://fenicsproject.discourse.group/u/Rafa)\
**Replies:** 4\
**Last updated:** [November 13, 2025, 1:36pm UTC](https://fenicsproject.discourse.group/t/set-krylov-linear-solver-paramters-in-newton-solver-in-c/18362 "2025-11-13T13:36:24Z")

</div>

Hi, I am working with FEniCS legacy (2019.1.0) in C++. I am solving a nonlinear problem with a Newton solver coupled with GMRES for the linear iterations between Newton steps. I would like to have more control over the …

---

## [Issue with assemble(inner(sig,sig)\*dx) in FEniCS Legacy (2019.1.0 vs 2019.2.0)](https://fenicsproject.discourse.group/t/issue-with-assemble-inner-sig-sig-dx-in-fenics-legacy-2019-1-0-vs-2019-2-0/17860)

<div class="topic-metadata">

**Author:** [@20230609](https://fenicsproject.discourse.group/u/20230609)\
**Replies:** 1\
**Last updated:** [July 2, 2025, 5:11am UTC](https://fenicsproject.discourse.group/t/issue-with-assemble-inner-sig-sig-dx-in-fenics-legacy-2019-1-0-vs-2019-2-0/17860 "2025-07-02T05:11:09Z")

</div>

I have encountered an issue when computing L2 norms for solution fields in different FEniCS Legacy installations. My flow problem employs mixed finite element spaces: a Discontinuous Galerkin (DG) element for variable D,…

---

## [Stop NonlinearVariationalSolver when reaching nan residual](https://fenicsproject.discourse.group/t/stop-nonlinearvariationalsolver-when-reaching-nan-residual/17710)

<div class="topic-metadata">

**Author:** [@Matheus-Janczkowski](https://fenicsproject.discourse.group/u/Matheus-Janczkowski)\
**Replies:** 0\
**Last updated:** [June 5, 2025, 8:37pm UTC](https://fenicsproject.discourse.group/t/stop-nonlinearvariationalsolver-when-reaching-nan-residual/17710 "2025-06-05T20:37:58Z")

</div>

I have a problem that, depending on material parameters, the simulation can diverge, getting nan residual. Is there any parameter that I can set to force the solver to stop when reaching nan? A maximum value of residual?…

---

## [How to apply boundary conditions to a single node in dolfin?](https://fenicsproject.discourse.group/t/how-to-apply-boundary-conditions-to-a-single-node-in-dolfin/17642)

<div class="topic-metadata">

**Author:** [@Matheus-Janczkowski](https://fenicsproject.discourse.group/u/Matheus-Janczkowski)\
**Replies:** 1\
**Last updated:** [May 21, 2025, 7:19pm UTC](https://fenicsproject.discourse.group/t/how-to-apply-boundary-conditions-to-a-single-node-in-dolfin/17642 "2025-05-21T19:19:49Z")

</div>

I have a list of DOFs of a node. How can I apply a Dirichlet BC to it using dolfin?

---

## [Boundary Conditions for Coupled Hyperbolic Equations for 1D Artery Flow](https://fenicsproject.discourse.group/t/boundary-conditions-for-coupled-hyperbolic-equations-for-1d-artery-flow/17531)

<div class="topic-metadata">

**Author:** [@scljb](https://fenicsproject.discourse.group/u/scljb)\
**Replies:** 1\
**Last updated:** [May 6, 2025, 8:25am UTC](https://fenicsproject.discourse.group/t/boundary-conditions-for-coupled-hyperbolic-equations-for-1d-artery-flow/17531 "2025-05-06T08:25:30Z")

</div>

Hello everyone, I am working on modelling arterial blood flow using 1D Navier-Stokes for flow compliant tubes. My full equations are: \\frac{ \\partial A }{ \\partial t } + \\frac{ \\partial Au }{ \\partial x } = 0 \\frac{ \\…

---

## [Unable to find entity in map, 3D mesh gmsh](https://fenicsproject.discourse.group/t/unable-to-find-entity-in-map-3d-mesh-gmsh/17356)

<div class="topic-metadata">

**Author:** [@Nathan\_Langlet](https://fenicsproject.discourse.group/u/Nathan_Langlet)\
**Replies:** 5\
**Last updated:** [April 2, 2025, 1:50pm UTC](https://fenicsproject.discourse.group/t/unable-to-find-entity-in-map-3d-mesh-gmsh/17356 "2025-04-02T13:50:10Z")

</div>

hello, I’m having a problem reading a 3d mesh created with GMSH using msh2xdmf.py (GitHub - floiseau/msh2xdmf: Converter from MSH mesh format to XDMF mesh format) or with Transitioning from mesh.xml to mesh.xdmf, from d…

---

## [Inaccurate solution in linear elasticity simulation with volume forces and quadrature elements(FEniCS 2019.1.0)](https://fenicsproject.discourse.group/t/inaccurate-solution-in-linear-elasticity-simulation-with-volume-forces-and-quadrature-elements-fenics-2019-1-0/17340)

<div class="topic-metadata">

**Author:** [@ExampleName](https://fenicsproject.discourse.group/u/ExampleName)\
**Replies:** 0\
**Last updated:** [March 31, 2025, 1:03pm UTC](https://fenicsproject.discourse.group/t/inaccurate-solution-in-linear-elasticity-simulation-with-volume-forces-and-quadrature-elements-fenics-2019-1-0/17340 "2025-03-31T13:03:11Z")

</div>

Hi everyone, I started working with fenics 2019.1.0 a few weeks ago. For my programming project I need to use quadrature elements. To illustrate my problem, I have created a small example that solves simple linear elast…

---

## [How to calculate the Laplacian of a known solution correctly?](https://fenicsproject.discourse.group/t/how-to-calculate-the-laplacian-of-a-known-solution-correctly/17278)

<div class="topic-metadata">

**Author:** [@C-Briddon](https://fenicsproject.discourse.group/u/C-Briddon)\
**Replies:** 5\
**Last updated:** [March 26, 2025, 11:07am UTC](https://fenicsproject.discourse.group/t/how-to-calculate-the-laplacian-of-a-known-solution-correctly/17278 "2025-03-26T11:07:43Z")

</div>

Hello. I am trying to make a function that takes a known solution and returns its Laplacian. The sig expression is there to make my 1D solution match the 3D one which is spherically symmetric. for a specified coordinate …

---

## [Handling the Finite Element Functions](https://fenicsproject.discourse.group/t/handling-the-finite-element-functions/17249)

<div class="topic-metadata">

**Author:** [@jheb](https://fenicsproject.discourse.group/u/jheb)\
**Replies:** 2\
**Last updated:** [March 20, 2025, 8:11pm UTC](https://fenicsproject.discourse.group/t/handling-the-finite-element-functions/17249 "2025-03-20T20:11:21Z")

</div>

Hi all, So if I have a mesh on my domain, and I’ve computed my stiffness and mass matrices, is there a way to get an expression for the finite element functions themselves at each mesh point so that I can manipulate the…

---

## [Separating optimization domain from the rest](https://fenicsproject.discourse.group/t/separating-optimization-domain-from-the-rest/17012)

<div class="topic-metadata">

**Author:** [@Nathan\_Langlet](https://fenicsproject.discourse.group/u/Nathan_Langlet)\
**Replies:** 4\
**Last updated:** [February 18, 2025, 12:45pm UTC](https://fenicsproject.discourse.group/t/separating-optimization-domain-from-the-rest/17012 "2025-02-18T12:45:07Z")

</div>

Hello, In the context of my thesis I am looking to perform Density Based topological optimisations for fluids using fenics 2019 and ipopt. I would like to be able to restrict the optimisation of my design variable alpha…

---

## [Projecting into a quadrature space](https://fenicsproject.discourse.group/t/projecting-into-a-quadrature-space/15797)

<div class="topic-metadata">

**Author:** [@GabrielBalaban](https://fenicsproject.discourse.group/u/GabrielBalaban)\
**Replies:** 9\
**Last updated:** [February 12, 2025, 7:30am UTC](https://fenicsproject.discourse.group/t/projecting-into-a-quadrature-space/15797 "2025-02-12T07:30:41Z")

</div>

I am struggling to project a function into a FunctionSpace of the “Quadrature” family in classic legacy dolfin. Has anyone had any experience with this? import dolfin as df mesh = df.UnitSquareMesh(10, 10) # Step 1: C…

---

## [Eigenvalues of the Laplacian on the Sphere](https://fenicsproject.discourse.group/t/eigenvalues-of-the-laplacian-on-the-sphere/16510)

<div class="topic-metadata">

**Author:** [@jheb](https://fenicsproject.discourse.group/u/jheb)\
**Replies:** 1\
**Last updated:** [December 16, 2024, 8:13am UTC](https://fenicsproject.discourse.group/t/eigenvalues-of-the-laplacian-on-the-sphere/16510 "2024-12-16T08:13:08Z")

</div>

Hi all, I am attempting to use DOLFIN to approximate the eigenvalues of the Laplacian on a sphere. I am trying to do this by calculating the eigenvalues on a 2pi x pi rectangle, with periodic boundary conditions on the …

---

## [Helmholtz equation on a curved manifold](https://fenicsproject.discourse.group/t/helmholtz-equation-on-a-curved-manifold/16364)

<div class="topic-metadata">

**Author:** [@Mathieu](https://fenicsproject.discourse.group/u/Mathieu)\
**Replies:** 8\
**Last updated:** [November 29, 2024, 2:01pm UTC](https://fenicsproject.discourse.group/t/helmholtz-equation-on-a-curved-manifold/16364 "2024-11-29T14:01:34Z")

</div>

Hi everyone, I work with legacy FEniCS. I’m trying to solve the Helmholtz equation (generalized eigenproblem Ax = lambda Bx) on a 2D surface which is not a plane (like a half-sphere or the lateral surface of a cylinder…

---

## [Assigning function values using MeshFunction in parallel](https://fenicsproject.discourse.group/t/assigning-function-values-using-meshfunction-in-parallel/16273)

<div class="topic-metadata">

**Author:** [@Kiri](https://fenicsproject.discourse.group/u/Kiri)\
**Replies:** 12\
**Last updated:** [November 19, 2024, 2:24pm UTC](https://fenicsproject.discourse.group/t/assigning-function-values-using-meshfunction-in-parallel/16273 "2024-11-19T14:24:26Z")

</div>

Hi, I have a script for assigning DG function values based on a MeshFunction which works in serial. Is there a parallel safe way to achieve the same behaviour? Currently the last two lines are not compatible with MPI s…

---

## [Is there any built-in method in FEniCS legacy to calculate the inverse square root of FEniCS matrices?](https://fenicsproject.discourse.group/t/is-there-any-built-in-method-in-fenics-legacy-to-calculate-the-inverse-square-root-of-fenics-matrices/16271)

<div class="topic-metadata">

**Author:** [@Deep\_Math](https://fenicsproject.discourse.group/u/Deep_Math)\
**Replies:** 1\
**Last updated:** [November 12, 2024, 5:19am UTC](https://fenicsproject.discourse.group/t/is-there-any-built-in-method-in-fenics-legacy-to-calculate-the-inverse-square-root-of-fenics-matrices/16271 "2024-11-12T05:19:53Z")

</div>

from fenics import \* from scipy.linalg import fractional\_matrix\_power def compute\_tau\_supg(dt, A1, A2, K11, K12, K21, K22, mesh): “”" Compute τ\_SUPG according to: τ\_SUPG = (4/Δt² I + GᵢⱼAᵢAⱼ + CₗGᵢⱼGₖₗKᵢₖKₗⱼ)^(-1/2…

---

## [Conda: mac-arm builds of legacy dolfin and development version available](https://fenicsproject.discourse.group/t/conda-mac-arm-builds-of-legacy-dolfin-and-development-version-available/15062)

<div class="topic-metadata">

**Author:** [@minrk](https://fenicsproject.discourse.group/u/minrk)\
**Replies:** 7\
**Last updated:** [November 11, 2024, 11:12am UTC](https://fenicsproject.discourse.group/t/conda-mac-arm-builds-of-legacy-dolfin-and-development-version-available/15062 "2024-11-11T11:12:06Z")

</div>

For folks using legacy dolfin via conda, there are two recent developments that might be of interest: there are now native mac arm builds of legacy dolfin on conda-forge, so arm mac users can now conda install fenics …

---

## [Import dolfin shows "Could not find DOLFIN pkg-config file"](https://fenicsproject.discourse.group/t/import-dolfin-shows-could-not-find-dolfin-pkg-config-file/16215)

<div class="topic-metadata">

**Author:** [@xi\_wang](https://fenicsproject.discourse.group/u/xi_wang)\
**Replies:** 1\
**Last updated:** [November 6, 2024, 11:44am UTC](https://fenicsproject.discourse.group/t/import-dolfin-shows-could-not-find-dolfin-pkg-config-file/16215 "2024-11-06T11:44:12Z")

</div>

I install dolfin in ubuntu 20 with the command: conda install -c conda-forge -c conda-forge/label/fenics-dev fenics-dolfin Then typed the the command in the terminal: python -c "import dolfin;print(dolfin.\_\_file\_\_)" …

---

## [Import dolfin fail, with mpi error](https://fenicsproject.discourse.group/t/import-dolfin-fail-with-mpi-error/16212)

<div class="topic-metadata">

**Author:** [@xi\_wang](https://fenicsproject.discourse.group/u/xi_wang)\
**Replies:** 2\
**Last updated:** [November 5, 2024, 10:50am UTC](https://fenicsproject.discourse.group/t/import-dolfin-fail-with-mpi-error/16212 "2024-11-05T10:50:45Z")

</div>

Hi, I tried to import dolfin in Ubuntu 20.04. However, “import dolfin” incurs the following error: -------------------------------------------------------------------------- Sorry! You were supposed to get help about:…

---

## [Error while transferring functions from coarse to fine mesh on a hollow pressure vessel geometry](https://fenicsproject.discourse.group/t/error-while-transferring-functions-from-coarse-to-fine-mesh-on-a-hollow-pressure-vessel-geometry/16187)

<div class="topic-metadata">

**Author:** [@iitrabhi](https://fenicsproject.discourse.group/u/iitrabhi)\
**Replies:** 1\
**Last updated:** [November 2, 2024, 12:39am UTC](https://fenicsproject.discourse.group/t/error-while-transferring-functions-from-coarse-to-fine-mesh-on-a-hollow-pressure-vessel-geometry/16187 "2024-11-02T00:39:55Z")

</div>

I’m encountering an error when transferring a function from a coarse to a refined mesh using DG0 function space. The code works perfectly with both meshes with CG1 function space, and also with DG0 but with simpler geome…

---

## [Ordering of the stiffness matrix?](https://fenicsproject.discourse.group/t/ordering-of-the-stiffness-matrix/16122)

<div class="topic-metadata">

**Author:** [@jheb](https://fenicsproject.discourse.group/u/jheb)\
**Replies:** 7\
**Last updated:** [October 31, 2024, 8:13pm UTC](https://fenicsproject.discourse.group/t/ordering-of-the-stiffness-matrix/16122 "2024-10-31T20:13:54Z")

</div>

Hi all, I am wanting to edit (possibly reordering and replacing some of the values) of the stiffness matrix to apply custom boundary conditions. However, I am unsure of how the stiffness matrix is constructed when calli…

---

## [No groups from mesh being recognised after importing .h5 file](https://fenicsproject.discourse.group/t/no-groups-from-mesh-being-recognised-after-importing-h5-file/16038)

<div class="topic-metadata">

**Author:** [@Albanox2844](https://fenicsproject.discourse.group/u/Albanox2844)\
**Replies:** 20\
**Last updated:** [October 19, 2024, 7:23pm UTC](https://fenicsproject.discourse.group/t/no-groups-from-mesh-being-recognised-after-importing-h5-file/16038 "2024-10-19T19:23:44Z")

</div>

I have produced a mesh by converting the .msh and .med files to a .h5 file which also spits out the .xml files too. The mesh is of a simple cylinder but I have grouped the surfaces and volumes seperately as I wish to use…

---

## [\[2019.1.0\] Mixed real function space?](https://fenicsproject.discourse.group/t/2019-1-0-mixed-real-function-space/16004)

<div class="topic-metadata">

**Author:** [@a516095046](https://fenicsproject.discourse.group/u/a516095046)\
**Replies:** 2\
**Last updated:** [October 10, 2024, 12:21pm UTC](https://fenicsproject.discourse.group/t/2019-1-0-mixed-real-function-space/16004 "2024-10-10T12:21:36Z")

</div>

Hello, I am trying to create a mixed function space consists of multiple real function space (basically I need a collection of many 1-global-dof function spaces). For the MWE code here I am trying to just mix 2 of them. …

---

## [Projecting into FunctionSpace increases number of integration pionts](https://fenicsproject.discourse.group/t/projecting-into-functionspace-increases-number-of-integration-pionts/16012)

<div class="topic-metadata">

**Author:** [@rynomcavoy](https://fenicsproject.discourse.group/u/rynomcavoy)\
**Replies:** 1\
**Last updated:** [October 10, 2024, 6:56am UTC](https://fenicsproject.discourse.group/t/projecting-into-functionspace-increases-number-of-integration-pionts/16012 "2024-10-10T06:56:23Z")

</div>

Hi, I’m using Legacy fenics for solving a custom nonlinear elasticity problem with 8 total unknown variables I’ve specified the quadrature degree using Measure when constructing the variational form which does fine on i…

---

## [How can I create a hexagon shape plate in FEniCS using Docker (Legacy Edition 2019.1.0)?](https://fenicsproject.discourse.group/t/how-can-i-create-a-hexagon-shape-plate-in-fenics-using-docker-legacy-edition-2019-1-0/15878)

<div class="topic-metadata">

**Author:** [@ardaaydinn](https://fenicsproject.discourse.group/u/ardaaydinn)\
**Replies:** 1\
**Last updated:** [September 23, 2024, 6:56pm UTC](https://fenicsproject.discourse.group/t/how-can-i-create-a-hexagon-shape-plate-in-fenics-using-docker-legacy-edition-2019-1-0/15878 "2024-09-23T18:56:30Z")

</div>

Hello FEniCS community, I am currently working on a project using FEniCS Legacy Edition ‘2019.1.0’ inside a Docker environment. I would like to create a hexagon-shaped plate for my simulation, but I’m unsure how to defi…

---

## [Is there a way to get the partial derivative for a gradient vector?](https://fenicsproject.discourse.group/t/is-there-a-way-to-get-the-partial-derivative-for-a-gradient-vector/15753)

<div class="topic-metadata">

**Author:** [@Swani](https://fenicsproject.discourse.group/u/Swani)\
**Replies:** 7\
**Last updated:** [September 12, 2024, 3:16am UTC](https://fenicsproject.discourse.group/t/is-there-a-way-to-get-the-partial-derivative-for-a-gradient-vector/15753 "2024-09-12T03:16:32Z")

</div>

Hello. Dear community :wave: I was wondering if it’s possible to get the partial derivative(Cartesian coordinate) for a gradient vector in legacy FEniCS. (this might be a bit silly, but I’m posting it for the sake of c…

[Next page](https://fenicsproject.discourse.group/c/posts-relating-to-legacy-dolfin/16.md?page=1)
