# Error generating quadratic mesh

**URL:** <https://fenicsproject.discourse.group/t/error-generating-quadratic-mesh/8150>\
**Category:** mesh\
**Created:** [April 25, 2022, 6:12pm UTC](https://fenicsproject.discourse.group/t/error-generating-quadratic-mesh/8150 "2022-04-25T18:12:33Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![jeannafta](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/jeannafta/32/3563_2.png) [@jeannafta](https://fenicsproject.discourse.group/u/jeannafta)\
**Post date:** [April 26, 2022, 12:21pm UTC](https://fenicsproject.discourse.group/t/error-generating-quadratic-mesh/8150/3 "2022-04-26T12:21:48Z")

</div>

Thank you very much @dokken, it worked perfectly!

I have another question that follows from this. If now I want to find the cell size of my quadratic elements, can I reuse the following code ([Evaluation of cell sizes](https://fenicsproject.discourse.group/t/evaluation-of-cell-sizes/6381))?

```auto
tdim = mesh.topology.dim
num_cells = mesh.topology.index_map(tdim).size_local
h = dolfinx.cpp.mesh.h(mesh, tdim, range(num_cells))
print(h)

```

Because when I run it, it gives the following error:

```auto
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
Input In [14], in <cell line: 3>()
      1 tdim = mesh.topology.dim
      2 num_cells = mesh.topology.index_map(tdim).size_local
----> 3 h = dolfinx.cpp.mesh.h(mesh, tdim, range(2*num_cells))
      4 h_av = np.mean(h)

RuntimeError: Incompatible dimension of arrays, compile in DEBUG for more info

```

Or is there a way to convert the quadratic mesh into a linear mesh directly from fenics, without having to re-generate a mesh on gmsh for example?

Thanks again for all your help!

---

_[View the full topic](https://fenicsproject.discourse.group/t/error-generating-quadratic-mesh/8150)._
