# Coordinate naming in MeshFem

**URL:** <https://getfem.discourse.group/t/coordinate-naming-in-meshfem/103>\
**Category:** Questions and issues\
**Created:** [October 28, 2025, 2:07pm UTC](https://getfem.discourse.group/t/coordinate-naming-in-meshfem/103 "2025-10-28T14:07:31Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![bucc95](https://avatars.discourse-cdn.com/v4/letter/b/c68b51/32.png) [@bucc95](https://getfem.discourse.group/u/bucc95)\
**Post date:** [October 28, 2025, 2:07pm UTC](https://getfem.discourse.group/t/coordinate-naming-in-meshfem/103/1 "2025-10-28T14:07:31Z")

</div>

Hi all, I’m trying to learn how to use GetFEm.

I’d like to define a function with the MeshFem.eval method, but I’m not sure about the syntax I am expected to use in the ‘expression’ argument.

The GWLF language does not work, while, in some examples, it is shown how mathematical functions from numpy can be used. However, I don’t understand how spatial coordinates are named in this context. Up to 3 dimensions x, y, and z are often used, but I am interested in higher-dimensional problems, and I cannot find out how, for example, the fourth dimension is named in this context.

Thank you very much.

Diego

---

<div class="post-metadata">

**Author:** ![Konstantinos.Poulios](https://avatars.discourse-cdn.com/v4/letter/k/ac91a4/32.png) [@Konstantinos.Poulios](https://getfem.discourse.group/u/Konstantinos.Poulios)\
**Post date:** [October 28, 2025, 3:15pm UTC](https://getfem.discourse.group/t/coordinate-naming-in-meshfem/103/2 "2025-10-28T15:15:16Z")

</div>

hello and welcome,

I would advice you against using the eval method. GWFL is the modern way. In GWFL the spatial coordinates are X(1), X(2), X(3), … You can define macros to rename those to x,y,z,… but I normally prefer to keep the standard GWFL notation.

GWFL has all common mathematical operators, if you need if conditions you can implement those using either the min/max() or the Heaviside function.

I’d be glad to help if you have some specific issue with GWFL in higher dimensions.

---

<div class="post-metadata">

**Author:** ![bucc95](https://avatars.discourse-cdn.com/v4/letter/b/c68b51/32.png) [@bucc95](https://getfem.discourse.group/u/bucc95)\
**Post date:** [October 29, 2025, 1:09pm UTC](https://getfem.discourse.group/t/coordinate-naming-in-meshfem/103/3 "2025-10-29T13:09:56Z")

</div>

Hi Konstantinos,

thanks for the quick answer.

What I don’t understand is how I am supposed to set the initial conditions of a time evolution problem without using eval. In the examples I found, this is done via the set\_variable method of the model class, but I don’t know how to evaluate the GWFL expression on the mesh and produce the array of initial data. I would need an equivalent of eval that accepts GWFL expressions, but I cannot find it in the documentation

Is there a different modern way to do this?

Thank you

---

<div class="post-metadata">

**Author:** ![Konstantinos.Poulios](https://avatars.discourse-cdn.com/v4/letter/k/ac91a4/32.png) [@Konstantinos.Poulios](https://getfem.discourse.group/u/Konstantinos.Poulios)\
**Post date:** [October 29, 2025, 1:22pm UTC](https://getfem.discourse.group/t/coordinate-naming-in-meshfem/103/4 "2025-10-29T13:22:23Z")

</div>

if `u` is an unknown vector field with 2 components you can do stuff like this:

```python
md.set_variable("u", md.interpolation("[0.1*X(1);-0.1*X(2)]", mfu)

```

or even if you do not know the correct mfu, you can still do

```python
md.set_variable("u", md.interpolation("[0.1*X(1);-0.1*X(2)]",
                                      md.mesh_fem_of_variable("u")))

```

where `md` is a model object, if you do not use a model object, you can create one on the fly just for this operation.

The model interpolation function is very general, it can evaluate on the nodes of a `mesh_fem`, or on the integration points of a `mesh_im_data`, or even on an arbitrary cloud of points.

---

<div class="post-metadata">

**Author:** ![bucc95](https://avatars.discourse-cdn.com/v4/letter/b/c68b51/32.png) [@bucc95](https://getfem.discourse.group/u/bucc95)\
**Post date:** [October 31, 2025, 10:59am UTC](https://getfem.discourse.group/t/coordinate-naming-in-meshfem/103/5 "2025-10-31T10:59:15Z")

</div>

Hi,

Thank you for your help. I’m slowly getting into the logic.

I’ve written my code, but now the default solver called by evaluate does not converge.

As far as I understood, using MUMPS in these cases could help in 3D, would it also be useful in higher dimensions?

Unfortunately, I didn’t manage to complete the installation with MUMPS via mingw64 on Windows because of some incompatibility with the .configure file, but maybe it would be better to discuss that in another thread.

Diego

---

<div class="post-metadata">

**Author:** ![Konstantinos.Poulios](https://avatars.discourse-cdn.com/v4/letter/k/ac91a4/32.png) [@Konstantinos.Poulios](https://getfem.discourse.group/u/Konstantinos.Poulios)\
**Post date:** [December 11, 2025, 7:42am UTC](https://getfem.discourse.group/t/coordinate-naming-in-meshfem/103/6 "2025-12-11T07:42:25Z")

</div>

for windows users, just use WSL it is so much easier.
