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)
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
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 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)
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.
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:
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: