underworldcode / underworld2

underworld2: A parallel, particle-in-cell, finite element code for Geodynamics.
http://www.underworldcode.org/
Other
168 stars 58 forks source link

Error while restarting with passive tracers #650

Closed jlikermanUPC closed 1 year ago

jlikermanUPC commented 1 year ago

Hi UW community,

I'm having trouble restarting some models and it seems the problem is that I'm using passive tracers. If I turn them off when I want to restart the problem solves and the models start from the last step, but when they are on I get errors.

I don't quite know what to do to fix this error. I'm using underworld 2.13 with UWGeodynamics.

I attach the output error.

error_restart.txt

Thank you

Jeremías

bknight1 commented 1 year ago

Hey @jlikermanUPC, I'll move this to the UW2 repo and take a look! Thanks for reporting the issue.

bknight1 commented 1 year ago

Okay I've run a few tests, I'm not sure how your script is set up to restart the model but the following works:

  1. Run the model setup script again, all the way to the original 'Model.run_for' line.
  2. replace the Model.run_for with the restart parameters (e.g.) 'Model.run_for(1. u.megayears, checkpoint_interval=0.007u.megayears, restartStep=-1, restartDir=Model.outputDir )' This will load the last timestep and start the model again.

I've tested this on UW v2.13.1b with the following script. If your script still isn't working it would be easier to troubleshoot if I had access to it.

Cheers

Restart_test.ipynb.txt

jlikermanUPC commented 1 year ago

Hi Ben!,

Indeed, it is working. And if I run my model a few steps, the restart also works. Could it be that if the passive tracers come out of the model, that's where the problem arises? I'll run some tests and keep you posted. If there are still problems, I'll share the script with you.

Thanks!

bknight1 commented 1 year ago

All good, let me know how it goes @jlikermanUPC

I just tried the test script again with a lower and larger number of particles than that created in the model so I don't think it's that. From the error message it is an error with a mapping function, which is usually a dictionary that maps the material to the material parameters (viscosity, density etc). I'm not sure why the passive tracers would be causing this to be honest. It usually occurs when there is a material index that isn't mapped to a density or viscosity value/function. Was your reload call (Model.run_for) before you'd set up the viscosity mapping to the materials?

bknight1 commented 1 year ago

Hey @jlikermanUPC, how did you get on?

jlikermanUPC commented 1 year ago

Hi @bknight1, so far I haven't had errors again.

I'm going to close the issue for now.

Thanks!

bknight1 commented 1 year ago

All good, happy to help!