# Normal stress in a horizontal line inside of a mesh from top side only

**URL:** <https://community.freefem.org/t/normal-stress-in-a-horizontal-line-inside-of-a-mesh-from-top-side-only/3717>\
**Category:** General Discussion\
**Created:** [January 30, 2025, 6:28pm UTC](https://community.freefem.org/t/normal-stress-in-a-horizontal-line-inside-of-a-mesh-from-top-side-only/3717 "2025-01-30T18:28:19Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![fb77](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/fb77/32/3796_2.png) [@fb77](https://community.freefem.org/u/fb77)\
**Post date:** [January 31, 2025, 10:58am UTC](https://community.freefem.org/t/normal-stress-in-a-horizontal-line-inside-of-a-mesh-from-top-side-only/3717/2 "2025-01-31T10:58:03Z")

</div>

Hello,  
Your approach is correct. Using `buildmesh` you can put a `border` that is inside the domain.  
Then it has a label (1 in your case) that can be used to compute `int1d(Th,1)()`.  
This “internal border” is considered as a boundary. In particular if you write `int1d(Th)` without mentioning a label, it will integrate on all boundaries, including the “internal boundary”.

When you have a finite element function `u` that is discontinuous through the internal boundary (for example if `u` is P0 on Th), your question is “what computes `int1d(Th,1)(u)`?”.  
The answer is that it uses the value of `u` only from one side: the side opposite to the direction of the normal (like if the normal were pointing outside the domain, and the value would be taken from inside the domain).  
The orientation of the normal to the internal boundary` [N.x,N.y]` is determined by its orientation.  
If you write for example  
`border b1(t=0.,1.){x=t ; y=1. ;label=1;}`  
then the orientation is from left to right, and the normal points down (`N.y=-`1), the value of `u` is taken from the up side.  
If you write  
`border b1(t=0.,1.){x=1.-t ; y=1. ;label=1;}` then the orientation is from right to left, the normal points upwards (`N.y=1`), the value of `u` is taken from the down side.

However the operators `dx()` and `dy()` are applied globally to a finite element function `v`.  
For example if `v` is P1 on Th, then `dx(v)` is computed globally, it is P0 on Th.  
If you write `int1d(Th,1)(dx(v))` it will take the value of `dx(v)` only on the side determined by the orientation (as above).

---

_[View the full topic](https://community.freefem.org/t/normal-stress-in-a-horizontal-line-inside-of-a-mesh-from-top-side-only/3717)._
