# Manual modification of a mesh

**URL:** <https://community.freefem.org/t/manual-modification-of-a-mesh/522>\
**Category:** General Discussion\
**Created:** [July 26, 2020, 7:11pm UTC](https://community.freefem.org/t/manual-modification-of-a-mesh/522 "2020-07-26T19:11:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![paolopiers](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.freefem.org/paolopiers/32/48_2.png) [@paolopiers](https://community.freefem.org/u/paolopiers)\
**Post date:** [July 26, 2020, 7:11pm UTC](https://community.freefem.org/t/manual-modification-of-a-mesh/522/1 "2020-07-26T19:11:14Z")

</div>

Hi everybody,  
I am working on a predictor-corrector algorithm in mechanics and I am stuck on the following technicality.

The problem I am interested in is the following.  
Given a mesh (half a circle), I would like to manually move the point on the top of the mesh, and _recompute_/_reshape_ the mesh after this manual deformation (_manual_, in the sense that it is not computed by solving an equation.

I attach my attempted solution but I receive a compilation error.  
Would you know how to solve this issue?

Thanks 🙂

```
real r=0.5;
//half circle mesh
border c1(t=0,pi){x=r*cos(t);y=r*sin(t);label=1;}
border c2(t=0,1){x=(t-1)*r+t*r;y=0.0;label=2;}
mesh Th= buildmesh(c1(100)+c2(100));
plot(Th, wait=1);

int NbVertices = Th.nv;
cout << "Number of vertices = " << NbVertices << endl;
int target;

for (int i = 0; i < NbVertices; i++){
    cout << "Th(" << i << ") : " << Th(i).x << " " << Th(i).y << endl;
    if(Th(i).y==0.5){
        target=I; // there is only one point with such feature
    }
    cout<< target<<endl; // the index corresponding to the point on the top is 1563
}

Th(target).y=0.45; // decrement from 0.5 to 0.45
```
