thetisproject / thetis

Finite element flow solver for simulating coastal and estuarine flows.
Other
68 stars 28 forks source link

thetis error #372

Open charithaRdissanayaka opened 1 month ago

charithaRdissanayaka commented 1 month ago

Dear all,

I am very new for thetis. i installed firedrake and clone the thetis folder from github. how can I run the example cases? I just run examples/channel3d/channel3d.py, then following error encountered.

(firedrake) yachiyo@DRS101092606:/mnt/c/Users/Z02263/Desktop/THETIS/thetis/examples/channel3d$ python3 channel3d.py Traceback (most recent call last): File "/mnt/c/Users/Z02263/Desktop/THETIS/thetis/examples/channel3d/channel3d.py", line 13, in from thetis import * ModuleNotFoundError: No module named 'thetis'

Please be kind enough to explain me how to start thetis modelling work.

cpjordan commented 1 month ago

Hello! Looks like you have activated the Firedrake virtual environment but Thetis is not found when you try to run an example - did you install Thetis when you installed Firedrake i.e. python3 firedrake-install --install thetis?

If not, you should be able to install Thetis as explained on the website with firedrake-update --install thetis.

charithaRdissanayaka commented 1 month ago

Hello sir,

yes i installed thetis in to the following directory in wsl by the command python3 firedrake-install --install thetis

Install log saved in /home/charitha/firedrake-install.log

charithaRdissanayaka commented 1 month ago

how can i run the example please?

cpjordan commented 1 month ago

The example is not running because Thetis is not being imported, which suggests a problem with the install or the path to Thetis. Firstly, you can check that Firedrake has fully installed correctly by running (within your Firedrake environment)?

cd $VIRTUAL_ENV/src/firedrake pytest tests/regression/ -k "poisson_strong or stokes_mini or dg_advection"

charithaRdissanayaka commented 1 month ago

Hello sir,

I will check this and let you know. I extremely sorry for the late reply. Due to a field visit I unable to do the works related to the thetis on the weekend.

charithaRdissanayaka commented 1 month ago

Hello sir,

this is the output of the above command.

Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/_pytest/config.py", line 365, in _importconftest mod = conftestpath.pyimport() File "/usr/lib/python2.7/dist-packages/py/_path/local.py", line 668, in pyimport import(modname) File "/usr/lib/python2.7/dist-packages/_pytest/assertion/rewrite.py", line 213, in loadmodule py.builtin.exec(co, mod.dict) File "/usr/lib/python2.7/dist-packages/py/builtin.py", line 221, in exec exec2(obj, globals, locals) File "", line 7, in exec2 File "/home/charitha/firedrake/src/firedrake/tests/conftest.py", line 4, in from firedrake.petsc import get_external_packages ImportError: No module named firedrake.petsc ERROR: could not load /home/charitha/firedrake/src/firedrake/tests/conftest.py

jwallwork23 commented 1 month ago

I notice you’re using Python 2. This is unlikely to work as Firedrake (and therefore Thetis) have Python 3 as a dependency. Please could you try reinstalling Firedrake and Thetis using a recent version of Python 3?

stephankramer commented 1 month ago

@charithaRdissanayaka : are you sure you ran that command with the firedrake environment activated? Can you try again but now using:

cd $VIRTUAL_ENV/src/firedrake
python -mpytest tests/regression/ -k "poisson_strong or stokes_mini or dg_advection"

(notice the change in the second command)

charithaRdissanayaka commented 1 month ago

I notice you’re using Python 2. This is unlikely to work as Firedrake (and therefore Thetis) have Python 3 as a dependency. Please could you try reinstalling Firedrake and Thetis using a recent version of Python 3?

Hello Sir,

I installed python3.12 and set the environment.

charithaRdissanayaka commented 1 month ago

@charithaRdissanayaka : are you sure you ran that command with the firedrake environment activated? Can you try again but now using:

cd $VIRTUAL_ENV/src/firedrake
python -mpytest tests/regression/ -k "poisson_strong or stokes_mini or dg_advection"

(notice the change in the second command)

Hello Sir,

I uninstalled the firedrake. I will reinstall it and check according to your suggestions. Thank you very much for your kind reply.

charithaRdissanayaka commented 1 month ago

Hello sir,

I installed poython3.12 and change the environment. Also re-installed firedrake. please find the attached log file of the firedrake installation. I be able to activate the firedrake environment from the following command. source /home/charitha firedrake-install.log /firedrake/bin/activate

(firedrake) charitha@DRS101092606:~/firedrake$ cd src/thetis/examples/ (firedrake) charitha@DRS101092606:~/firedrake/src/thetis/examples$ ls init.py dome sediment_meander_2d balzano freshwaterCylinder sediment_trench_2d baroclinic_channel geostrophicGyre stommel2d baroclinic_eddies idealizedEstuary stommel3d bottomFriction katophillips tidal_barrage channel2d lockExchange tidalfarm channel3d nonhydrostatic_cases tohoku_inversion channel_inversion north_sea tracerBox columbia_plume overflow waveEq2d cylinder_eddies reaction waveEq3d discrete_turbines rhineROFI

now how can I run the tutorial please?

cpjordan commented 1 month ago

It looks like there are still some problems with the Firedrake install as libsupermesh is not being installed due to some dependencies, to fix this you can follow these steps: https://github.com/firedrakeproject/firedrake/discussions/3374

Please try this and then run the tests as Stephan described above to check that Firedrake has installed correctly. Unfortunately it can be a little tricky to install Firedrake, but once it is installed we can run the Thetis examples.

charithaRdissanayaka commented 1 month ago

Hello sir,

Thank you very much for your reply. I will follow the method explain in the given discussion link.