Closed iamlll closed 1 year ago
Hi, the issue is just that the locals() namespace is combined with some built-in names when you build the problem object, and that dictionary is used to parse the equations. You just need to put all the substitution definitions before you instantiate the problem object.
Hello, sorry if this is a very naive question! I didn't manage to find information about this topic elsewhere, so I thought I'd ask here: I've been following along with this tutorial (https://dedalus-project.readthedocs.io/en/latest/notebooks/dedalus_tutorial_3.html) and wanted to define separate functions to save/run the simulation and then plot the results. However, the operator substitutions (i.e. dx) don't seem to be read in properly when I run
problem.add_equation(...)
inside a function as opposed to a script and I am getting NameErrors that "name 'dx' is not defined." Would you happen to know how I could fix this issue?The code I'm using is really just a copy-paste of the above tutorial into some function
Run()
that gets called in the main function: ``