Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JOSS REVIEW] first example fails #56

Closed
thelfer opened this issue Nov 1, 2024 · 10 comments
Closed

[JOSS REVIEW] first example fails #56

thelfer opened this issue Nov 1, 2024 · 10 comments

Comments

@thelfer
Copy link

thelfer commented Nov 1, 2024

The following example, taken from https://ngspetsc.readthedocs.io/en/latest/PETScKSP/poisson.py.html, fails as follows:

$ python3 poisson.py 
optfile ./ng.opt does not exist - using default values
togl-version : 2
loading ngsolve library
NGSolve-6.2.2405-28-g63cfc18ca
Using Lapack
Including sparse direct solver UMFPACK
Running parallel using 32 thread(s)
Traceback (most recent call last):
  File "/home/th202608/codes/ngsPETSc/tests/Poisson/poisson.py", line 7, in <module>
    ngmesh = unit_square.GenerateMesh(maxh=0.1)
NameError: name 'unit_square' is not defined
@UZerbinati
Copy link
Collaborator

This example is running for me on a fresh install and on the docker image.
Could it be that something went wrong with your ngsolve install?

@thelfer
Copy link
Author

thelfer commented Nov 6, 2024

I just followed your tutorial steps by steps. ngsolve did get installed, so I expect that there is a dependency missing.

@UZerbinati
Copy link
Collaborator

Did you install it with -DUSE_OCC=OFF instead of the default -DUSE_OCC=ON ?

@thelfer
Copy link
Author

thelfer commented Nov 6, 2024

must check

@UZerbinati
Copy link
Collaborator

UZerbinati commented Nov 6, 2024

Because unit_square has lately become an OCC object in ngsolve hence, if you install without OCC support it might not be there.
You should be able to test the code even without OCC if you use from netgen.geom2d import unit_square.

@thelfer
Copy link
Author

thelfer commented Nov 6, 2024

Indeed. I remember that I removed it because OCC was not listed as a dependency to ngsolve

@thelfer
Copy link
Author

thelfer commented Nov 6, 2024

I think that you have two choices :)

  • update the installation guide to include OCC as a mandatory dependency
  • update your examples

@UZerbinati UZerbinati mentioned this issue Nov 6, 2024
UZerbinati added a commit that referenced this issue Nov 6, 2024
Fix Issue #56 

---------

Signed-off-by: Umberto Zerbinati <zerbinati@maths.ox.ac.uk>
Co-authored-by: Umberto Zerbinati <zerbinati@maths.ox.ac.uk>
@UZerbinati
Copy link
Collaborator

We have included include OCC as a mandatory dependency (we will also change the pyproject.toml in next PR).

@thelfer
Copy link
Author

thelfer commented Nov 27, 2024

Hi @UZerbinati,

Sorry for being so slow.

I reinstalled ngsolve, but there is still an issue with your install instructions: I had to add this package to be able to build ngsolve with OpenCascade enabled:

$ pip install  netgen-occt-devel

As a suggestion, I would add this line in your tutorial after the call to Draw:

input("Press the <ENTER> key to continue...")

@UZerbinati
Copy link
Collaborator

Thank you for spotting this. It has been fixed in PR #65.

@thelfer thelfer closed this as completed Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants