# Apply quadrature in a piecewise way

**URL:** https://community.freefem.org/t/apply-quadrature-in-a-piecewise-way/114
**Category:** General Discussion
**Created:** [August 19, 2019, 7:20pm UTC](https://community.freefem.org/t/apply-quadrature-in-a-piecewise-way/114 "2019-08-19T19:20:30Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![arousta](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@arousta](https://community.freefem.org/u/arousta)
#### Post date: [August 19, 2019, 7:20pm UTC](https://community.freefem.org/t/apply-quadrature-in-a-piecewise-way/114/1 "2019-08-19T19:20:31Z")

</div>

For my problem I have two meshes, finer mesh by splitting the coarse one by half.

I want to do an intalledges over the **coarse mesh**. As one field is defined on the fine mesh, I need the quadrature to be applied in a piecewise way on each half piece of the edge.

```
mesh Th1 = trunc(Th,1,split=2);
fespace Vh(Th1,P1);
fespace Qh(Th,P1);
Vh fh = x;
varf RHS(p,q) = intalledges(Th,qforder=2)( fh*q );
real[int] rhs = RHS(0,Qh);

```

The above won’t work properly as fh\*q has two pieces on the edge and we should apply the quadrature on each piece. Is there any straightforward way to make this work?
