Closed iamlll closed 1 year ago
Could you please post a complete minimal example that reproduces the error? This would help us to locate the error!
For sure, sorry about that!
def MWE():
L = 10; resolution = 2;
np.random.seed(0)
grid = pde.CartesianGrid([[-int(L/2), int(L/2)], [-int(L/2),int(L/2)]], [int(resolution*L), int(resolution*L)], periodic=True)
B = 0.1; A = 1
bins = np.linspace(-L/2,L/2,int(resolution*L))
expr = {
'xx': f'{B}*d_dx(xx) + {A}',
}
x = pde.ScalarField.random_uniform(grid,label='xx') - 0.5
eq = pde.PDE(expr,bc="auto_periodic_neumann")
state = pde.FieldCollection([x])
storage = pde.MemoryStorage()
result = eq.solve(state,t_range=tmax,dt=1E-2,tracker=storage.tracker(0.1))
state.plot()
result.plot()
print('done')
The problem runs without issues on my computer, so I suspect that you setup might be compromised. Could you post the output of running pde.environment()
here?
OMP: Info #276: omp_set_nested routine deprecated, please use omp_set_max_active_levels instead. {'package version': '0.16.7', 'python version': '3.9.16 | packaged by conda-forge | (main, Feb 1 2023, 21:38:11) \n[Clang 14.0.6 ]', 'platform': 'darwin', 'config': {'numba.debug': False, 'numba.fastmath': True, 'numba.parallel': True, 'numba.parallel_threshold': 65536}, 'mandatory packages': {'matplotlib': '3.4.2', 'numba': '0.54.1', 'numpy': '1.20.3', 'scipy': '1.7.0', 'sympy': '1.9'}, 'matplotlib environment': {'backend': 'MacOSX', 'plotting context': 'BasicPlottingContext'}, 'optional packages': {'h5py': '3.8.0', 'napari': 'not available', 'pandas': '1.3.0', 'pyfftw': 'not available', 'tqdm': '4.62.3'}, 'numba environment': {'version': '0.54.1', 'parallel': True, 'fastmath': True, 'debug': False, 'using_svml': False, 'threading_layer': 'omp', 'omp_num_threads': None, 'mkl_num_threads': None, 'num_threads': 8, 'num_threads_default': 8, 'cuda_available': False, 'roc_available': False}}
The output shows that you use the very outdated version 0.16.7 of the py-pde
package. The current version is 0.28.0, so you should simply update and see whether the error disappears.
That worked, thank you so much! Although now the pde.environment() command no longer works and returns a FileNotFound error. Was this function deprecated in the newest version of py-pde?
This is strange – can you post the exact traceback (the full error message)?
pde.environment()
Traceback (most recent call last):
File "
Thanks for the report! I opened this as the new issue #399 since this is an unrelated problem.
Hello,
I am trying to simulate a similar sort of equation as was discussed previously (see below). The equation I'm interested in also requires unidirectional derivative operators d/dx, d/dy, and d/dz. An simplified snippet of code I used to define my equations is expr = {'x': f'{A}d_dx(d_dy(y)) + [isotropic terms]', 'y': f'{A}d_dx(d_dy(x)) + [isotropic terms]'}, based on Example 2.12. eq = pde.PDE(expr) This formulation worked several weeks ago, but now somehow I am now getting NameError messages (in _lambdifygenerated) that "d_dx is not defined" when I try to solve the resulting system of equations using result = eq.solve(state,t_range=tmax,dt=1E-2,tracker=writer.tracker(dt)) The simulation runs without any issue if I set A = 0. Do you have any idea what might be causing this? I am quite new to using your package, so any suggestions or advice would be much appreciated!
Discussed in https://github.com/zwicker-group/py-pde/discussions/366