# Writing a constraint for a jump

**URL:** <https://community.freefem.org/t/writing-a-constraint-for-a-jump/1694>\
**Category:** General Discussion\
**Created:** [April 24, 2022, 5:17am UTC](https://community.freefem.org/t/writing-a-constraint-for-a-jump/1694 "2022-04-24T05:17:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mahdi](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mahdi](https://community.freefem.org/u/mahdi)\
**Post date:** [April 24, 2022, 5:17am UTC](https://community.freefem.org/t/writing-a-constraint-for-a-jump/1694/1 "2022-04-24T05:17:36Z")

</div>

Dear colleagues;  
I have trouble creating a jump over an edge for my field, \psi, a **P2** element.  
I am solving, where q and \mu are known, and r is a multiplier:  
 ![Screenshot from 2022-04-23 21-45-11](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/6/6394d6648addaac58adf32ab72886fa312c4d34e.png)  
Over a square, with an extracted circle from the center as follow:  
 ![Screenshot from 2022-04-23 22-06-26](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/2X/d/d467b976c66f2b55300a84ff5860deda7326bc5b.png)

I want a difference of \psi over the blue dashed line: i.e., \psi|\_{below}=\psi|\_{above}+2 \pi for instance, while \nabla \psi remains continuos on both sides (without cutting or any alterations to the domain).

What terms some I add to the

> solve Mahdi( \psi , v ) = int2d(Th)( r\*(dx(\psi)\*dx(v) + dy(\psi)_dy(v)) ) + int2d(Th)( ( \mu x-r_qx )_dx(v) + ( \mu y-r_qy )\*dy(v) )

Is there such a thing available in FreeFem for a P2 element?

Please accept my apologies for my weak knowledge.  
Thanks for your resourceful thoughts in advance.

---

<div class="post-metadata">

**Author:** ![mahdi](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@mahdi](https://community.freefem.org/u/mahdi)\
**Post date:** [April 25, 2022, 10:44pm UTC](https://community.freefem.org/t/writing-a-constraint-for-a-jump/1694/2 "2022-04-25T22:44:33Z")

</div>

Writing as:  
solve Mahdi(\psi , v )= int2d(Th)( r\*(dx(\psi)\*dx(v) + dy(\psi)_dy(v)) ) + int2d(Th)( (\mu x-r_qx )_dx(v) + ( \mu y-r_qy )_dy(v) )  
+  
intalledges(Th)((label==1)_ v \* (2 \*pi)\*jump(\psi));

Where the label for the blue dashed line is 1, it didn’t solve the problem.
