# How to set Neumann boundary conditions to solve adjoint variable

**URL:** <https://fenicsproject.discourse.group/t/how-to-set-neumann-boundary-conditions-to-solve-adjoint-variable/13975>\
**Category:** variational formulation\
**Tags:** boundary-conditions, dolfinx\
**Created:** [March 20, 2024, 9:06am UTC](https://fenicsproject.discourse.group/t/how-to-set-neumann-boundary-conditions-to-solve-adjoint-variable/13975 "2024-03-20T09:06:59Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)\
**Post date:** [March 25, 2024, 7:46am UTC](https://fenicsproject.discourse.group/t/how-to-set-neumann-boundary-conditions-to-solve-adjoint-variable/13975/3 "2024-03-25T07:46:40Z")

</div>

Dear @Pasuta

It is quite hard to give you any guidance when you do not specify mathematically what problems you are solving.

I have already sketched out how to set up the adjoint equations in DOLFINx at: [Calculate sensitivity when the control is a fem function - #3 by dokken](https://fenicsproject.discourse.group/t/calculate-sensitivity-when-the-control-is-a-fem-function/13066/3)  
which I have sent to you before.

---

_[View the full topic](https://fenicsproject.discourse.group/t/how-to-set-neumann-boundary-conditions-to-solve-adjoint-variable/13975)._
