-
Notifications
You must be signed in to change notification settings - Fork 0
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 #41 from ProjectTorreyPines/omas_imas
Final switch to IMASDD
- Loading branch information
Showing
8 changed files
with
186 additions
and
28 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
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 |
---|---|---|
|
@@ -14,16 +14,15 @@ env_with_cloned_repo r: | |
@echo "Cloning the repositories and generating Manifest.toml" | ||
-dn=$(shell dirname $(shell pwd)); \ | ||
if [[ "$${dn:(-10)}" == ".julia/dev" ]]; then ext="" ; else ext=".jl";fi; \ | ||
git clone "[email protected]:ProjectTorreyPines/OMAS.jl.git" ../OMAS$${ext}; \ | ||
git clone "[email protected]:ProjectTorreyPines/IMASDD.jl.git" ../IMASDD$${ext}; \ | ||
julia --project=. -e 'using Pkg; Pkg.rm(["OMAS", "IMASDD"]); Pkg.develop(path="../OMAS'$${ext}'"); Pkg.develop(path="../IMASDD'$${ext}'"); Pkg.instantiate()' | ||
julia --project=. -e 'using Pkg; Pkg.rm(["IMASDD"]); Pkg.develop(path="../IMASDD'$${ext}'"); Pkg.instantiate()' | ||
|
||
env_with_git_url u: | ||
@echo "Pulling sample files using dvc" | ||
-dvc pull | ||
@echo "Creating Julia environment with the git urls without creating local clones" | ||
@echo "Generating Project.toml and Manifest.toml" | ||
julia --project=. -e 'using Pkg; Pkg.rm(["OMAS", "IMASDD"]); Pkg.add(url="[email protected]:ProjectTorreyPines/OMAS.jl.git", rev="master"); Pkg.add(url="[email protected]:ProjectTorreyPines/IMASDD.jl.git", rev="master"); Pkg.instantiate()' | ||
julia --project=. -e 'using Pkg; Pkg.rm(["IMASDD"]); Pkg.add(url="[email protected]:ProjectTorreyPines/IMASDD.jl.git", rev="master"); Pkg.instantiate()' | ||
|
||
clean: | ||
@echo "Deleting Manifest.toml" | ||
|
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,6 +1,6 @@ | ||
module GGDUtils | ||
|
||
import OMAS as IMASDD | ||
using IMASDD: IMASDD | ||
|
||
const inv_16pi = 1.0 / (16π) | ||
|
||
|
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
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,83 @@ | ||
import GGDUtils: interp, get_kdtree, project_prop_on_subset!, get_grid_subset, IMASDD | ||
|
||
println("-----------------------------------------------------------------------------") | ||
print("json2imas() time with compilation: ") | ||
@time ids = IMASDD.json2imas( | ||
"$(@__DIR__)/../samples/time_dep_edge_profiles_last_step_only.json", | ||
) | ||
print("json2imas() time (true runtime): ") | ||
@time ids = IMASDD.json2imas( | ||
"$(@__DIR__)/../samples/time_dep_edge_profiles_last_step_only.json", | ||
) | ||
|
||
println("-----------------------------------------------------------------------------") | ||
n_e = ids.edge_profiles.ggd[1].electrons.density[1]; | ||
grid_ggd = ids.edge_profiles.grid_ggd[1]; | ||
space = grid_ggd.space[1] | ||
print("interp(prop, grid_ggd) time with compilation: ") | ||
@time get_n_e = interp(n_e, grid_ggd) | ||
print("interp(prop, grid_ggd) (true runtime): ") | ||
@time get_n_e = interp(n_e, grid_ggd) | ||
|
||
println("-----------------------------------------------------------------------------") | ||
subset = get_grid_subset(grid_ggd, 5) | ||
|
||
print("interp(prop_arr, space, subset) time with compilation: ") | ||
@time get_n_e = interp(ids.edge_profiles.ggd[1].electrons.density, space, subset) | ||
print("interp(prop_arr, space, subset) time (true runtime): ") | ||
@time get_n_e = interp(ids.edge_profiles.ggd[1].electrons.density, space, subset) | ||
|
||
println("-----------------------------------------------------------------------------") | ||
print("interp(prop_arr, grid_ggd, grid_subset_index) time with compilation: ") | ||
@time get_n_e = interp(ids.edge_profiles.ggd[1].electrons.density, grid_ggd, 5) | ||
print("interp(prop_arr, grid_ggd, grid_subset_index) time (true runtime): ") | ||
@time get_n_e = interp(ids.edge_profiles.ggd[1].electrons.density, grid_ggd, 5) | ||
|
||
println("-----------------------------------------------------------------------------") | ||
kdtree = get_kdtree(space) | ||
print("interp(prop_arr, kdtree) time with compilation: ") | ||
@time get_T_e = interp(ids.edge_profiles.ggd[1].electrons.temperature[1].values, kdtree) | ||
print("interp(prop_arr, kdtree) time (true runtime): ") | ||
@time get_T_e = interp(ids.edge_profiles.ggd[1].electrons.temperature[1].values, kdtree) | ||
|
||
println("-----------------------------------------------------------------------------") | ||
prop = ids.edge_profiles.ggd[1].electrons.density | ||
# All cells | ||
from_subset = get_grid_subset(ids.edge_profiles.grid_ggd[1], 5) | ||
# separatix | ||
to_subset = get_grid_subset(ids.edge_profiles.grid_ggd[1], 16) | ||
print( | ||
"project_prop_on_subset!(prop, from_subset, to_subset, space) time with compilation: ", | ||
) | ||
@time separatix_centers, values_at_separatix = | ||
project_prop_on_subset!(prop, from_subset, to_subset, space) | ||
print( | ||
"project_prop_on_subset!(prop, from_subset, to_subset, space) time (true runtime): ", | ||
) | ||
@time separatix_centers, values_at_separatix = | ||
project_prop_on_subset!(prop, from_subset, to_subset, space) | ||
|
||
println("-----------------------------------------------------------------------------") | ||
subset_core = | ||
get_grid_subset(ids.edge_profiles.grid_ggd[1], 22) | ||
print("project_prop_on_subset!(prop, from_subset, subset_core) time with compilation: ") | ||
@time core_element_inds, values_at_core = | ||
project_prop_on_subset!(prop, from_subset, subset_core) | ||
print("project_prop_on_subset!(prop, from_subset, subset_core) time (true runtime): ") | ||
@time core_element_inds, values_at_core = | ||
project_prop_on_subset!(prop, from_subset, subset_core) | ||
|
||
println("-----------------------------------------------------------------------------") | ||
subset_corebnd = get_grid_subset(grid_ggd, 15) | ||
subset_sol = get_grid_subset(grid_ggd, 23) | ||
subset_odr = get_grid_subset(grid_ggd, 24) | ||
|
||
print("test ∈ (edges) time with compilation: ") | ||
@time (6.0, 0.0) ∈ (subset_corebnd, space) | ||
print("test ∈ (edges) time (true runtime): ") | ||
@time (6.0, 0.0) ∈ (subset_corebnd, space) | ||
|
||
print("test ∈ (cells) time with compilation: ") | ||
@time (6.0, 4.0) ∈ (subset_sol, space) | ||
print("test ∈ (cells) time (true runtime): ") | ||
@time (6.0, 4.0) ∈ (subset_sol, space) |