# Legacy DOLFIN

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

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

**Page:** 2

---

## [Periodic Boundary Conditions for Annulus](https://fenicsproject.discourse.group/t/periodic-boundary-conditions-for-annulus/15657)

<div class="topic-metadata">

**Author:** [@plugged](https://fenicsproject.discourse.group/u/plugged)\
**Replies:** 7\
**Last updated:** [August 28, 2024, 6:11am UTC](https://fenicsproject.discourse.group/t/periodic-boundary-conditions-for-annulus/15657 "2024-08-28T06:11:45Z")

</div>

Hi everyone, I have a quick question regarding periodic boundary conditions in (legacy) FEniCS. A MWE for the problem is sketched below. Assume that I have some annulus and I want to simulate only a quarter. Then I woul…

---

## [Question about an issue with assemble() and project() for equations defined as UFL Forms](https://fenicsproject.discourse.group/t/question-about-an-issue-with-assemble-and-project-for-equations-defined-as-ufl-forms/15424)

<div class="topic-metadata">

**Author:** [@Swani](https://fenicsproject.discourse.group/u/Swani)\
**Replies:** 2\
**Last updated:** [August 5, 2024, 3:54am UTC](https://fenicsproject.discourse.group/t/question-about-an-issue-with-assemble-and-project-for-equations-defined-as-ufl-forms/15424 "2024-08-05T03:54:34Z")

</div>

hello.:wave: It’s been a while since I’ve posted. I recently posted to address a question I had while exploring legacy DOLFIN a bit more. I’m having an issue when I’m trying to get the strain energy in the linear elast…

---

## [Problem with real functionspace in parallel](https://fenicsproject.discourse.group/t/problem-with-real-functionspace-in-parallel/15236)

<div class="topic-metadata">

**Author:** [@plugged](https://fenicsproject.discourse.group/u/plugged)\
**Replies:** 4\
**Last updated:** [July 31, 2024, 1:30pm UTC](https://fenicsproject.discourse.group/t/problem-with-real-functionspace-in-parallel/15236 "2024-07-31T13:30:21Z")

</div>

I face a problem using a real function space in parallel. I have the following MWE from fenics import \* # parameters\["dof\_ordering\_library"\] = "Boost" mesh = UnitSquareMesh(8, 8) R = FunctionSpace(mesh, "R", 0) which…

---

## [Constructing a Nonlinear Problem on DOLFIN for PETSc](https://fenicsproject.discourse.group/t/constructing-a-nonlinear-problem-on-dolfin-for-petsc/15153)

<div class="topic-metadata">

**Author:** [@mint\_Yzr](https://fenicsproject.discourse.group/u/mint_Yzr)\
**Replies:** 6\
**Last updated:** [July 6, 2024, 2:28am UTC](https://fenicsproject.discourse.group/t/constructing-a-nonlinear-problem-on-dolfin-for-petsc/15153 "2024-07-06T02:28:58Z")

</div>

Hello everyone, I am using DOLFIN to solve a nonlinear problem with PETSc.SNES instead of NonlinearVariationalSolver to have more control over settings. I am constrained to use FEniCS (not FEniCSx) because my problem re…

---

## [Question about fenics.Function.vector().apply()](https://fenicsproject.discourse.group/t/question-about-fenics-function-vector-apply/15139)

<div class="topic-metadata">

**Author:** [@plugged](https://fenicsproject.discourse.group/u/plugged)\
**Replies:** 2\
**Last updated:** [July 3, 2024, 9:39am UTC](https://fenicsproject.discourse.group/t/question-about-fenics-function-vector-apply/15139 "2024-07-03T09:39:16Z")

</div>

Hello everyone, I have a quick question regarding the apply method in (legacy) fenics. Consider the following: If I want to change the vector values of some function with those provided in some petsc4py.PETSc.Vec object…

---

## [Plot undeformed configuration](https://fenicsproject.discourse.group/t/plot-undeformed-configuration/14380)

<div class="topic-metadata">

**Author:** [@HumbertHumbert7](https://fenicsproject.discourse.group/u/HumbertHumbert7)\
**Replies:** 17\
**Last updated:** [June 27, 2024, 10:22am UTC](https://fenicsproject.discourse.group/t/plot-undeformed-configuration/14380 "2024-06-27T10:22:30Z")

</div>

Hi, I’m solving a problem in elasticity and I want to plot the displacement, however when I plot it in the undeformed configuration I obtain a bad plot. I’m just using the command plot: plot(u) plt.show() Is it pos…

---

## [Kernel appears to be dead when tried to execute solve() command](https://fenicsproject.discourse.group/t/kernel-appears-to-be-dead-when-tried-to-execute-solve-command/11582)

<div class="topic-metadata">

**Author:** [@violetus](https://fenicsproject.discourse.group/u/violetus)\
**Replies:** 5\
**Last updated:** [June 23, 2024, 7:17pm UTC](https://fenicsproject.discourse.group/t/kernel-appears-to-be-dead-when-tried-to-execute-solve-command/11582 "2024-06-23T19:17:00Z")

</div>

Hi, I am having difficulty in executing the following block of my code - # Compute solution u = Function(V, name = "Displacement") solve(a == L, u, bcs, solver\_parameters={'linear\_solver':'mumps'}) MWE is - from dolfi…

---

## [Topology Optimisation: Wrong volume calculation](https://fenicsproject.discourse.group/t/topology-optimisation-wrong-volume-calculation/14398)

<div class="topic-metadata">

**Author:** [@aashish\_kishore](https://fenicsproject.discourse.group/u/aashish_kishore)\
**Replies:** 5\
**Last updated:** [June 23, 2024, 9:22am UTC](https://fenicsproject.discourse.group/t/topology-optimisation-wrong-volume-calculation/14398 "2024-06-23T09:22:37Z")

</div>

Dear Community, Greetings for the day!! i am trying to run a two fluid 1 solid topology optimisation problem with the objective of minimising pressure dissipation energy while adhering to max volume constraints. I’m f…

---

## [Correctly setting initial conditions using Expression() in DG problem](https://fenicsproject.discourse.group/t/correctly-setting-initial-conditions-using-expression-in-dg-problem/14918)

<div class="topic-metadata">

**Author:** [@William\_Greenough](https://fenicsproject.discourse.group/u/William_Greenough)\
**Replies:** 4\
**Last updated:** [June 12, 2024, 1:39pm UTC](https://fenicsproject.discourse.group/t/correctly-setting-initial-conditions-using-expression-in-dg-problem/14918 "2024-06-12T13:39:21Z")

</div>

I have discovered an issue when trying to use to avg and jump operators with expressions for the initial conditions in a DG problem. dolfin version ==2019.2.0.dev0 I have been unable to correctly define the expression o…

---

## [Unable to solve my Lagrange multiplier problem with either dolfinx or dolfin](https://fenicsproject.discourse.group/t/unable-to-solve-my-lagrange-multiplier-problem-with-either-dolfinx-or-dolfin/14795)

<div class="topic-metadata">

**Author:** [@gufaye39](https://fenicsproject.discourse.group/u/gufaye39)\
**Replies:** 4\
**Last updated:** [May 26, 2024, 3:55pm UTC](https://fenicsproject.discourse.group/t/unable-to-solve-my-lagrange-multiplier-problem-with-either-dolfinx-or-dolfin/14795 "2024-05-26T15:55:32Z")

</div>

I have a variational formulation that uses the Lagrange multiplier method. I need to use a real element for this multiplier. I’m a bit confused by real elements being in FEniCSx but still not implemented: calling lagran…

---

## [Unable to assemble a system created after the derivative of mixed elements](https://fenicsproject.discourse.group/t/unable-to-assemble-a-system-created-after-the-derivative-of-mixed-elements/14092)

<div class="topic-metadata">

**Author:** [@ddeaquin](https://fenicsproject.discourse.group/u/ddeaquin)\
**Replies:** 10\
**Last updated:** [May 24, 2024, 7:37am UTC](https://fenicsproject.discourse.group/t/unable-to-assemble-a-system-created-after-the-derivative-of-mixed-elements/14092 "2024-05-24T07:37:09Z")

</div>

Hi there, the mwe below fails when I try to assemble a system composed by partial derivatives calculated using a state variable and a residual, both created with mixed elements: from fenics import \* from fenics\_adjoint…

---

## [Mixed-dimensional branch - Error: Unable to set given (local) rows to identity matrix](https://fenicsproject.discourse.group/t/mixed-dimensional-branch-error-unable-to-set-given-local-rows-to-identity-matrix/14698)

<div class="topic-metadata">

**Author:** [@mothball](https://fenicsproject.discourse.group/u/mothball)\
**Replies:** 2\
**Last updated:** [May 18, 2024, 11:15am UTC](https://fenicsproject.discourse.group/t/mixed-dimensional-branch-error-unable-to-set-given-local-rows-to-identity-matrix/14698 "2024-05-18T11:15:11Z")

</div>

Hello! I am using the mixed-dimensional branch from @cdaversin in docker to solve a nonlinear problem on a 2D rectangle that is divided into 2 subdomains. I tried my best to create a MWE and I apologize in advance if it’…

---

## [Import field from .vtk file and use it as source in heat equation](https://fenicsproject.discourse.group/t/import-field-from-vtk-file-and-use-it-as-source-in-heat-equation/14606)

<div class="topic-metadata">

**Author:** [@RBocce](https://fenicsproject.discourse.group/u/RBocce)\
**Replies:** 1\
**Last updated:** [May 13, 2024, 4:58pm UTC](https://fenicsproject.discourse.group/t/import-field-from-vtk-file-and-use-it-as-source-in-heat-equation/14606 "2024-05-13T16:58:34Z")

</div>

Hi all, I wrote a script that solves heat equation given a certain .msh file. I would like to import the (non-uniform) heat source from a .vtk file generated by another code (on a different mesh). Is there a way to read…

---

## [Is it possible to program (from scratch) a 2nd-order tetrahedron in FeniCs Legacy?](https://fenicsproject.discourse.group/t/is-it-possible-to-program-from-scratch-a-2nd-order-tetrahedron-in-fenics-legacy/14554)

<div class="topic-metadata">

**Author:** [@fergus](https://fenicsproject.discourse.group/u/fergus)\
**Replies:** 4\
**Last updated:** [May 6, 2024, 5:54pm UTC](https://fenicsproject.discourse.group/t/is-it-possible-to-program-from-scratch-a-2nd-order-tetrahedron-in-fenics-legacy/14554 "2024-05-06T17:54:52Z")

</div>

My question is whether it is possible to include the code of a 2nd-order tetrahedorn into the FEniCs Legacy core without having to fix all the functions. Since dolfinx still has some features not implemented that my prob…

---

## [Incorrect Values Creating Expression From Other Expressions](https://fenicsproject.discourse.group/t/incorrect-values-creating-expression-from-other-expressions/14524)

<div class="topic-metadata">

**Author:** [@TGH](https://fenicsproject.discourse.group/u/TGH)\
**Replies:** 6\
**Last updated:** [May 5, 2024, 4:10pm UTC](https://fenicsproject.discourse.group/t/incorrect-values-creating-expression-from-other-expressions/14524 "2024-05-05T16:10:11Z")

</div>

I am trying to create a more complicated expression from less complicated expressions following the examples I found here and elsewhere. I appear to be running into an issue with the keyword argument expression outputtin…

---

## [Install fenics-shells](https://fenicsproject.discourse.group/t/install-fenics-shells/14510)

<div class="topic-metadata">

**Author:** [@HumbertHumbert7](https://fenicsproject.discourse.group/u/HumbertHumbert7)\
**Replies:** 12\
**Last updated:** [May 2, 2024, 5:01pm UTC](https://fenicsproject.discourse.group/t/install-fenics-shells/14510 "2024-05-02T17:01:54Z")

</div>

Hi, I have installed dolfin from fem on colab, but I’m not able to install fenic-shells. Could you write me the lines of code to use in order to install it? Thank you

---

## [Is there possible way to read functions in .vtu files](https://fenicsproject.discourse.group/t/is-there-possible-way-to-read-functions-in-vtu-files/14283)

<div class="topic-metadata">

**Author:** [@WjjSteve](https://fenicsproject.discourse.group/u/WjjSteve)\
**Replies:** 1\
**Last updated:** [April 16, 2024, 4:34pm UTC](https://fenicsproject.discourse.group/t/is-there-possible-way-to-read-functions-in-vtu-files/14283 "2024-04-16T16:34:10Z")

</div>

Hello, I’m wondering that can I read the functions in vtu file in legacy DOLFIN? So I have ran some simulations, and I store the solution in vtu files, then I want to use the solution when I run some other simulations,…

---

## [Bug either in legacy dolfin using dS or in pygmsh/gmsh mesh](https://fenicsproject.discourse.group/t/bug-either-in-legacy-dolfin-using-ds-or-in-pygmsh-gmsh-mesh/14030)

<div class="topic-metadata">

**Author:** [@jacobkrich](https://fenicsproject.discourse.group/u/jacobkrich)\
**Replies:** 6\
**Last updated:** [April 4, 2024, 9:23pm UTC](https://fenicsproject.discourse.group/t/bug-either-in-legacy-dolfin-using-ds-or-in-pygmsh-gmsh-mesh/14030 "2024-04-04T21:23:39Z")

</div>

I do 2D Poisson/drift-diffusion semiconductor device modeling using legacy dolfin, as implemented in Simudo. I have had a devil of a bug that I’ve spent months tracking down, and I have narrowed it down to the following …

---

## [What is the easy way to view a matrix in Legacy DOLFIN](https://fenicsproject.discourse.group/t/what-is-the-easy-way-to-view-a-matrix-in-legacy-dolfin/14113)

<div class="topic-metadata">

**Author:** [@WjjSteve](https://fenicsproject.discourse.group/u/WjjSteve)\
**Replies:** 3\
**Last updated:** [April 3, 2024, 1:17pm UTC](https://fenicsproject.discourse.group/t/what-is-the-easy-way-to-view-a-matrix-in-legacy-dolfin/14113 "2024-04-03T13:17:04Z")

</div>

Hello. this is a question regarding the legacy dolfin. I want to adopt some of my code to DOLFINX, in order to monitor the change I want to see the elements of the matrix, so I just want to ask what is the easist way to…

---

## [How to use \`NewtonSolver\` instead of \`NonlinearVariationalSolver\`?](https://fenicsproject.discourse.group/t/how-to-use-newtonsolver-instead-of-nonlinearvariationalsolver/14089)

<div class="topic-metadata">

**Author:** [@KulaginVladimir](https://fenicsproject.discourse.group/u/KulaginVladimir)\
**Replies:** 2\
**Last updated:** [April 1, 2024, 5:45pm UTC](https://fenicsproject.discourse.group/t/how-to-use-newtonsolver-instead-of-nonlinearvariationalsolver/14089 "2024-04-01T17:45:42Z")

</div>

Hello, all! Is it possible to explicitly re-create the functionality of NonlinearVariationalSolver using NewtonSolver in fenics (dolfin version 2019.1.0)? I’ve attempted to apply this example to set a NewtonSolver for …

---

## [Poisson adjoint solution is the same for both : solution & solution + noise](https://fenicsproject.discourse.group/t/poisson-adjoint-solution-is-the-same-for-both-solution-solution-noise/13740)

<div class="topic-metadata">

**Author:** [@Sparrow\_Captain](https://fenicsproject.discourse.group/u/Sparrow_Captain)\
**Replies:** 7\
**Last updated:** [March 31, 2024, 9:58pm UTC](https://fenicsproject.discourse.group/t/poisson-adjoint-solution-is-the-same-for-both-solution-solution-noise/13740 "2024-03-31T21:58:20Z")

</div>

Hello, I am currently working on resolving a poisson equation for both forward and ajdoint problem. Here is my code : from dolfin import \* from dolfin\_adjoint import \* import matplotlib.pyplot as plt import numpy as np…

---

## [How to Create a Vector Function in Function Space 2 from Functions in Function Space 1?](https://fenicsproject.discourse.group/t/how-to-create-a-vector-function-in-function-space-2-from-functions-in-function-space-1/14060)

<div class="topic-metadata">

**Author:** [@TGH](https://fenicsproject.discourse.group/u/TGH)\
**Replies:** 2\
**Last updated:** [March 29, 2024, 4:30pm UTC](https://fenicsproject.discourse.group/t/how-to-create-a-vector-function-in-function-space-2-from-functions-in-function-space-1/14060 "2024-03-29T16:30:17Z")

</div>

Fenics Version: 2019.2.0.13.dev0 Within my existing code I want to create a vector function \\vec{v} on a new vector space V\_2 from two known functions on a different vector space V\_1. One function is a solution of a pro…

---

## [Question about "MeshCoordinates()" in legacy FEniCS](https://fenicsproject.discourse.group/t/question-about-meshcoordinates-in-legacy-fenics/13897)

<div class="topic-metadata">

**Author:** [@Swani](https://fenicsproject.discourse.group/u/Swani)\
**Replies:** 6\
**Last updated:** [March 15, 2024, 5:52am UTC](https://fenicsproject.discourse.group/t/question-about-meshcoordinates-in-legacy-fenics/13897 "2024-03-15T05:52:15Z")

</div>

Hello :wave: It’s been a while since I’ve posted a question Recently, while exploring the legacy DOLFIN code, I came across the MeshCoordinates() function. From posts ref1 and ref2, I thought it was a way to express t…

---

## [Converting .xdmf to .vtu file writing in Fenics](https://fenicsproject.discourse.group/t/converting-xdmf-to-vtu-file-writing-in-fenics/13833)

<div class="topic-metadata">

**Author:** [@Filipe\_Namorato](https://fenicsproject.discourse.group/u/Filipe_Namorato)\
**Replies:** 2\
**Last updated:** [March 14, 2024, 2:11pm UTC](https://fenicsproject.discourse.group/t/converting-xdmf-to-vtu-file-writing-in-fenics/13833 "2024-03-14T14:11:55Z")

</div>

Hello everyone. I’m not sure if this topic has been discussed in another thread, but I need to convert .xdmf to .vtu files. If anyone knows a solution and can share it, I would be grateful!

---

## [Use PointSource as a source term (f) for Poisson equation](https://fenicsproject.discourse.group/t/use-pointsource-as-a-source-term-f-for-poisson-equation/13757)

<div class="topic-metadata">

**Author:** [@Sparrow\_Captain](https://fenicsproject.discourse.group/u/Sparrow_Captain)\
**Replies:** 4\
**Last updated:** [March 2, 2024, 7:10pm UTC](https://fenicsproject.discourse.group/t/use-pointsource-as-a-source-term-f-for-poisson-equation/13757 "2024-03-02T19:10:21Z")

</div>

Hello, I am trying to use a Dirac source term with the PointSource function, based on a post in the fenics forum PointSource. Here is my code : from mshr import \* from dolfin import \* import matplotlib.pyplot as plt im…

---

## [Question on Dolfin poisson equation for source measurement on borders](https://fenicsproject.discourse.group/t/question-on-dolfin-poisson-equation-for-source-measurement-on-borders/13714)

<div class="topic-metadata">

**Author:** [@Sparrow\_Captain](https://fenicsproject.discourse.group/u/Sparrow_Captain)\
**Replies:** 23\
**Last updated:** [March 6, 2024, 4:28am UTC](https://fenicsproject.discourse.group/t/question-on-dolfin-poisson-equation-for-source-measurement-on-borders/13714 "2024-03-06T04:28:55Z")

</div>

Hello, I want to know if it is possible, using the solution (u) with a source term (f) of the poisson equation, to measure that solution on the boundaries instead of an “inner” measure. It would be similar to the Elect…

---

## [How to represent non-uniform first and second type boundary conditions?](https://fenicsproject.discourse.group/t/how-to-represent-non-uniform-first-and-second-type-boundary-conditions/13654)

<div class="topic-metadata">

**Author:** [@French\_fries](https://fenicsproject.discourse.group/u/French_fries)\
**Replies:** 21\
**Last updated:** [March 3, 2024, 1:36am UTC](https://fenicsproject.discourse.group/t/how-to-represent-non-uniform-first-and-second-type-boundary-conditions/13654 "2024-03-03T01:36:01Z")

</div>

Hello everyone, considering the simplest heat conduction equation, suppose the geometric model is a rectangle; for a boundary of the rectangle, if the temperature on that boundary is T0, it can be represented in Fenics a…

---

## [Dirac point source class implementation for Poisson equation](https://fenicsproject.discourse.group/t/dirac-point-source-class-implementation-for-poisson-equation/13758)

<div class="topic-metadata">

**Author:** [@Sparrow\_Captain](https://fenicsproject.discourse.group/u/Sparrow_Captain)\
**Replies:** 2\
**Last updated:** [February 29, 2024, 1:03am UTC](https://fenicsproject.discourse.group/t/dirac-point-source-class-implementation-for-poisson-equation/13758 "2024-02-29T01:03:10Z")

</div>

Hello, I have been trying to adapt the proposed Delta (source point) class by “MiroK” in this post Delta variational formulation, but I keep getting a shape mismatch error. My code is : class Delta(UserExpression): …

---

## [Parallelization error when customizing NewtonSolver](https://fenicsproject.discourse.group/t/parallelization-error-when-customizing-newtonsolver/13664)

<div class="topic-metadata">

**Author:** [@amyao](https://fenicsproject.discourse.group/u/amyao)\
**Replies:** 7\
**Last updated:** [February 27, 2024, 7:45am UTC](https://fenicsproject.discourse.group/t/parallelization-error-when-customizing-newtonsolver/13664 "2024-02-27T07:45:04Z")

</div>

Hi everyone, I’m new to Fenics and have literally no knowledge to openmpi. I am trying to run the cahn-hillilard demo with a customized NewtonSolver which tries to clamp c within \[0,1\]. Here’s the customized solver: cl…

---

## [Question about dolfin.cpp.la.Matrix](https://fenicsproject.discourse.group/t/question-about-dolfin-cpp-la-matrix/13687)

<div class="topic-metadata">

**Author:** [@xiaohe](https://fenicsproject.discourse.group/u/xiaohe)\
**Replies:** 8\
**Last updated:** [February 24, 2024, 12:03pm UTC](https://fenicsproject.discourse.group/t/question-about-dolfin-cpp-la-matrix/13687 "2024-02-24T12:03:02Z")

</div>

Hello, everyone I am working on fenics 2019.1, I have some question about the class dolfin.cpp.la.Matrix Whether fenics supports basic matrix operations.(for example add,subract, multiply, divide, inv…) Whether fenics…

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

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