# demo\_laplacian\_HH0.py on Ubuntu 22.04 install

**URL:** <https://getfem.discourse.group/t/demo-laplacian-hh0-py-on-ubuntu-22-04-install/38>\
**Category:** Questions and issues\
**Created:** [August 19, 2024, 5:50pm UTC](https://getfem.discourse.group/t/demo-laplacian-hh0-py-on-ubuntu-22-04-install/38 "2024-08-19T17:50:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![chidyagp](https://avatars.discourse-cdn.com/v4/letter/c/e274bd/32.png) [@chidyagp](https://getfem.discourse.group/u/chidyagp)\
**Post date:** [August 19, 2024, 5:50pm UTC](https://getfem.discourse.group/t/demo-laplacian-hh0-py-on-ubuntu-22-04-install/38/1 "2024-08-19T17:50:24Z")

</div>

I have installed getfem++ using sudo apt-get install. The installation runs smoothly and I am able to run the demo\_laplacian.py example just fine but I get the following error with the demo\_laplacian\_HH0.py example:

> > python3 demo\_laplacian\_HH0.py  
> > logic\_error exception caught  
> > Traceback (most recent call last):  
> > File “/home/chidyagp/CODES/PYTHON\_CODES/get\_fem\_codes/demo\_laplacian\_HHO.py”, line 58, in   
> > mfu.set\_fem(gf.Fem(‘FEM\_HHO(FEM\_SIMPLEX\_IPK(%d,2),FEM\_SIMPLEX\_CIPK(%d,2))’ % (N,N-1)))  
> > File “/usr/lib/python3/dist-packages/getfem/getfem.py”, line 469, in **init**  
> > generic\_constructor(self,‘fem’,\*args)  
> > File “/usr/lib/python3/dist-packages/getfem/getfem.py”, line 61, in generic\_constructor  
> > self.id = getfem\_from\_constructor(clname,\*args)  
> > RuntimeError: (Getfem::InterfaceError) – Error in ./getfem/dal\_naming\_system.h, line 286 dal::naming\_system::pmethod dal::naming\_system::method\_(const string&, dal::naming\_system::size\_type&, bool) [with METHOD = getfem::virtual\_fem; dal::naming\_system::pmethod = std::shared\_ptr; std::string = std::\_\_cxx11::basic\_string; dal::naming\_system::size\_type = long unsigned int]:  
> > Unknown method: FEM\_SIMPLEX\_IPK(2,2)

---

<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:** [August 22, 2024, 2:41pm UTC](https://getfem.discourse.group/t/demo-laplacian-hh0-py-on-ubuntu-22-04-install/38/2 "2024-08-22T14:41:32Z")

</div>

it works in the current development version

```auto
python3 demo_laplacian_HHO.py 
nbdof : 8520
Trace 2 in getfem_models.cc, line 4400: Mass term assembly for Dirichlet condition
Trace 2 in getfem_models.cc, line 4437: Source term assembly for Dirichlet condition
Trace 2 in getfem_models.cc, line 4400: Mass term assembly for Dirichlet condition
Trace 2 in getfem_models.cc, line 4437: Source term assembly for Dirichlet condition
Trace 2 in getfem_models.cc, line 3477: Generic linear assembly brick: generic matrix assembly
Trace 2 in getfem_models.cc, line 3477: Generic linear assembly brick: generic matrix assembly
Trace 2 in getfem_models.cc, line 3309: Generic source term assembly
Trace 2 in getfem_models.cc, line 3320: Source term: generic source term assembly
Trace 2 in getfem_models.cc, line 3309: Generic source term assembly
Trace 2 in getfem_models.cc, line 3320: Source term: generic source term assembly
Trace 2 in getfem_models.cc, line 4400: Mass term assembly for Dirichlet condition
Trace 2 in getfem_models.cc, line 4437: Source term assembly for Dirichlet condition
Trace 2 in getfem_models.cc, line 4400: Mass term assembly for Dirichlet condition
Trace 2 in getfem_models.cc, line 4437: Source term assembly for Dirichlet condition
Error in L2 norm (without reconstruction): 2.94387e-06
Error in H1 norm (without reconstruction): 0.0022002
Error in L2 norm (with reconstruction): 2.84402e-07
Error in H1 norm (with reconstruction): 2.76756e-05
You can view the solution with (for example):
gmsh laplacian.pos

```

so I guess the getfem version in Ubuntu 22.04 is a bit too old for this example

---

<div class="post-metadata">

**Author:** ![chidyagp](https://avatars.discourse-cdn.com/v4/letter/c/e274bd/32.png) [@chidyagp](https://getfem.discourse.group/u/chidyagp)\
**Post date:** [September 19, 2024, 2:42pm UTC](https://getfem.discourse.group/t/demo-laplacian-hh0-py-on-ubuntu-22-04-install/38/3 "2024-09-19T14:42:03Z")

</div>

Thank you for the response, Konstantinos. Is there any way I can get the development version? I tried installing version 5.4.2 from source using these [instructions](https://getfem.org/install/install_linux.html) and still failed to run the \*_HHO example. I also tried the DG example and that didn’t work. Maybe I am missing something in my configuration? Here is the error I get  
$ python3 demo\_laplacian\_HHO.py  
logic\_error exception caught  
Traceback (most recent call last):  
File “…/getfem/interface/tests/python/demo\_laplacian\_HHO.py”, line 58, in   
mfu.set\_fem(gf.Fem(‘FEM\_HHO(FEM\_SIMPLEX\_IPK(%d,2),FEM\_SIMPLEX\_CIPK(%d,2))’ % (N,N-1)))  
File “/usr/lib/python3/dist-packages/getfem/getfem.py”, line 469, in **init**  
generic\_constructor(self,‘fem’,\*args)  
File “/usr/lib/python3/dist-packages/getfem/getfem.py”, line 61, in generic\_constructor  
self.id = getfem\_from\_constructor(clname,\*args)  
RuntimeError: (Getfem::InterfaceError) – Error in ./getfem/dal\_naming\_system.h, line 286 dal::naming\_system::pmethod dal::naming\_system::method_(const string&, dal::naming\_system::size\_type&, bool) [with METHOD = getfem::virtual\_fem; dal::naming\_system::pmethod = std::shared\_ptr; std::string = std::\_\_cxx11::basic\_string; dal::naming\_system::size\_type = long unsigned int]:  
Unknown method: FEM\_SIMPLEX\_IPK(2,2)

---

<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:** [September 19, 2024, 7:37pm UTC](https://getfem.discourse.group/t/demo-laplacian-hh0-py-on-ubuntu-22-04-install/38/4 "2024-09-19T19:37:40Z")

</div>

this is strange, can you please report the output of

```auto
import getfem as gf
print(gf.getfem_env("version"))

```

?

---

<div class="post-metadata">

**Author:** ![chidyagp](https://avatars.discourse-cdn.com/v4/letter/c/e274bd/32.png) [@chidyagp](https://getfem.discourse.group/u/chidyagp)\
**Post date:** [September 20, 2024, 2:02pm UTC](https://getfem.discourse.group/t/demo-laplacian-hh0-py-on-ubuntu-22-04-install/38/5 "2024-09-20T14:02:59Z")

</div>

The output is 5.3.  
~/getfem-5.4.2/interface/tests/python$ python3 demo\_laplacian.py  
5.3

How can I manually remove the old getfem version before I do a fresh install? I thought I would be able to overwrite the old version with a new install.

---

<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:** [September 22, 2024, 10:13am UTC](https://getfem.discourse.group/t/demo-laplacian-hh0-py-on-ubuntu-22-04-install/38/6 "2024-09-22T10:13:24Z")

</div>

it depends on how you installed the 5.3 version before.

If you installed it through the software repositories (apt) then you should uninstall it through the same system. I recommend you to use a graphical interface for apt, the best one is synaptic:

> **[Synaptic (software)](https://en.wikipedia.org/wiki/Synaptic_(software))**
>
> Synaptic is a GTK-based graphical user interface designed for the APT package manager used by the Debian Linux distribution and its derivatives. Synaptic is usually used on systems based on deb packages but can also be used on systems based on RPM packages. It can be used to install, remove and upgrade software packages and to add repositories.
> The package manager enables the user to install, to upgrade or to remove software packages. To install or remove a package a user must search or navigate...

If you have installed other versions of getfem manually yourself, i.e. outside the apt package managing system, then you need to remember what steps exactly you performed.

In general NEVER use “sudo” when you perform manual installations like this:

[https://getfem.org/install/install\_linux.html](https://getfem.org/install/install_linux.html)

it will mess up your system.
