# Nodes in boundary

**URL:** https://community.freefem.org/t/nodes-in-boundary/869
**Category:** General Discussion
**Created:** [March 25, 2021, 10:52am UTC](https://community.freefem.org/t/nodes-in-boundary/869 "2021-03-25T10:52:21Z")
**Posts on this page:** 2
**Page:** 1

<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 25, 2021, 10:52am UTC](https://community.freefem.org/t/nodes-in-boundary/869/1 "2021-03-25T10:52:21Z")

</div>

Hi,  
how can I find the indixs of nodes in the boundary of mesh in (2d)

---

<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 25, 2021, 7:52pm UTC](https://community.freefem.org/t/nodes-in-boundary/869/2 "2021-03-25T19:52:33Z")

</div>

I build a small macro to get the list of of on some border but no all, this border must be be no close.

include “ExtractDofsonBorder.idp”  
mesh Th = square(20,20,[x_pi,pi_y]);  
real c = 0.5;  
// the exact solut  
func uex = sin(x+c)_sin(y);  
func f = -2_sin(x+c)\*sin(y);

fespace Vh(Th,P1);

int[int] dof2,dof4;  
// get the list od dof on 2 border and 4 border  
ExtractDofsonBorder(2,Vh,dof2,1)// sens of dof2  
ExtractDofsonBorder(4,Vh,dof4,-1)// reverse sens of dof2  
assert(dof2.n == dof4.n);
