# Local force Calculation using stress field

**URL:** https://community.freefem.org/t/local-force-calculation-using-stress-field/1634
**Category:** General Discussion
**Created:** [March 30, 2022, 8:46am UTC](https://community.freefem.org/t/local-force-calculation-using-stress-field/1634 "2022-03-30T08:46:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Markov](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@Markov](https://community.freefem.org/u/Markov)
#### Post date: [March 30, 2022, 8:46am UTC](https://community.freefem.org/t/local-force-calculation-using-stress-field/1634/1 "2022-03-30T08:46:36Z")

</div>

Hello,

I would like to calculate the local force vector using a stress field of the size of (0, Vh). Assuming that the stress field is already projected on to the x, y and z components (so I have three stress components) how do I obtain F(0, Vh) ?

Thanks

---

<div class="post-metadata">

### Author: ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)
#### Post date: [March 31, 2022, 4:38pm UTC](https://community.freefem.org/t/local-force-calculation-using-stress-field/1634/2 "2022-03-31T16:38:41Z")

</div>

set a varf to compute the stress form the deformation  
or do just interpolation

```auto
fespace VH3(TH,P1dc,P1dc,P1dc);
VH3 [sigma11,sigma22,sigma12] ; 
macro epsilon(u1,u2) [dx(u1),dy(u2),(dx(u1)+dy(u2)/2.]//
func A = [[...],[...],[...]]; // matrice form material 
[sigma11,sigma22,sigma12] = A*epsilon([u1,u2]) ; 

```

---

<div class="post-metadata">

### Author: ![Markov](https://avatars.discourse-cdn.com/v4/letter/m/f1d935/32.png) [@Markov](https://community.freefem.org/u/Markov)
#### Post date: [March 31, 2022, 6:55pm UTC](https://community.freefem.org/t/local-force-calculation-using-stress-field/1634/3 "2022-03-31T18:55:53Z")

</div>

Dear Dr. Hecht,

Thank you for your reply. In my case the stress vector is already calculated, i need to calculate the local force on each node using this stress vector. So i thought that i need to take the average stress on each cell then multiply by this cell area to get the force then project onto the nodes. I was wondering how can i implement it, or is there a better way to do it?

Mark

---

<div class="post-metadata">

### Author: ![frederichecht](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/frederichecht/32/15_2.png) [@frederichecht](https://community.freefem.org/u/frederichecht)
#### Post date: [April 2, 2022, 10:20am UTC](https://community.freefem.org/t/local-force-calculation-using-stress-field/1634/4 "2022-04-02T10:20:08Z")

</div>

if your stress if S=[[s11,s21][s21,s22]] variables in 2d

we have on each element  
\int\_K F = \int\_{\partial K} S .n where n is the unitary exterior normal to K

so write this in freefeem++ (5 mn)
