# variational formulation

**URL:** https://fenicsproject.discourse.group/c/variational-formulation/8.md

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

---

## [About the variational formulation category](https://fenicsproject.discourse.group/t/about-the-variational-formulation-category/30)

<div class="topic-metadata">

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

</div>

Discussions about how to represent equations correctly in FEniCS Use of UFL for different physical systems Choice of FunctionSpace

---

## [Meshed rigid indenter in contact with a hyperelastic body in FEniCSx](https://fenicsproject.discourse.group/t/meshed-rigid-indenter-in-contact-with-a-hyperelastic-body-in-fenicsx/19698)

<div class="topic-metadata">

**Author:** [@tomkuh](https://fenicsproject.discourse.group/u/tomkuh)\
**Replies:** 1\
**Last updated:** [May 8, 2026, 4:06pm UTC](https://fenicsproject.discourse.group/t/meshed-rigid-indenter-in-contact-with-a-hyperelastic-body-in-fenicsx/19698 "2026-05-08T16:06:55Z")

</div>

Dear FEniCSx community, I would like to simulate a rigid indenter being pushed into a hyperelastic material. The indenter should be represented as a meshed body, so that different indenter geometries can be studied. As …

---

## [Natural convection in a square cavity: heat flux on one wall and convective cooling on the opposite, Boussinesq approximation](https://fenicsproject.discourse.group/t/natural-convection-in-a-square-cavity-heat-flux-on-one-wall-and-convective-cooling-on-the-opposite-boussinesq-approximation/19585)

<div class="topic-metadata">

**Author:** [@namideus](https://fenicsproject.discourse.group/u/namideus)\
**Replies:** 2\
**Last updated:** [March 25, 2026, 4:18am UTC](https://fenicsproject.discourse.group/t/natural-convection-in-a-square-cavity-heat-flux-on-one-wall-and-convective-cooling-on-the-opposite-boussinesq-approximation/19585 "2026-03-25T04:18:44Z")

</div>

Hello! This is my variational formulation for the Boussinesq approximation (Navier-Stokes). Though I am getting somewhat a realistic simulation - I wanted to make sure whether I have correctly defined the boundary condit…

---

## [Proper Implemention of KKT conditions in energy minimization](https://fenicsproject.discourse.group/t/proper-implemention-of-kkt-conditions-in-energy-minimization/19548)

<div class="topic-metadata">

**Author:** [@Joshua\_Simpson-Gomez](https://fenicsproject.discourse.group/u/Joshua_Simpson-Gomez)\
**Replies:** 7\
**Last updated:** [March 2, 2026, 8:15pm UTC](https://fenicsproject.discourse.group/t/proper-implemention-of-kkt-conditions-in-energy-minimization/19548 "2026-03-02T20:15:19Z")

</div>

I am trying to simulate a linear elastic problem with a small amount of contact. To get the best results I was hoping to implement a Lagrange multiplier approach to solve for the displacements with constraints on the con…

---

## [Rotational IPC keeps diverging](https://fenicsproject.discourse.group/t/rotational-ipc-keeps-diverging/19522)

<div class="topic-metadata">

**Author:** [@mhadidy](https://fenicsproject.discourse.group/u/mhadidy)\
**Replies:** 1\
**Last updated:** [February 21, 2026, 12:42pm UTC](https://fenicsproject.discourse.group/t/rotational-ipc-keeps-diverging/19522 "2026-02-21T12:42:13Z")

</div>

Hi, I have this attached geometry consisted of one inlet and two outlets, but it keeps diverging whatever I tried to do (enhancing the mesh resolution, decreasing the time step, decreasing the inlet flow rate, using dif…

---

## [Space-Time weak formulation](https://fenicsproject.discourse.group/t/space-time-weak-formulation/19303)

<div class="topic-metadata">

**Author:** [@LichtBringer](https://fenicsproject.discourse.group/u/LichtBringer)\
**Replies:** 4\
**Last updated:** [January 6, 2026, 12:04pm UTC](https://fenicsproject.discourse.group/t/space-time-weak-formulation/19303 "2026-01-06T12:04:52Z")

</div>

Hello dear community, i’m new to FEniCSx. I was wondering if it was actually possible to write the weak spacetime formulation as defined in this thesis document: https://theses.hal.science/tel-03810677v1/document (Sec…

---

## [Shape optimization in complex dolfinx](https://fenicsproject.discourse.group/t/shape-optimization-in-complex-dolfinx/18345)

<div class="topic-metadata">

**Author:** [@sbhasan](https://fenicsproject.discourse.group/u/sbhasan)\
**Replies:** 7\
**Last updated:** [January 5, 2026, 5:54pm UTC](https://fenicsproject.discourse.group/t/shape-optimization-in-complex-dolfinx/18345 "2026-01-05T17:54:47Z")

</div>

I need to adapt a shape optimization example for my use case. The unknown solution field is complex and hence I need to work with the complex build. While porting to the recent version, I run into errors that I do not en…

---

## [Little question about Tutorial : Defining subdomains for different materials by Dokken, if we add Neumann BC](https://fenicsproject.discourse.group/t/little-question-about-tutorial-defining-subdomains-for-different-materials-by-dokken-if-we-add-neumann-bc/18407)

<div class="topic-metadata">

**Author:** [@katkit](https://fenicsproject.discourse.group/u/katkit)\
**Replies:** 1\
**Last updated:** [November 21, 2025, 7:38pm UTC](https://fenicsproject.discourse.group/t/little-question-about-tutorial-defining-subdomains-for-different-materials-by-dokken-if-we-add-neumann-bc/18407 "2025-11-21T19:38:05Z")

</div>

Hello, i just have a little question about the tutorial Defining subdomains for different materials by J.S.Dokken, if we had a Neumann BC the third equation becomes -du/dn = g , instead of =0. Now, do we have to add …

---

## [The curl curl equation for vector potential A with the Coulomb gauge](https://fenicsproject.discourse.group/t/the-curl-curl-equation-for-vector-potential-a-with-the-coulomb-gauge/18390)

<div class="topic-metadata">

**Author:** [@young](https://fenicsproject.discourse.group/u/young)\
**Replies:** 9\
**Last updated:** [November 19, 2025, 4:34pm UTC](https://fenicsproject.discourse.group/t/the-curl-curl-equation-for-vector-potential-a-with-the-coulomb-gauge/18390 "2025-11-19T16:34:45Z")

</div>

Hello I am trying to solve a simple magnetostatic problem through a curl curl equation with Coulomb gauge. \\nabla \\times \\nabla \\times \\mathbf{A} = \\mu\_0 \\mathbf{J} and \\nabla \\cdot \\mathbf{A} = 0 on \\Omega. with ho…

---

## [Applying boundary control term only on boundary](https://fenicsproject.discourse.group/t/applying-boundary-control-term-only-on-boundary/18347)

<div class="topic-metadata">

**Author:** [@thalerf](https://fenicsproject.discourse.group/u/thalerf)\
**Replies:** 4\
**Last updated:** [November 7, 2025, 4:42pm UTC](https://fenicsproject.discourse.group/t/applying-boundary-control-term-only-on-boundary/18347 "2025-11-07T16:42:46Z")

</div>

Hello Everyone I am rather new to fenics and am trying to solve a problem, where I want to achieve a given heat-distribution (z) within my domain by optimising a boundary-term (g). My problem is that my boundary-term g …

---

## [Automating writing of Coupled system of PDEs](https://fenicsproject.discourse.group/t/automating-writing-of-coupled-system-of-pdes/18327)

<div class="topic-metadata">

**Author:** [@Yabou2306](https://fenicsproject.discourse.group/u/Yabou2306)\
**Replies:** 1\
**Last updated:** [October 31, 2025, 4:28pm UTC](https://fenicsproject.discourse.group/t/automating-writing-of-coupled-system-of-pdes/18327 "2025-10-31T16:28:21Z")

</div>

Hello everyone, I am new to FEniCS and I am trying to understand if FEniCS can be useful to my current project. I would like to solve N coupled PDEs and be able to modify N. I need to define N functions u\_1, .., u\_N a…

---

## [Solving a general nonlinear algebraic equation (not PDE)](https://fenicsproject.discourse.group/t/solving-a-general-nonlinear-algebraic-equation-not-pde/18232)

<div class="topic-metadata">

**Author:** [@rynomcavoy](https://fenicsproject.discourse.group/u/rynomcavoy)\
**Replies:** 1\
**Last updated:** [October 16, 2025, 6:01pm UTC](https://fenicsproject.discourse.group/t/solving-a-general-nonlinear-algebraic-equation-not-pde/18232 "2025-10-16T18:01:49Z")

</div>

Suppose you are given a general nonlinear equation f(A,B) where A is a known vector-valued function and B is an unknown vector-valued function and want to solve for the latter variable throughout the domain in question. …

---

## [Quadrature elements and boundary integration](https://fenicsproject.discourse.group/t/quadrature-elements-and-boundary-integration/13446)

<div class="topic-metadata">

**Author:** [@BouteillerP](https://fenicsproject.discourse.group/u/BouteillerP)\
**Replies:** 6\
**Last updated:** [October 3, 2025, 6:35pm UTC](https://fenicsproject.discourse.group/t/quadrature-elements-and-boundary-integration/13446 "2025-10-03T18:35:44Z")

</div>

Hello everyone, I am currently facing difficulties with the use of quadrature elements. I have an internal variable (damage) that I would like to only define at the integration points. I am performing explicit dynamic s…

---

## [Newton solver at the Gauss point level](https://fenicsproject.discourse.group/t/newton-solver-at-the-gauss-point-level/7454)

<div class="topic-metadata">

**Author:** [@Martin1](https://fenicsproject.discourse.group/u/Martin1)\
**Replies:** 7\
**Last updated:** [September 29, 2025, 9:21am UTC](https://fenicsproject.discourse.group/t/newton-solver-at-the-gauss-point-level/7454 "2025-09-29T09:21:34Z")

</div>

Hello Everyone, I want to implement a model in FEniCS which uses a so called “local newton iteration”, where the equation for the internal (tensor-valued) variable \\boldsymbol{a} is to be solved at the Gaus point leve…

---

## [3D PCB Coil Inductance Calculation](https://fenicsproject.discourse.group/t/3d-pcb-coil-inductance-calculation/18215)

<div class="topic-metadata">

**Author:** [@Waldi](https://fenicsproject.discourse.group/u/Waldi)\
**Replies:** 0\
**Last updated:** [September 16, 2025, 12:46pm UTC](https://fenicsproject.discourse.group/t/3d-pcb-coil-inductance-calculation/18215 "2025-09-16T12:46:01Z")

</div>

I am currently working on a FEM simulation in FEnicCSx09 to calculate the inductance of a PCB Coil. My current code and debug is attached below. The results for my coil shape are multiple orders of magnitude too high and…

---

## [Dolfinx - Projection of a trial function into its tensor space in a mixed formulation](https://fenicsproject.discourse.group/t/dolfinx-projection-of-a-trial-function-into-its-tensor-space-in-a-mixed-formulation/18174)

<div class="topic-metadata">

**Author:** [@AnselmoRodriguez](https://fenicsproject.discourse.group/u/AnselmoRodriguez)\
**Replies:** 2\
**Last updated:** [September 4, 2025, 12:57am UTC](https://fenicsproject.discourse.group/t/dolfinx-projection-of-a-trial-function-into-its-tensor-space-in-a-mixed-formulation/18174 "2025-09-04T00:57:35Z")

</div>

Hello everyone, I am working with a stabilized mixed formulation with displacement and strain fields in FEniCSx, and I would like to project a trial function into its corresponding tensor space. (At the end of this post…

---

## [3D Permanent Magnet](https://fenicsproject.discourse.group/t/3d-permanent-magnet/18149)

<div class="topic-metadata">

**Author:** [@aquaguy](https://fenicsproject.discourse.group/u/aquaguy)\
**Replies:** 1\
**Last updated:** [August 26, 2025, 10:23am UTC](https://fenicsproject.discourse.group/t/3d-permanent-magnet/18149 "2025-08-26T10:23:31Z")

</div>

I’m trying to implement a basic case of a cylindrical permanent magnet. However, my vector potential is null outside the magnet. I’m looking for some guidance on what is causing this. Here’s my code: #!/usr/bin/env py…

---

## [Big error when solving non linear complex PDE](https://fenicsproject.discourse.group/t/big-error-when-solving-non-linear-complex-pde/18146)

<div class="topic-metadata">

**Author:** [@khajar](https://fenicsproject.discourse.group/u/khajar)\
**Replies:** 0\
**Last updated:** [August 25, 2025, 7:04am UTC](https://fenicsproject.discourse.group/t/big-error-when-solving-non-linear-complex-pde/18146 "2025-08-25T07:04:21Z")

</div>

Hello, I am trying to solve the pde -laplacianU + q\*U^2 =0 with with Dirichlet complex boundary values, when solving it for constant values for the function q the error is small but with a complex variable function q th…

---

## [Space-Time FE - How to formulate initial conditions as "time boundary conditions"](https://fenicsproject.discourse.group/t/space-time-fe-how-to-formulate-initial-conditions-as-time-boundary-conditions/6371)

<div class="topic-metadata">

**Author:** [@dominik-kern](https://fenicsproject.discourse.group/u/dominik-kern)\
**Replies:** 1\
**Last updated:** [August 11, 2025, 11:09am UTC](https://fenicsproject.discourse.group/t/space-time-fe-how-to-formulate-initial-conditions-as-time-boundary-conditions/6371 "2025-08-11T11:09:42Z")

</div>

I am aware that the classical way for initial-boundary-value problems is a time-stepping through a sequence of spatial boundary-value problems. Still in terms of global error it may be interesting to formulate such a pro…

---

## [Dot logic with grad and nabla\_grad](https://fenicsproject.discourse.group/t/dot-logic-with-grad-and-nabla-grad/18083)

<div class="topic-metadata">

**Author:** [@rummy](https://fenicsproject.discourse.group/u/rummy)\
**Replies:** 3\
**Last updated:** [August 8, 2025, 7:24am UTC](https://fenicsproject.discourse.group/t/dot-logic-with-grad-and-nabla-grad/18083 "2025-08-08T07:24:53Z")

</div>

How is this evaluated in Fenics dot( grad(u), grad(v)) If u and v are vectors. From tensors algebra, it should be: $$\\partial\_{x\_k} u\_i \\partial\_{x\_j} v\_k$$ But I think what Fenics is doing: $$\\partial\_{x\_k} u\_i \\p…

---

## [Impose electric current magnitude / Floating potential](https://fenicsproject.discourse.group/t/impose-electric-current-magnitude-floating-potential/8022)

<div class="topic-metadata">

**Author:** [@thabuis](https://fenicsproject.discourse.group/u/thabuis)\
**Replies:** 14\
**Last updated:** [August 4, 2025, 11:15am UTC](https://fenicsproject.discourse.group/t/impose-electric-current-magnitude-floating-potential/8022 "2025-08-04T11:15:20Z")

</div>

Dear all, I’m working on a static electric conduction problem, governed by a simple Poisson equation: -\\nabla \\cdot \[\\sigma(x,y)\\nabla u(x,y)\] = 0 with \\sigma the electric conductivity and u the electric potential. I…

---

## [Weak form for 'Inverse Laplace' Winslow equations](https://fenicsproject.discourse.group/t/weak-form-for-inverse-laplace-winslow-equations/18017)

<div class="topic-metadata">

**Author:** [@timwong](https://fenicsproject.discourse.group/u/timwong)\
**Replies:** 1\
**Last updated:** [July 30, 2025, 11:54am UTC](https://fenicsproject.discourse.group/t/weak-form-for-inverse-laplace-winslow-equations/18017 "2025-07-30T11:54:42Z")

</div>

Hello, As part of an investigation into adaptive and moving mesh techniques, I have been exploring the possible use of fenics to solve Winslow’s equations for (x,y) on a domain \\xi\\in\[0, 1\], \\eta \\in \[0, 1\]: \\alpha x\_{…

---

## [Dirichlet Boundary Conditions on Subdomains in FEniCSx](https://fenicsproject.discourse.group/t/dirichlet-boundary-conditions-on-subdomains-in-fenicsx/9716)

<div class="topic-metadata">

**Author:** [@tuderic](https://fenicsproject.discourse.group/u/tuderic)\
**Replies:** 5\
**Last updated:** [July 12, 2025, 1:11pm UTC](https://fenicsproject.discourse.group/t/dirichlet-boundary-conditions-on-subdomains-in-fenicsx/9716 "2025-07-12T13:11:04Z")

</div>

Hi everyone, I am wondering if it is possible to define Dirichlet boundary conditions on a subdomain. For instance, if one primary variable is not of interest in a certain subdomain, I would like to set a DBC with the …

---

## [Sensitivity analysis with boundary conditions as parameters](https://fenicsproject.discourse.group/t/sensitivity-analysis-with-boundary-conditions-as-parameters/8821)

<div class="topic-metadata">

**Author:** [@Umtin](https://fenicsproject.discourse.group/u/Umtin)\
**Replies:** 15\
**Last updated:** [July 10, 2025, 10:41am UTC](https://fenicsproject.discourse.group/t/sensitivity-analysis-with-boundary-conditions-as-parameters/8821 "2025-07-10T10:41:54Z")

</div>

Dear all, I am working on adjoint sensitivity analysis. Does anybody know any examples on how to compute sensitivities when the control parameters are Dirichlet BCs? I can do it when the parameters appear explicitly i…

---

## [Modeling Elastohydrodynamic Lubrication in Fenics- Coupled PDEs](https://fenicsproject.discourse.group/t/modeling-elastohydrodynamic-lubrication-in-fenics-coupled-pdes/5951)

<div class="topic-metadata">

**Author:** [@akillvj](https://fenicsproject.discourse.group/u/akillvj)\
**Replies:** 3\
**Last updated:** [July 8, 2025, 4:28am UTC](https://fenicsproject.discourse.group/t/modeling-elastohydrodynamic-lubrication-in-fenics-coupled-pdes/5951 "2025-07-08T04:28:27Z")

</div>

Hi, I am trying to solve a problem in elastohydrodynamic lubrication using Fenics, and I am trying to figure out if the following system can be implemented in Fenics. The configuration is shown in figure above has th…

---

## [Adding unknown to the nonlinear system](https://fenicsproject.discourse.group/t/adding-unknown-to-the-nonlinear-system/17852)

<div class="topic-metadata">

**Author:** [@usiu5555](https://fenicsproject.discourse.group/u/usiu5555)\
**Replies:** 2\
**Last updated:** [July 1, 2025, 6:17am UTC](https://fenicsproject.discourse.group/t/adding-unknown-to-the-nonlinear-system/17852 "2025-07-01T06:17:56Z")

</div>

I have a problem which involves nonlinear Neumann boundary condition q(u,k) controlled by a parameter k. I want to solve the system and find k for which the integral at the boundary reach a specific value A. I want to ad…

---

## [Using Python functions in FEniCS variational formulation](https://fenicsproject.discourse.group/t/using-python-functions-in-fenics-variational-formulation/3978)

<div class="topic-metadata">

**Author:** [@stefanpetrevski](https://fenicsproject.discourse.group/u/stefanpetrevski)\
**Replies:** 40\
**Last updated:** [June 22, 2025, 7:47am UTC](https://fenicsproject.discourse.group/t/using-python-functions-in-fenics-variational-formulation/3978 "2025-06-22T07:47:55Z")

</div>

Hello FEniCS community, I have been implementing a finite element solver in FEniCS with great results thus far, but I have been facing a technical obstacle when using more complicated functions in the variational formul…

---

## [How to correctly enforce conditions on derivatives at interface?](https://fenicsproject.discourse.group/t/how-to-correctly-enforce-conditions-on-derivatives-at-interface/17777)

<div class="topic-metadata">

**Author:** [@Katie](https://fenicsproject.discourse.group/u/Katie)\
**Replies:** 0\
**Last updated:** [June 17, 2025, 8:05am UTC](https://fenicsproject.discourse.group/t/how-to-correctly-enforce-conditions-on-derivatives-at-interface/17777 "2025-06-17T08:05:00Z")

</div>

Hi all, As the title suggests, I was wondering if anyone knows the correct way to enforce conditions on the derivatives at an interface? Currently I am enforcing \\frac{1}{\\mu\_1}\\frac{1}{r}\\frac{d(rA\_1)}{dr} = \\frac{1…

---

## [1D problem in 2D domain with interface conditions on the derivative in cylindrical coordinates](https://fenicsproject.discourse.group/t/1d-problem-in-2d-domain-with-interface-conditions-on-the-derivative-in-cylindrical-coordinates/17756)

<div class="topic-metadata">

**Author:** [@Katie](https://fenicsproject.discourse.group/u/Katie)\
**Replies:** 0\
**Last updated:** [June 14, 2025, 12:59pm UTC](https://fenicsproject.discourse.group/t/1d-problem-in-2d-domain-with-interface-conditions-on-the-derivative-in-cylindrical-coordinates/17756 "2025-06-14T12:59:08Z")

</div>

Hi there, As the title suggests, I am working on a 1D problem in a 2D domain with interface conditions in cylindrical coordinates. I suspect there is a problem with the implementation of the interface conditions, and I …

---

## [Weak formulation of dynamic plasticity](https://fenicsproject.discourse.group/t/weak-formulation-of-dynamic-plasticity/17738)

<div class="topic-metadata">

**Author:** [@yschapira](https://fenicsproject.discourse.group/u/yschapira)\
**Replies:** 0\
**Last updated:** [June 11, 2025, 7:13pm UTC](https://fenicsproject.discourse.group/t/weak-formulation-of-dynamic-plasticity/17738 "2025-06-11T19:13:05Z")

</div>

Hi, I successfully used the variational formulation with dissipation \[Simo and Hughes, p.162\] for finite deformation rate-independent pasticity, i.e. \\Pi(u\_{n+1}, C^p\_{n+1}, \\alpha\_{n+1}, \\gamma) = \\int \\psi^{el}(u\_{…

[Next page](https://fenicsproject.discourse.group/c/variational-formulation/8.md?page=1)
