# Getting error giving the quadrature type explicitly

**URL:** <https://community.freefem.org/t/getting-error-giving-the-quadrature-type-explicitly/119>\
**Category:** General Discussion\
**Created:** [August 30, 2019, 12:11am UTC](https://community.freefem.org/t/getting-error-giving-the-quadrature-type-explicitly/119 "2019-08-30T00:11:30Z")\
**Posts on this page:** 3\
**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 30, 2019, 12:11am UTC](https://community.freefem.org/t/getting-error-giving-the-quadrature-type-explicitly/119/1 "2019-08-30T00:11:30Z")

</div>

When I use the qfe= option in int2d function I get error. It is fine if I use qforder=  
The program below:

```
mesh Th = square(3,3);
fespace Vh(Th,P1);
Vh v=x;
real s = int2d(Th,qfe=qf1pT)(v);

```

Error:

`Impossible to cast <N5Fem2D19GQuadratureFormularINS_2R2EEE> in <N5Fem2D19GQuadratureFormularINS_2R1EEE>`

---

<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:** [August 30, 2019, 8:01am UTC](https://community.freefem.org/t/getting-error-giving-the-quadrature-type-explicitly/119/2 "2019-08-30T08:01:31Z")

</div>

it is normal you give a wrong quadrature formula (on edge not on traingle)  
qte= (quadrature on egde (1d))  
qft= … (quadrature on face/triangle (2d))  
qfV= … (quadrature on tet (3d))

```auto
mesh Th = square(3,3);
fespace Vh(Th,P1);
Vh v=x;
real s = int2d(Th,qft=qf1pT)(v);

```

---

<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 30, 2019, 5:57pm UTC](https://community.freefem.org/t/getting-error-giving-the-quadrature-type-explicitly/119/3 "2019-08-30T17:57:59Z")

</div>

Thanks Frederic, now it’s fine. But the documentation is wrong then! Here is a screenshot. It uses qfe for int2d (Sec 4.3.2)

 ![Screenshot%20at%202019-08-30%2010-53-30](https://canada1.discourse-cdn.com/flex030/uploads/freefem/original/1X/7f4eabe272484e0dae26aa0e28412a544542c34a.png)
