# Fix the value at a point

**URL:** https://community.freefem.org/t/fix-the-value-at-a-point/882
**Category:** General Discussion
**Created:** [March 30, 2021, 2:04pm UTC](https://community.freefem.org/t/fix-the-value-at-a-point/882 "2021-03-30T14:04:28Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)
#### Post date: [March 30, 2021, 2:04pm UTC](https://community.freefem.org/t/fix-the-value-at-a-point/882/1 "2021-03-30T14:04:29Z")

</div>

Dear all,

How can I prescribe a value at a fixed point in FreeFEM++? For example, fix the velocity to be zero at the centre of a rotating disc; or fix the pressure at the reference point for a flow problem?

Thanks in advance!

Best,  
Yongxing.

---

<div class="post-metadata">

### Author: ![Daoudi](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Daoudi](https://community.freefem.org/u/Daoudi)
#### Post date: [March 31, 2021, 2:27pm UTC](https://community.freefem.org/t/fix-the-value-at-a-point/882/2 "2021-03-31T14:27:18Z")

</div>

Suppos that the indix of your node is N  
Then the velocity Vh in this point :

Vh[][N]=the disered value

---

<div class="post-metadata">

### Author: ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)
#### Post date: [March 31, 2021, 3:06pm UTC](https://community.freefem.org/t/fix-the-value-at-a-point/882/3 "2021-03-31T15:06:00Z")

</div>

Thank you Daoudi,  
How can I know the node index N? Sorry if this is silly question, I am just new to FreeFEM.  
Best,  
Yongxing.

---

<div class="post-metadata">

### Author: ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)
#### Post date: [March 31, 2021, 6:27pm UTC](https://community.freefem.org/t/fix-the-value-at-a-point/882/5 "2021-03-31T18:27:56Z")

</div>

I tried a simply test:

u[][10]=10;  
solving the FEM problem  
cout\<\<u[][10]\<endl;

Unfortunately,  
The value is rewritten after soling the system equations.

---

<div class="post-metadata">

### Author: ![Daoudi](https://avatars.discourse-cdn.com/v4/letter/d/3ec8ea/32.png) [@Daoudi](https://community.freefem.org/u/Daoudi)
#### Post date: [April 4, 2021, 1:05pm UTC](https://community.freefem.org/t/fix-the-value-at-a-point/882/6 "2021-04-04T13:05:02Z")

</div>

Sorry for the late  
Suppos that your :  
stiffness Matrix is A  
Mass Matrix is M  
Forces vector is b (Right hand)  
Solution vector is u  
Then for your specific value p1 ( indix p)

u(p)=the specific value;

1. b=b - (A(p,:)+M(p,:))\*u // ( like a dirichlet condition s)

2. delete the row p of matrices A and M  
Solve the system u[]=(A+M)-^1\*b

---

<div class="post-metadata">

### Author: ![yongxing](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/yongxing/32/3632_2.png) [@yongxing](https://community.freefem.org/u/yongxing)
#### Post date: [April 4, 2021, 8:37pm UTC](https://community.freefem.org/t/fix-the-value-at-a-point/882/7 "2021-04-04T20:37:22Z")

</div>

Thank you very much Daoudi.  
Yongxing.
