boriskaus / MagmaThermoKinematics.jl

Package to simulate the thermal evolution of magmatic systems
MIT License
15 stars 3 forks source link

When I tried to import a function in REPL, I got an error that it could not be imported. #13

Open Search-Enemy opened 4 months ago

Search-Enemy commented 4 months ago

Under julia1.10.0 version, I successfully ran the readme code. But when reading the source code, there is such a line of instructions in diffusion.jl in src: import ..compute_meltfraction_ps!, ..compute_dϕdT_ps!, ..compute_density_ps!, ..compute_heatcapacity_ps!, ..compute_conductivity_ps!,..compute_radioactive_heat_ps!, .. compute_latent_heat_ps!, I tried to execute this instruction in the REPL, but encountered the warning WARNING: could not import Main.compute_meltfraction_ps! into Main, which prevented me from executing @parallel (1:Nx, 1:Nz) compute_meltfraction_ps!(Arrays. ϕ, Mat_tup, Phases, args1). I want to know what is the reason and in which package these functions exist? Thank you Professor Boris.

boriskaus commented 4 months ago

Dear @Search-Enemy (interesting username; I initially thought this was spam).

These are functions that come from GeoParams for which we provided wrappers to ParallelStencil. ParallelsStencil is used to allow the code to run (much faster) on a GPU (graphics cards). A disadvantage is that it needs to be initialised before running and as such, it is generally not recommended to directly run this in the REPL.

Instead, I recommend that you customise your setup by modifying some of the routines here.