# Issue to define FE space of MeshS type

**URL:** <https://community.freefem.org/t/issue-to-define-fe-space-of-meshs-type/1504>\
**Category:** General Discussion\
**Created:** [February 17, 2022, 1:52pm UTC](https://community.freefem.org/t/issue-to-define-fe-space-of-meshs-type/1504 "2022-02-17T13:52:56Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Loic](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@Loic](https://community.freefem.org/u/Loic)\
**Post date:** [February 17, 2022, 1:52pm UTC](https://community.freefem.org/t/issue-to-define-fe-space-of-meshs-type/1504/1 "2022-02-17T13:52:56Z")

</div>

Hello All,

I build a 2D mesh on the SALOME Plateform (a grid in the plane OXY). Then, I import this mesh in FreeFEM like this

```auto
meshS TH=readmeshS("coarse_grid.mesh");

```

However, it seems that I cannot do

```auto
fespace P0P0(TH,[P0, P0])

```

on this mesh (no matter the FE space in the bracket). I have a Segmentation Error.

Before, I was doing this with a 2D mesh of type `mesh (no meshS)` and it was working well. I don’t understand why.

Could someone help me with this problem ?

Otherwise, how could I change meshS type to mesh Type ?

Thank you in advance,

Best regards,

Loïc,

---

<div class="post-metadata">

**Author:** ![Loic](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@Loic](https://community.freefem.org/u/Loic)\
**Post date:** [February 18, 2022, 9:52am UTC](https://community.freefem.org/t/issue-to-define-fe-space-of-meshs-type/1504/2 "2022-02-18T09:52:33Z")

</div>

For more precisions,

This FE space `VH=fespace(P0)` works well, but this FE space `VH=fespace([P0])` does not work.

It makes me think at the problem:

> [@Error assembling a matrix 3d surface mesh](https://community.freefem.org/t/error-assembling-a-matrix-3d-surface-mesh/325):
>
> Hello, I came across a segmentation fault when trying to get a matrix from varf when using a 3d surface mesh. The following code gives the error, using the torus given as example in the doc. I have tried with both FreeFem++4.5 and the recent 4.6. Any ideas on how to solve this ? Thank you. load"msh3" real R = 3, r=1; …

but I am on version 4.9.

Loïc,

---

<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:** [February 20, 2022, 4:29pm UTC](https://community.freefem.org/t/issue-to-define-fe-space-of-meshs-type/1504/3 "2022-02-20T16:29:44Z")

</div>

I have try this

```auto
load "msh3"
meshS TH=square3(3,3);
//However, it seems that I cannot do
fespace P0P0(TH,[P0, P0]);

```

It seems Ok

---

<div class="post-metadata">

**Author:** ![Loic](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@Loic](https://community.freefem.org/u/Loic)\
**Post date:** [February 20, 2022, 4:45pm UTC](https://community.freefem.org/t/issue-to-define-fe-space-of-meshs-type/1504/4 "2022-02-20T16:45:29Z")

</div>

Hello @frederichecht ,

Thank you for your reply,

This does not work with my version of FreeFEM (I am on version 4.9). I don’t understand why. It works also with @prj.

Do you have an idea about why this does not work on my machine ?

Thank you in advance,

Best regards,

Loïc,

---

<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:** [February 21, 2022, 8:19am UTC](https://community.freefem.org/t/issue-to-define-fe-space-of-meshs-type/1504/5 "2022-02-21T08:19:38Z")

</div>

1. Can you send the “coarse\_grid.mesh” , I want to try on my laptop.
2. You run FreeFEM++ on with type of computer?

---

<div class="post-metadata">

**Author:** ![Loic](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@Loic](https://community.freefem.org/u/Loic)\
**Post date:** [February 21, 2022, 8:25am UTC](https://community.freefem.org/t/issue-to-define-fe-space-of-meshs-type/1504/6 "2022-02-21T08:25:34Z")

</div>

Hello @frederichecht ,

Thank you for your message, here my mesh :  
[coarse\_grid.mesh](https://community.freefem.org/uploads/short-url/mbpfmEUYJ5mMWpHygs1Qi3t8pyK.mesh) (266 Bytes)

I have even tried this:

```auto
load "msh3"
meshS TH=square3(3,3);
//However, it seems that I cannot do
fespace P0P0(TH,[P0, P0]);

```

But it does not work too.

I run FreeFEM++ on UBUNTU 20.

Best regards,

Loïc,

---

<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:** [February 21, 2022, 9:15am UTC](https://community.freefem.org/t/issue-to-define-fe-space-of-meshs-type/1504/7 "2022-02-21T09:15:05Z")

</div>

I will try on this computer.

---

<div class="post-metadata">

**Author:** ![Loic](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@Loic](https://community.freefem.org/u/Loic)\
**Post date:** [February 21, 2022, 10:26am UTC](https://community.freefem.org/t/issue-to-define-fe-space-of-meshs-type/1504/8 "2022-02-21T10:26:28Z")

</div>

Thank you @frederichecht,

Let me know about the result,

Best regards,

Loïc,

---

<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:** [February 21, 2022, 5:34pm UTC](https://community.freefem.org/t/issue-to-define-fe-space-of-meshs-type/1504/9 "2022-02-21T17:34:39Z")

</div>

I think the bug come form and correct in  
commit baf1996585e5dbc09b591e2dcf62b9e5e8e88a31  
Author: Frederic Hecht [frederic.hecht@upmc.fr](mailto:frederic.hecht@upmc.fr)  
Date: Wed Mar 24 14:52:06 2021 +0100

```
correct problem of initialisatio of static after usage on ubuntu os,
remove the static of G (barycenter) use in PkLagrange.hpp had to find ...

```

So no way with version 4.9

---

<div class="post-metadata">

**Author:** ![Loic](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@Loic](https://community.freefem.org/u/Loic)\
**Post date:** [February 21, 2022, 6:03pm UTC](https://community.freefem.org/t/issue-to-define-fe-space-of-meshs-type/1504/10 "2022-02-21T18:03:13Z")

</div>

Thank you for your reply @frederichecht .

So I have to compile the FreeFEM version v.10 ?

@prj already advise me to compile on dev branch.

Best regards,

Loïc,

---

<div class="post-metadata">

**Author:** ![Loic](https://avatars.discourse-cdn.com/v4/letter/l/e9c0ed/32.png) [@Loic](https://community.freefem.org/u/Loic)\
**Post date:** [February 23, 2022, 4:07pm UTC](https://community.freefem.org/t/issue-to-define-fe-space-of-meshs-type/1504/11 "2022-02-23T16:07:51Z")

</div>

Works well with FreeFEM version v10.

Loïc,
