-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from JuliaGeodynamics/nr-vtk-python2julia
Replace python with julia
- Loading branch information
Showing
12 changed files
with
669 additions
and
348 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module IO | ||
# this contains I/O routines of LaMEM, which don't require LaMEM_jll | ||
|
||
include("read_timestep.jl") | ||
export Read_LaMEM_PVTR_File, Read_LaMEM_PVTS_File, field_names, readPVD, Read_LaMEM_PVTU_File | ||
|
||
include("utils_IO.jl") | ||
export clean_directory, changefolder | ||
|
||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,16 @@ | ||
module LaMEM | ||
using LaMEM_jll | ||
using PythonCall | ||
using Glob | ||
|
||
ENV["JULIA_CONDAPKG_BACKEND"] = "MicroMamba" | ||
|
||
# load the correct MPI | ||
const mpiexec = if isdefined(LaMEM_jll,:MPICH_jll) | ||
LaMEM_jll.MPICH_jll.mpiexec() | ||
elseif isdefined(LaMEM_jll,:MicrosoftMPI_jll) | ||
LaMEM_jll.MicrosoftMPI_jll.mpiexec() | ||
else | ||
nothing | ||
end | ||
|
||
# Reading files back into julia | ||
const pyvtk = PythonCall.pynew() | ||
|
||
function __init__() | ||
|
||
println("Adding PythonCall dependencies to read LaMEM timesteps") | ||
pth = (@__DIR__)*"/python" # Path where the python routines are | ||
pyimport("sys").path.append(pth) # append path | ||
|
||
# link vtk. Note that all python dependencies are listed in PythonCallDeps.toml | ||
PythonCall.pycopy!(pyvtk, pyimport("vtk")) # used to read VTK files | ||
end | ||
|
||
|
||
include("run_lamem.jl") | ||
include("run_lamem_save_grid.jl") | ||
include("read_timestep.jl") | ||
include("utils.jl") | ||
|
||
export run_lamem | ||
export run_lamem_save_grid | ||
export pyvtk | ||
# Functions to read LaMEM output | ||
include("IO.jl") | ||
using .IO | ||
export Read_LaMEM_PVTR_File, Read_LaMEM_PVTS_File, Read_LaMEM_PVTU_File | ||
export Read_LaMEM_simulation, Read_LaMEM_timestep, Read_LaMEM_fieldnames | ||
export clean_directory, changefolder | ||
|
||
# Functions | ||
include("Run.jl") | ||
using .Run | ||
export run_lamem, run_lamem_save_grid, mpiexec | ||
export remove_popup_messages_mac, show_paths_LaMEM | ||
|
||
end # module |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module Run | ||
# module to run LaMEM_jll | ||
using LaMEM_jll,Glob | ||
|
||
export run_lamem, run_lamem_save_grid, mpiexec | ||
export remove_popup_messages_mac, show_paths_LaMEM | ||
|
||
include("run_lamem.jl") | ||
include("run_lamem_save_grid.jl") | ||
include("utils_Run.jl") | ||
|
||
# load the correct MPI | ||
const mpiexec = if isdefined(LaMEM_jll,:MPICH_jll) | ||
LaMEM_jll.MPICH_jll.mpiexec() | ||
elseif isdefined(LaMEM_jll,:MicrosoftMPI_jll) | ||
LaMEM_jll.MicrosoftMPI_jll.mpiexec() | ||
else | ||
nothing | ||
end | ||
|
||
|
||
end |
Oops, something went wrong.